diff --git a/src/main.cpp b/src/main.cpp index ef86a48..3866bd6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,17 +37,27 @@ void midi_task(void* parameter) { uint32_t tick = midi_tick_count; uint32_t now = millis(); - // Calculate beat using MIDI tick count (24 ticks per beat/PPQN) uint32_t current_beat = tick / 24; - // Check if we've crossed a beat boundary. if (current_beat != last_beat) { last_beat = current_beat; flash_start = now; - mux.set_led_color(6, 255, 255, 255); + // Beat 1 every 4th beat = full white, others near-invisible + if (current_beat % 4 == 0) { + mux.set_led_color(6, 255, 255, 255); + } else { + mux.set_led_color(6, 6, 6, 6); + } mux.show(); } + // After 50ms, snap to dim regardless of beat type + if (flash_start > 0 && now - flash_start >= 50) { + mux.set_led_color(6, 20, 20, 20); + mux.show(); + flash_start = 0; + } + // Handle flash animation if (flash_start > 0) { uint32_t elapsed = now - flash_start;