Teensy to Teensy communication trough MIDI

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Lakitna
 
Posts: 100
Joined: Tue Sep 09, 2014 10:02 am

Teensy to Teensy communication trough MIDI

Post by Lakitna »

Hey everyone,

Im the project I'm working on I've got two separate parts, both running different code. Simplified it looks like this:

Input / controller [Teensy 3.1] >> PC >> output [Teensy 3.1 + OctoWS2811]

The PC acts here as a data pass trough. It catches all data transmitted by the input and directs it to the output. For the devices to talk to each other I'm using the Teensy's in MIDI-mode. The data pass through on the pc is handled by Max/MSP in the following sketch.
Screen Shot 2014-12-10 at 16.50.29.png
Screen Shot 2014-12-10 at 16.50.29.png (74.59 KiB) Viewed 545 times
This worked like a charm back when I used an store-bought MIDI-controller as input instead of the Teensy I'm trying to use right now. But now it doesn't work. I can't even get just the input to work right now. I think the problem is that both Teensy MIDI devices listen to the exact same name, thus interfering with each other.

As far as code goes. I am using the standard Teensy MIDI code snippets as found here https://www.pjrc.com/teensy/td_midi.html

Do you guys know any way to solve this issue, preferably without a direct physical connection between both Teensy's. I'm trying to keep things modular :)

I'm sure I've forgotten crucial details, so please ask!

User avatar
Lakitna
 
Posts: 100
Joined: Tue Sep 09, 2014 10:02 am

Re: Teensy to Teensy communication trough MIDI

Post by Lakitna »

My mind keeps thinking about this, and I realise I've forgotten some important info regarding the answer I'm looking for.

I need a way for the two Teensy's to communicate and I don't really care how, as long as it's through the USB cables. It must be a reliable, fast way to communicate that is reasonably effortless to set up. I like MIDI on both ends because it is effortless, quick and reliable.

I have already googled for a way to change one of the device names. This is, however, not possible within individual code. In order to do that you must change a config file and all Teensy MIDI names will get altered. So that won't help me :(
If you guys do know a way to change the device name in the individual code please, please share it with me. I'll be eternally grateful and stuff :)

User avatar
Lakitna
 
Posts: 100
Joined: Tue Sep 09, 2014 10:02 am

Re: Teensy to Teensy communication trough MIDI

Post by Lakitna »

You guys aren't the only ones I asked for this, someone suggested using MIDI channels instead of MIDI device names.

Because of that suggestion I approached the problem from a fresh angle and rewrote the Max/MSP code to this. Currently it only features control and note values, but other values are possible in a similar way.

Image

There is still a certain workflow one must follow though.
Attach transmitting Teensy >> Open Max sketch >> attach receiving Teensy

But hey, it works and is good enough for me at the moment!

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”