Midiusb noteon/noteoff


I am trying to write a midi controller with leonardo pro micro which will

a) be able to play drum hits (using fluid drums)
b) be able to control alolooper and various fx using toggle switches

Part b is working (controlling levels with midi learn and the controlChange() function in the midi usb library)

However i cannot get the noteon/noteoff to work.

I am assuming that i need to send 36 for bass drum and by convention, use midi channel 10.
Therefore I have a loop running over my 4 drum buttons as follows:

void readDrumButtons()
  for (byte i=0;i<4;i++)
    int btnState = io.digitalRead(drumBtns[i]);
    if (btnState!=lastVal[i]) 
      if (btnState==LOW)  noteOn(DRUMCHAN,36+i,0xD0);
      else noteOff(DRUMCHAN,36+i,0xD0);
  if (hasChanged) {delay(5);hasChanged=false;}

When monitored through midiOx midi input diagnostics I get


 00004469   5  --     99    24    D0   10  C  1 Note On               
 00004528   5  --     89    24    D0   10  C  1 Note Off     

Which looks to me ok (am assuming 24 is hex for 36 dec)

However, I cannot hear anything either through Fluid Piano or Fluid drums when the leonardo is connected to the moddwarf

And when I use the midi display utility inside the mod web interfaceI get strange results

For my 4th button (noteon/noteoff 39) the display gives me:


and where the it seems to think its a control message with control 48 value 96 on channel 15 (it is channel 15 but its not a control message)
The same is true for my 3rd and 2nd buttons (noteon/noteoff 38 and 37)

But noteon/noteoff 36 (my first button) produces no result at all.

Is there anything I am missing here? I have checked that audio is on and that the notes both 24 and 36 can trigger sounds in the fluid piano plug iin.

Anyway, if anyone can help I’d be really grateful.

1 Like

Doh! I’ve already answered it (but only by writing out the problem did I arrive at it).

The noteOn volume was too loud (D0=208) - when I reduced it to 60 everything was fine!

Sorry about that! But hope the process might be useful to someone else.


Glad you got it working, and that we could be your “rubber duck” :slight_smile:


I looked around the topic but couldn’t find any information. I’m looking for (as the title suggests) VST apps for piano and keyboards in general for Android (Rhodes, organs, etc). Sometims I think it’s easier to play the traditional piano. While traveling, I’d like to practice with my portable midi controller. I know Ravenscroft 275 is available for iOS, but that’s of no use to me.
So far, I’ve discovered:
Apart from the fact that it does not read information from sustain pedals, iGrand Piano from IK Multimedia receives positive feedback.
Perfect Piano is free and better than nothing, but it is not a genuine challenger in terms of sound.
ORG 2021 appears to be interesting, and I will investigate further, but it does not appear to be what I am searching for.
GSi VB3m sounds for Hammond B3
If I missed one, I’d appreciate being led to it.

1 Like