Author Topic: Arduino and DM5  (Read 1560 times)

Arduino and DM5
« on: April 19, 2017, 07:07:12 PM »
Hello everyone, I'm trying to get my DM5 to accept MIDI messages from an Arduino. This is the sketch I'm running, basically the example sketch with some minor changes

 
Code: [Select]
void setup() {
  Serial.begin(31250);
}

void loop {
  for (int note = 36; note < 97; note ++) {
   
    noteOn(1, note, 120);
    delay(500);
   
    noteOn(1, note, 12);   
    delay(500);
  }
}

void noteOn(int cmd, int pitch, int velocity) {
  Serial.write(cmd);
  Serial.write(pitch);
  Serial.write(velocity);
}

I've gotten it to work once, but after power cycling the Arduino I no longer hear sounds from the DM5(through headphones). On the DM5 the input channel is set to "00" which I though is OMNI, but I'm not sure. I connected the Arduino through a MIDI to USB cable and then used MIDI-OX to check the transmission, and sure enough, I saw everything being sent like it should. So, I'd think, that something isn't right with the DM5. Any suggestions?Any help is greatly appreciated, and sorry if I posted this in the wrong section.

**edited cause I prematurely posted it
« Last Edit: April 19, 2017, 07:21:54 PM by wjsaunders »

Re: Arduino and DM5
« Reply #1 on: April 20, 2017, 04:15:23 PM »
Hello.
If you want the drum channel you have to write in the line "noteOn(1, note, 120);"
this "noteOn(144 + 9, note, 120);"
The "144" is the noteon command and the "9" is the drum channel.
If you want other channel you have to write 144 + number of channel.

Re: Arduino and DM5
« Reply #2 on: April 20, 2017, 11:17:32 PM »
Ah! Works like a charm now, thanks!