Replace MIDI clock with internal BPM timer for pixel 6 pulse

Revert:
- Remove midi_clock.h/cpp (was causing cross-core crash)
- Remove real-time MIDI message parsing from midi_transport.cpp

New approach:
- Pixel 6 (and all active LEDs) pulse to internal BPM timer
- Default 120 BPM (500ms beat interval)
- 'bpm <n>' serial command to change tempo (20-300)
- Only calls FastLED.show() when actively pulsing (avoids USB/WS2812 interference)
- 33ms update rate (30fps)
- Inactive LEDs left untouched (no unnecessary show() calls)
This commit is contained in:
ash
2026-07-02 07:27:26 +00:00
parent 5dc10eea87
commit af14c2f759
6 changed files with 31 additions and 97 deletions
+2
View File
@@ -33,6 +33,7 @@ private:
static const uint8_t NUM_LEDS = 10;
LedState led_states[NUM_LEDS];
bool initialized;
uint32_t beat_interval_ms = 500;
public:
DefaultLedStub();
@@ -44,4 +45,5 @@ public:
void update() override;
void set_mux(PixelStompMux* mux);
void set_bpm(uint16_t bpm);
};
-19
View File
@@ -1,19 +0,0 @@
#pragma once
#include <cstdint>
class MidiClock {
public:
static void tick();
static void start();
static void stop();
static float get_phase();
static float get_pulse();
static bool is_running();
private:
static uint32_t last_tick_time;
static uint32_t tick_count;
static float tick_interval_ms;
static bool running;
static const uint8_t TICKS_PER_BEAT = 24;
};