[PD] routing serial data
christof.ressi at gmx.at
Fri Oct 23 20:37:28 CEST 2015
you could also use a protocol. I'm using this OSC library to communicate between arduino and Pd:
The OSC data is send via serial using SLIP encoding.
Actually, for very simple data, SLIP encoding alone is enough. With SLIP, you can send lists of bytes instead of only single bytes. Pd has the [slipdec] object my Martin Peach for decoding.
Gesendet: Freitag, 23. Oktober 2015 um 19:25 Uhr
Von: "ray Y" <raybuay at hotmail.com>
An: "Alexandros Drymonitis" <adrcki at gmail.com>, "pd-list at lists.iem.at" <pd-list at lists.iem.at>
Betreff: Re: [PD] routing serial data
i used Serial.write in the arduino sketch so i should be getting 4
8 bit bytes. i will check your examples and see how it goes
De: Alexandros Drymonitis <adrcki at gmail.com>
Enviado: viernes, 23 de octubre de 2015 10:07 a. m.
Para: ray Y; PD-list
Asunto: Re: [PD] routing serial data
Including list too
On Fri, Oct 23, 2015 at 8:01 PM, ray Y <raybuay at hotmail.com> wrote:
the print object at the output of comport (for reference)
yeah, that was the first thing i tried but i don't know why it does not
work with the serial stream like it does with a normal list. i tried adding
commas between the values in the arduino sketch but no chance of
splitting the data into each atom in PD
[comport] spits values one by one (actually bytes, so if a value is greater than one byte, it will be split, depending on the way you'll print it from the Arduino - Serial.print or Serial.write). you'll have to assemble them into a list (check help patch of [list] to see how to make a growing list), or make a counter and bang it on every output of [comport], pack the [comport] value with the counter value prepended and use [route].
I've made some abstractions to facilitate the communication between the Arduino and Pd, they'll might work for you. There're here https://github.com/alexdrymonitis/Arduino_Pd[https://github.com/alexdrymonitis/Arduino_Pd]
The [serial_print] abstraction can use the comma as a value delimiter (if you're on Pd-extended, use [serial_print_extended] instead)._______________________________________________ Pd-list at lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list]
More information about the Pd-list