Messages between two Teensy 3.1 over XBee: should I go MIDI or not?

Status
Not open for further replies.

amundsen

Well-known member
Hello,

I have two Teensy 3.1. The first sends data to the second over an XBee connection. The second has sensors and sends data from those sensors and should transmit everything to a computer as MIDI messages over USB.

The question is: if the messages sent from the first Teensy were encoded as MIDI directly from start would it ease their retransmission from the second Teensy or should I rather transmit them as regular serial messages over the Xbee connection first and convert them to MIDI in the second Teensy afterwards? Also, if I'd go MIDI-over-XBee, would a non-MIDI baudrate (that is, different from, probably bigger than 31250) for the XBee transmission cause any issue?

Thank you in advance.
 
I'd personally have the pc connected teensy generate the MIDI so that your recieved can be 'dumb' and would make adding more recievers later on easier
But I should imagine both would work
 
The computer will be the final destination so I won't convert any more from there but having incoming messages encoded in MIDI eases distribution among computer software's parts.
 
XBee series 1 or series 2?
The former is the more straightforward 802.15.4 only, or with Digi's Digimesh. Easier to use than Zigbee.
The latter is Zigbee only and that changes your strategy.

MIDI over Xbee... data is send in frames of about 90 bytes of user data. With Series 1 in 802.15.4 mode, no routed network needed, using MAC addressing... expect ideal signal conditions: 30Kbps on average but variable latency due to 2.4GHz being shared with WiFi et al. Will that speed and latency work with MIDI? Your code on an MCU will need to compose frames (Digi API mode) from a MIDI stream, I'd assume.

There is the transparent serial mode. If the MIDI data rate is anywhere near 30Kbps, you'll need to implement CTS for flow control.

The XBee Series 1 (maybe series 2, don't know), can have custom baud rates but the XBee's CPU is 8MHz and the baud rate error may be OK or may be too high if you do the math. The XBee doesn't have a fractional baud rate divider.
 
My XBee are series 1, so thats good news if I got it right.

Usually I use the transparent mode but I have never dealt with CTS. I'll check that.

Thank you stevech.
 
Status
Not open for further replies.
Back
Top