Add visual MIDI type indicators
- SysEx: ALL LEDs flash white 200ms - Note: LED 0 flashes red 100ms - CC: LED 1 flashes green 100ms - Helps diagnose what MIDI arrives without serial
This commit is contained in:
+8
-4
@@ -46,16 +46,20 @@ void AppTask::process_midi_event(const MidiEvent& event) {
|
||||
Serial.printf("[APP] MIDI IN: Type=%d Ch=%d Data1=%d Data2=%d\n",
|
||||
event.type, event.channel, event.data1, event.data2);
|
||||
|
||||
// Flash LED 0 white briefly on ANY MIDI input - visual activity indicator
|
||||
// (visible without serial when connected to iPad)
|
||||
led_driver->flash_activity();
|
||||
// Visual MIDI type indicator (works without serial on iPad)
|
||||
if (event.type == MidiEvent::SYSEX) {
|
||||
led_driver->flash_all(255, 255, 255, 200); // SysEx = ALL white
|
||||
} else if (event.type == MidiEvent::NOTE_ON || event.type == MidiEvent::NOTE_OFF) {
|
||||
led_driver->flash_one(0, 255, 0, 0, 100); // Note = LED 0 red
|
||||
} else if (event.type == MidiEvent::CONTROL_CHANGE) {
|
||||
led_driver->flash_one(1, 0, 255, 0, 100); // CC = LED 1 green
|
||||
}
|
||||
|
||||
if (event.type == MidiEvent::SYSEX) {
|
||||
// Cin is encoded in channel for SYSEX packets
|
||||
uint8_t cin = event.channel;
|
||||
uint8_t packet[3] = {event.data1, event.data2, 0};
|
||||
process_sysex_packet(packet, cin);
|
||||
led_driver->flash_sysex();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user