[sysex] is used for MIDI messaging and OSC is designed around network-based communication, hence the ethernet shield.
What I think you want is simple serial communication which is essentially sending / reading raw byte values. I would look into something like http://playground.arduino.cc/Code/CmdMessenger http://playground.arduino.cc/Code/CmdMessenger.
The basic idea is similar to OSC, a protocol which determines which bytes are what and how to read them back correctly on the other end. I’m sure you could implement the CmdMessanger protocol in Pd using the [list toSymbol], [list fromSymbol], [oscparse], & [oscformat] object, or roll your own.
Dan Wilcox @danomatika https://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/
On Jun 1, 2016, at 8:29 AM, pd-list-request@lists.iem.at wrote:
From: Rick Snow <ricksnow@gmail.com mailto:ricksnow@gmail.com> Subject: [PD] Pduino sysex vs. OSC advice Date: June 1, 2016 at 8:29:16 AM MDT To: pd-list@lists.iem.at mailto:pd-list@lists.iem.at
Hello list!
I am looking for some advice on sending messages from PD to an Arduino sketch. Essentially, I plan to connect a mac to an Arduino via USB and control a large amount of variables within the Arduino sketch from PD.
Is using the sysex message with the [arduino] object message the way to go with this? How can I "tag" the messages so that they go to the correct variable in the arduino sketch? Is there a practical limit to the speed of such a system?
I am much more familiar with using OSC messaging between applications but when I looked into using OSC with Arduino it seemed like I needed to use an ethernet shield (instead of connect via usb) and I would rather not go that route unless absolutely necessary.
Any advice is much appreciated!
cheers, Rick
Thanks for the heads up Dan!
I spent a bit of time with CmdMessenger yesterday and bumped into the old comma/semicolon in a pd message issue. At least in the example sketches the serial communication needed a command tag and a value defined in the format : "command tag number, value number;"
I searched the pd forums for a solution to this but was unable to make anything work in the time I had to work on it. I did end up looking at the rc library any2byte, byte2any a bit though and it looked like this might offer a solution.
Does anyone know if there is a way to use the comma and the semicolon in a pd message in order to send it to the comport effectively?
cheers, Rick
On Wed, Jun 1, 2016 at 1:58 PM, Dan Wilcox danomatika@gmail.com wrote:
[sysex] is used for MIDI messaging and OSC is designed around network-based communication, hence the ethernet shield.
What I think you want is simple serial communication which is essentially sending / reading raw byte values. I would look into something like http://playground.arduino.cc/Code/CmdMessenger.
The basic idea is similar to OSC, a protocol which determines which bytes are what and how to read them back correctly on the other end. I’m sure you could implement the CmdMessanger protocol in Pd using the [list toSymbol], [list fromSymbol], [oscparse], & [oscformat] object, or roll your own.
Dan Wilcox @danomatika https://twitter.com/danomatika danomatika.com robotcowboy.com
On Jun 1, 2016, at 8:29 AM, pd-list-request@lists.iem.at wrote:
*From: *Rick Snow ricksnow@gmail.com *Subject: **[PD] Pduino sysex vs. OSC advice* *Date: *June 1, 2016 at 8:29:16 AM MDT *To: *pd-list@lists.iem.at
Hello list!
I am looking for some advice on sending messages from PD to an Arduino sketch. Essentially, I plan to connect a mac to an Arduino via USB and control a large amount of variables within the Arduino sketch from PD.
Is using the sysex message with the [arduino] object message the way to go with this? How can I "tag" the messages so that they go to the correct variable in the arduino sketch? Is there a practical limit to the speed of such a system?
I am much more familiar with using OSC messaging between applications but when I looked into using OSC with Arduino it seemed like I needed to use an ethernet shield (instead of connect via usb) and I would rather not go that route unless absolutely necessary.
Any advice is much appreciated!
cheers, Rick
On 2016-06-02 16:51, Rick Snow wrote:
Thanks for the heads up Dan!
I spent a bit of time with CmdMessenger yesterday and bumped into the old comma/semicolon in a pd message issue. At least in the example sketches the serial communication needed a command tag and a value defined in the format : "command tag number, value number;"
I searched the pd forums for a solution to this but was unable to make anything work in the time I had to work on it. I did end up looking at the rc library any2byte, byte2any a bit though and it looked like this might offer a solution.
Does anyone know if there is a way to use the comma and the semicolon in a pd message in order to send it to the comport effectively?
since you can pass raw bytes to [comport], you could just insert "44" (resp. "59") at the relevant places.
fgamsdr IOhannes
Does anyone know if there is a way to use the comma and the semicolon in a pd message in order to send it to the comport effectively?
since you can pass raw bytes to [comport], you could just insert "44" (resp. "59") at the relevant places.
hi,
another topic, but i thought i'd share my experiences since they are nowhere documented:
on windows, there's the big problem of backslashes (instead of slahes on unixes) for directory hierarchy when it comes to the command line. inside PD that's not a problem since slashes are treated as backslashes when used in filenames.
however: i sometimes use 3rd party .exe files from within PD (namely SOX and FFMPEG for conversion purposes) together with the auld [system] external from the MOTEX library. when you do this you really NEED the backslash, otherwise your commands won't work.
my workaround is this:
i start PD with a batch script and there i define an environment variable for the backslash like this:
SET BSL=\
in a PD patch i can use this environment variable like this:
[mkdir C:%BSL%Temp%BSL%testdir( | [system]
to get the job done.
i guess the same method would apply to other special characters that are not allowed natively inside PD.
hope this is of some help
best
oliver