Pages: [1]   Go Down
Author Topic: simultaneous midi message sent to arduino are lost  (Read 1651 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

Code:
#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
    }
}
Logged

Offline Offline
Edison Member
*
Karma: 48
Posts: 1628
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Edison Member
*
Karma: 48
Posts: 1628
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pete
Logged

Pages: [1]   Go Up
Jump to: