From 3389cc940310b5ca181e292f654dd3f2d372f6be Mon Sep 17 00:00:00 2001 From: Ashley Strahle Date: Tue, 30 Jun 2026 04:38:28 +0000 Subject: [PATCH] Send CC instead of NOTE_ON for Loopy Pro generic mirror. Clean up flash_activity. --- src/app_task.cpp | 16 ++++++++-------- src/led_stub.cpp | 23 ++--------------------- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/src/app_task.cpp b/src/app_task.cpp index 508cc39..8a521ae 100644 --- a/src/app_task.cpp +++ b/src/app_task.cpp @@ -126,18 +126,18 @@ void AppTask::process_switch_event(uint8_t switch_id, bool pressed) { for (uint8_t i = 0; i < NUM_PADS; i++) { if (pad_mapping[i].physical_switch == switch_id) { uint8_t channel = pad_mapping[i].midi_channel; - // Loopy Pro Launchpad mode expects NOTE_ON/NOTE_OFF on notes 36-45 - uint8_t note = pad_mapping[i].midi_note; - uint8_t velocity = pressed ? 127 : 0; + // Loopy Pro Generic mode mirrors CC back on the same CC it received + // CC2-11 maps to pads 0-9 + uint8_t cc_num = 2 + i; + uint8_t value = pressed ? 127 : 0; if (pressed) { - midi_transport->send_note_on(channel, note, velocity); - } else { - midi_transport->send_note_off(channel, note, velocity); + midi_transport->send_cc(channel, cc_num, value); } + // Don't send CC 0 on release — Loopy Pro uses velocity 0 to turn off - Serial.printf("[APP] Switch %d -> Ch%d Note%d Vel%d (%s)\n", - switch_id, channel, note, velocity, + Serial.printf("[APP] Switch %d -> Ch%d CC%d Val%d (%s)\n", + switch_id, channel, cc_num, value, pressed ? "PRESS" : "RELEASE"); break; } diff --git a/src/led_stub.cpp b/src/led_stub.cpp index 78ee743..b6c25ff 100644 --- a/src/led_stub.cpp +++ b/src/led_stub.cpp @@ -278,27 +278,8 @@ void DefaultLedStub::set_led_brightness(uint8_t brightness) { } void DefaultLedStub::flash_activity() { - if (!initialized || !mux_ptr) return; - - uint32_t now = millis(); - - // Save current LED 0 color if we just started flashing - if (now >= activity_off_time) { - saved_r = 0; - saved_g = 0; - saved_b = 0; - if (led_states[0].active) { - uint32_t color = launchpad_palette[led_states[0].velocity]; - saved_r = (color >> 16) & 0xFF; - saved_g = (color >> 8) & 0xFF; - saved_b = color & 0xFF; - } - } - - // Flash LED 0 white - mux_ptr->set_led_color(0, 255, 255, 255); - mux_ptr->show(); - activity_off_time = now + 50; + // No-op: activity flash on all MIDI input was confusing. + // LED feedback is handled directly by set_led_state(). } void DefaultLedStub::update() {