Can't send MIDI data to controlller using USB Host Shield

Hello,

Today I’ve stumbled with a fact, that I can’t send MIDI data to Navation Launchkey controller.

I’m trying to turn on pad backlight in accordance with the controller programmer manual:

To light the bottom left drum-pad the following message would be sent
Example LED on message: MIDI Channel 16, C1, Colour/Velocity (1-127)
9Fh, 24h, Colour/Velocity (01h - 7Fh)
(159, 36, Colour/Velocity (1- 127))

So I’m just checking all possible velocities for a single pad, but no luck:

void loop()
{
uint8_t msg[3] = {159, 36, 0};
Usb.Task();
uint32_t t1 = (uint32_t)micros();
if ( Usb.getUsbTaskState() == USB_STATE_RUNNING )
{
for (int i=0; i<128; i++)
{
Serial.println(i);
msg[2] = i;
Midi.SendData(msg, 3);
delay(100);
}
}
}

Identical code on python, when the controller is connected to PC, changes backlight successfully.

I’ve seen some projects with Novation Launchpad, with a similar code, but still I can’t get what am I doing wrong.

I would really appreciate your help.

9Fh, 24h, Colour/Velocity (01h - 7Fh)

9Fh that is note-on for channel 16 isn’t it ? are you sure that is what it says in the manual ? (since a cc would make more sense AFh (or 0xAF as within code) ) if so you should useMIDI.send(midi::NoteOn,msg[1],msg[2],16);
and

#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();

9Fh that is note-on for channel 16 isn’t it ? are you sure that is what it says in the manual ?

Yeah, exactly, and as I’ve previously mentioned, identical code works on python.

#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();

I guess it was not clear from my initial post, but I don’t send MIDI data to controller direcly via serial. So, it has nothing to do with MIDI.h.

I have USB controller and I’m using USB Host Shield with this library:

I’ve managed to read incoming data from the controller using RecvData, but SendData does nothing.

I hope, I’ve made it clear, thaks for reply.

The USBH_MIDI library is obsolete because it is now included in the USB Host Shield library.

If you are using the latest version but still having problems, go to the USB Host Shield library repo on github.com and search the issues (not just the open issues) for novation. If the problem is still not resolved, create a new issue. Some times the fix is just to add a new USB product ID.