Send CC2-11 for button presses (match Loopy Pro)
This commit is contained in:
+6
-9
@@ -111,17 +111,14 @@ void AppTask::process_switch_event(uint8_t switch_id, bool pressed) {
|
|||||||
for (uint8_t i = 0; i < NUM_PADS; i++) {
|
for (uint8_t i = 0; i < NUM_PADS; i++) {
|
||||||
if (pad_mapping[i].physical_switch == switch_id) {
|
if (pad_mapping[i].physical_switch == switch_id) {
|
||||||
uint8_t channel = pad_mapping[i].midi_channel;
|
uint8_t channel = pad_mapping[i].midi_channel;
|
||||||
uint8_t note = pad_mapping[i].midi_note;
|
// Loopy Pro expects CC2 for pixel0, CC3 for pixel1, etc.
|
||||||
uint8_t velocity = pressed ? 127 : 0;
|
uint8_t cc_num = 2 + switch_id;
|
||||||
|
uint8_t cc_val = pressed ? 127 : 0;
|
||||||
|
|
||||||
if (pressed) {
|
midi_transport->send_cc(channel, cc_num, cc_val);
|
||||||
midi_transport->send_note_on(channel, note, velocity);
|
|
||||||
} else {
|
|
||||||
midi_transport->send_note_off(channel, note, velocity);
|
|
||||||
}
|
|
||||||
|
|
||||||
Serial.printf("[APP] Switch %d -> Ch%d Note%d Vel%d (%s)\n",
|
Serial.printf("[APP] Switch %d -> Ch%d CC%d Val%d (%s)\n",
|
||||||
switch_id, channel, note, velocity,
|
switch_id, channel, cc_num, cc_val,
|
||||||
pressed ? "PRESS" : "RELEASE");
|
pressed ? "PRESS" : "RELEASE");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user