Add SPP (Song Position Pointer) detection - uses SPP on START to set correct tick position. Add beats_per_bar (default 4) with button combo: hold 10 + press 1=4/4, 2=3/4, 3=6/4
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "app_task.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
extern volatile uint8_t beats_per_bar;
|
||||
|
||||
AppTask::AppTask(LedStub* led, SwitchStub* sw, UsbMidiTransport* midi)
|
||||
: led_driver(led), switch_driver(sw), midi_transport(midi) {
|
||||
|
||||
@@ -124,6 +126,18 @@ void AppTask::process_midi_event(const MidiEvent& event) {
|
||||
}
|
||||
|
||||
void AppTask::process_switch_event(uint8_t switch_id, bool pressed) {
|
||||
// Time signature combo: hold pad 10 (switch 9) + press pad 1/2/3
|
||||
if (switch_id <= 2 && switch_driver->is_pressed(9)) {
|
||||
if (pressed) {
|
||||
switch (switch_id) {
|
||||
case 0: beats_per_bar = 4; Serial.println("[APP] Time sig: 4/4"); break;
|
||||
case 1: beats_per_bar = 3; Serial.println("[APP] Time sig: 3/4"); break;
|
||||
case 2: beats_per_bar = 6; Serial.println("[APP] Time sig: 6/4"); break;
|
||||
}
|
||||
}
|
||||
return; // suppress CC in combo mode
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < NUM_PADS; i++) {
|
||||
if (pad_mapping[i].physical_switch == switch_id) {
|
||||
uint8_t channel = pad_mapping[i].midi_channel;
|
||||
|
||||
Reference in New Issue
Block a user