dvhdr / launchpad-pro

Open source firmware for the Launchpad Pro grid controller
BSD 3-Clause "New" or "Revised" License
446 stars 101 forks source link

Unclear how to send a program change message #61

Closed fuzzballb closed 1 year ago

fuzzballb commented 1 year ago

To make a clip launcher (for the MC-707), i need to know how to send a program change, unfortunately I can't find example code on how to do this.

Is there a comprehensive guide that covers the basics?

Thanks in advance

mat1jaczyyy commented 1 year ago

hal_send_midi should work use the standard byte id for program change from midi specification (i think its 0xCz where z is the channel you want, but it's off the top of my head i might be wrong)

fuzzballb commented 1 year ago

Tried these and looking at the MIDI monitor, it seems to work correctly.

// MIDI CHANNEL 3 PROGAM 67 hal_send_midi(USBMIDI, 0xC2, 0xC3, 0);

For the DIN midi out i will need to use DINMIDI

Seeing how the MIDI channel is part of the STATUS (0xC2), I can see why it isn't part of the status constants.