From b8595271695870d9cc32390d9291b70b8ee2aedb Mon Sep 17 00:00:00 2001 From: Ashley Strahle Date: Fri, 3 Jul 2026 07:50:16 +0000 Subject: [PATCH] Beat 1 = RED (100ms), other beats = WHITE (50ms) --- src/main.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f9daaed..48d8a1c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -42,34 +42,22 @@ void midi_task(void* parameter) { if (current_beat != last_beat) { last_beat = current_beat; flash_start = now; - // Beat 1 (every 4th) = yellow, others = white + // Beat 1 (every 4th) = RED, others = WHITE if (current_beat % 4 == 0) { - mux.set_led_color(6, 255, 255, 0); + mux.set_led_color(6, 255, 0, 0); } else { mux.set_led_color(6, 255, 255, 255); } 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 + // Beat 1 holds red for 100ms, others snap to dim after 50ms if (flash_start > 0) { - uint32_t elapsed = now - flash_start; - if (elapsed >= 80) { + uint32_t hold = (last_beat % 4 == 0) ? 100 : 50; + if (now - flash_start >= hold) { mux.set_led_color(6, 20, 20, 20); mux.show(); flash_start = 0; - } else { - float b = 1.0f - (float)elapsed / 80.0f; - uint8_t v = (uint8_t)(255 * b * b); - mux.set_led_color(6, v, v, v); - mux.show(); } }