[PD] Question about transmission order to serial port [comport] with two independent streams

Ingo ingo at miamiwave.com
Sun Jul 14 16:26:42 CEST 2019


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.
MIDI timing is more critical than the display timing so MIDI has to always 
interrupt anything and get out as fast as possible.

My question is actually very simple:

Can a message with two bytes 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 at 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 at miamiwave.com>
> > An: 'pd-list' <pd-list at 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 at lists.iem.at mailing list
> > UNSUBSCRIBE and account-management ->
> > https://lists.puredata.info/listinfo/pd-list
> >







More information about the Pd-list mailing list