simultaneous midi message sent to arduino are lost

I’m using the following code to convert midi CCs to DMX commands. it works until I send 2 CC messages at the exact same time and then nothing happens at the output. I have used callbacks and observed the same behavior. I have reduced my code to the bare minimum and still seeing the issue.

I’ve had the same issue when controlling digital RGB strips via SPI as I am having with DMX, so I don’t think it is the DMX library. Any thoughts?? thx :slight_smile:

#include <MIDI.h>
#include <DmxMaster.h>

void setup() 
{
  MIDI.begin();            	// Launch MIDI with default options // (input channel is default set to 1)
  DmxMaster.usePin(3);  //Launch DMX with default output for tinker DMX shield
  DmxMaster.maxChannel(20); 
}

void loop() { 
    while(MIDI.read()) //if data is in the midi buffer
    {
      DmxMaster.write(MIDI.getData1(), MIDI.getData2());     //send DMX message using midi information
    }
}

How do you send two commands at the same time? MIDI is a serial protocol which only permits the transmission of one byte at a time.

Pete

I should have elaborated, I am sending the messages at the same time from Ableton live. I'm assuming that the 2 CC messages will arrive at the arduino very soon after one another. Maybe the arduino is reading the 2 messages as one long, invalid, MIDI message??

thx

el_supremo: How do you send two commands at the same time? MIDI is a serial protocol which only permits the transmission of one byte at a time.

Pete

I would modify the code to print out what the MIDI library is actually seeing and go from there.

Pete