Files
loopy_midi_controller/include/midi_clock.h
T
ash 5dc10eea87 Add MIDI clock-driven LED pulsing
- New MidiClock module: tracks 24 PPQN clock ticks, computes beat phase
  and smooth sine pulse from incoming MIDI Clock (0xF8)
- midi_transport: detect CIN=0xF real-time packets, route 0xF8 to
  MidiClock::tick(), 0xFA/FB to start(), 0xFC to stop()
- led_stub update(): every 20ms, modulates active LED brightness
  using pulse curve (50%-100%), pixel 6 always throbs when clock
  is running even if no loops active
- Aligned set_led_state() all paths to use pad_base_colors
- Removed dead activity flash code
2026-07-02 07:15:53 +00:00

20 lines
409 B
C++

#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;
};