communication midi high speed between teensy

Status
Not open for further replies.

Anoat

Active member
Hello,

I allow myself to write to you because I need your help and advice in my project. I am new to the world of teensy.

I make an analog synthesizer controlled in "midi". For that I chose teensy (teensy 3.6). I made most of the schemas however I ask myself several questions.

The synthesizer is composed of 4 voices controlled separately via the MIDI controller. Each voice is composed of a teensy piloting DAC and digipot. In sum there are 5 teensy (one for the midi controller and 4 for each voice). 4 switch (1 per voice) to indicate to the MIDI controller which voice it controls (for example if the switch 3 is switched on then the controller controls the voice 3, if the switches 3 and 4 are on then the controller pilot the voice 3 and 4)

To communicate between the midi contoller and the voices I hesitate between two solutions.

The first one: I use a TX output of the teensy of the MIDI controller connected to the Rx of teensy voices, parralele I use 4 pin to indicate with which the controller midi communicates.If the pin is high then the teensy of the voice concerned listening.

The second: I multiplex the TX output of the MIDI controller with a 4051, which gives me 8 MIDI outputs.
(as http://little-scale.blogspot.com/2009/09/multiplexing-midi-output-streams-with.html)


According to you what would be the best solutions, I look for the fastest communication?

I profile to ask if it is possible to increase the speed of communication between the Teensy at noon, the baud is normally expected to 31250 however I imagine that between the Teensy we must be able to go up to 2Mbit / s ?

Very cordially
 
Theoretically UART MIDI can run at any baud rate as long as both devices support it, I happen to own a device that had selectable speeds from the early 90’s. However since you are using the Teensy 3.6 I would suggest using USB MIDI since it’s the simplest to setup without modifying any libraries and the fastest form of communication offered from a Teensy.
 
Thank you for your reply.

I thought of this solution, however the Teensy USB port (MIDI controller) is already used for sending and receiving MIDI data from the computer.

Maybe it is possible to use the second USB port of the teensy? Basically a USB port for sending and receiving MIDI data from the computer and a second port to communicate with the 4 teensy of the 4 voices?

Or maybe it is possible to use only one teensy USB port via a hub?
 
The second USB port has to be used to connect other devices, the first can only be connected to a computer or power. You would connect a powered USB hub to the second USB port then connect your four voice Teensies to the hub, this also allows you to easily connect more in the future if 4 is not enough.
 
Or maybe it is possible to use only one teensy USB port via a hub?

The USBHost_t36 library is used for that 2nd USB host port. It does support using USB hubs, so you can indeed plug many other Teensy boards into the hubs and read them all from the Teensy 3.6.

However, you might wish to consider ground connections. With USB, everything will have a common ground. Maybe that is ok for your project? The problem with common digital signal grounds comes in when you have each MIDI device creating analog signals, which then connect to the analog grounds of other gear. If you're not very careful, you can get a "ground loop" which causes buzzing or strange noise.

Serial MIDI normally uses an optocoupler on each input, so the digital grounds never connect between MIDI devices. Usually this prevents ground loops even when you plug together lots of MIDI gear without careful thought about grounds. So even though USB is superior in speed and flexibility (using USB hubs), the huge advantage of serial MIDI is use of the optocouplers to (usually) automatically prevent ground loops.

Teensy can pretty easily do high baud rates, but most optocouplers can't. For example, if you look at the 6N138 datasheets, you'll see typical delay of 1 to 4 us. That's pretty good for 31250 baud, which has a bit length of 32 us. But if you try to run at 1 Mbit/sec, the optocoupler will be far too slow to reliably pass the signal. You'll need a much faster part. Fortunately they do exist, but they're more expensive. A quick search at Digikey turned up this part, which claims to handle up to 25 Mbit/sec.

https://www.digikey.com/product-detail/en/broadcom-limited/ACPL-772L-000E/516-2901-ND

But another complexity of using this sort of very high speed optocoupler is the need for power at the input side. You'll also need an isolated power supply. Or maybe you could send power from the Teensy generating the signal, perhaps through a PTC "fuse" if the power will run over a cable. If you want to run very fast and also have grounds isolated, you'll have to work around the requirements of these higher speed optocouplers.
 
At first I planned to use comunication with the coupler, but it was a lot of problem.

In hindsight the USB communication seems more suitable in my project, because I intend to use 6 teensy with the MIDI controller.
I plan to use a USB hub port 7 ucb2517.

Mass loops are going to be a big problem, I have to be vigilant. I have to consider putting filters on all the ciruit and maybe even between the masses?

Can USB communication create mass loops?
 
Status
Not open for further replies.
Back
Top