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
-15
View File
@@ -1,5 +1,4 @@
#include "midi_transport.h"
#include "midi_clock.h"
#include <Arduino.h>
#include "Adafruit_TinyUSB.h"
@@ -52,20 +51,6 @@ void UsbMidiTransport::update() {
while (usb_midi.available()) {
uint8_t packet[4];
if (usb_midi.readPacket(packet)) {
uint8_t cin = packet[0] & 0x0F;
if (cin == 0x0F) {
uint8_t rt = packet[1];
if (rt == 0xF8) {
MidiClock::tick();
} else if (rt == 0xFA || rt == 0xFB) {
MidiClock::start();
} else if (rt == 0xFC) {
MidiClock::stop();
}
continue;
}
MidiEvent event;
parse_midi_packet(packet, 4, event);