Go Down

Topic: simultaneous midi message sent to arduino are lost (Read 4046 times) previous topic - next topic

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 :)

Code: [Select]
#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
    }
}

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 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


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

el_supremo

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

Pete

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy