The SLIP protocol has actually more overhead than what I'm thinking of.
generally the overhead is one byte per message + escape bytes if the data itself contains 192 or 219.
On top of it it is more prone to generate errors with MIDI since it uses Bytes
if used correctly, the SLIP protocol can handle any kind of data (otherwise it would be not a very useful protocol).
Can a message going to comport be interrupted by another message that is being sent to [comport] almost at the same time or will one message or packed list always be processed completely before anything else will be sent to the same [comport] object.
message passing in Pd is synchronous, so there's no way two messages can interleave.
still you need to think about how to reliably distinguish MIDI from other data in your Arduino, so the advice in my last mail might still apply.
Christof
Gesendet: Sonntag, 14. Juli 2019 um 15:58 Uhr Von: "Ingo Scherzinger" eeemail@dynasample.com An: "'Christof Ressi'" christof.ressi@gmx.at, 'Pd-List' pd-list@lists.iem.at Betreff: RE: [PD] Question about transmission order to serial port [comport] with two independent streams
Thanks, Christof!
The SLIP protocol has actually more overhead than what I'm thinking of. On top of it it is more prone to generate errors with MIDI since it uses Bytes that are also used as MIDI Status Bytes.
My question is actually very simple:
Can a message going to comport be interrupted by another message that is being sent to [comport] almost at the same time or will one message or packed list always be processed completely before anything else will be sent to the same [comport] object.
Ingo
-----Original Message----- From: Christof Ressi [mailto:christof.ressi@gmx.at] Sent: Sunday, July 14, 2019 3:32 PM To: Ingo; Pd-List Subject: Aw: [PD] Question about transmission order to serial port [comport] with two independent streams
When sending data over a serial connection, it's good to have some sort of protocol to distinguish messages. A very common protocol is SLIP https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol It's often used for streaming OSC messages (e.g. TCP or serial). You can encode in Pd with [mrpeach/slipenc] and decode on the Arduino with https://github.com/CNMAT/OSC/blob/master/SLIPEncodedSerial.h
On the other hand, MIDI is already a protocol (messages are delimited by status bytes) and you could send your display data on an unused MIDI channel or even as Sysex messages.
Christof
Gesendet: Sonntag, 14. Juli 2019 um 14:59 Uhr Von: "Ingo" ingo@miamiwave.com An: 'pd-list' pd-list@iem.at Betreff: [PD] Question about transmission order to serial port [comport] with two independent streams
Hi there,
I need to send both display data and MIDI out data to the same serial port via USB using [comport] going to an Arduino Micro. The MIDI goes on to the serial transmit pin and the display goes to the I2C pins. Unfortunately neither the display nor the MIDI data is very predictable concerning timing.
The display uses drip to send one character after the other and MIDI is sending out manipulated data from the MIDI input whenever MIDI
comes in.
Both senders are on different sections of the software and are not synchronized in any way.
Since I need to find a way to split up each stream inside of the Arduino without meshing them up and causing errors my question is:
Does Pd send one message (or packed numbers) with two or more values without interruption? If yes I could simply prepend an unused number (like e.g. 253 or 254) as a header in front of each MIDI Byte. If needed another one for the display data. (The latter is probably not necessary since I can reset after each MIDI Byte inside of the Arduino to keep sending again to the display.)
Meshing up MIDI and display data would be absolutely chaotic! If I can't guarantee that each Byte goes to the correct destination I will have to use two separate arduinos.
Thanks! Ingo
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list