From acd3cc51fe737f95c381919f3da14275270252b3 Mon Sep 17 00:00:00 2001 From: Ashley Strahle Date: Fri, 3 Jul 2026 07:43:26 +0000 Subject: [PATCH] =?UTF-8?q?Beat=201=20(every=204th)=20=3D=20full=20white?= =?UTF-8?q?=2050ms=20snap,=20others=20=3D=20barely=20visible=206,6,6=20?= =?UTF-8?q?=E2=80=94=20sharp=20contrast=20for=20phase=20detection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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;