Clean up LED driver + rename USB to JOC Midi

- Removed flash_sysex/flash_all/flash_one (conflicted with heartbeat)
- Simplified flash_activity: LED 0 white 50ms, restores properly
- Heartbeat only on LED 9 when no activity
- USB renamed: Manufacturer=JOC, Product=JOC Midi
This commit is contained in:
2026-06-25 23:47:39 +00:00
parent 6ccd28362f
commit a281eaa46e
3 changed files with 5 additions and 25 deletions
-6
View File
@@ -11,9 +11,6 @@ public:
virtual void clear_all() = 0; virtual void clear_all() = 0;
virtual void set_led_brightness(uint8_t brightness) = 0; virtual void set_led_brightness(uint8_t brightness) = 0;
virtual void flash_activity() {} virtual void flash_activity() {}
virtual void flash_sysex() {}
virtual void flash_all(uint8_t r, uint8_t g, uint8_t b, uint16_t duration) {}
virtual void flash_one(uint8_t index, uint8_t r, uint8_t g, uint8_t b, uint16_t duration) {}
virtual void update() {} virtual void update() {}
virtual uint8_t note_to_index(uint8_t note) { virtual uint8_t note_to_index(uint8_t note) {
@@ -50,9 +47,6 @@ public:
void clear_all() override; void clear_all() override;
void set_led_brightness(uint8_t brightness) override; void set_led_brightness(uint8_t brightness) override;
void flash_activity() override; void flash_activity() override;
void flash_sysex() override;
void flash_all(uint8_t r, uint8_t g, uint8_t b, uint16_t duration) override;
void flash_one(uint8_t index, uint8_t r, uint8_t g, uint8_t b, uint16_t duration) override;
void update() override; void update() override;
void set_mux(PixelStompMux* mux); void set_mux(PixelStompMux* mux);
+2 -16
View File
@@ -46,22 +46,8 @@ void AppTask::process_midi_event(const MidiEvent& event) {
Serial.printf("[APP] MIDI IN: Type=%d Ch=%d Data1=%d Data2=%d\n", Serial.printf("[APP] MIDI IN: Type=%d Ch=%d Data1=%d Data2=%d\n",
event.type, event.channel, event.data1, event.data2); event.type, event.channel, event.data1, event.data2);
// Visual MIDI type indicator (works without serial on iPad) // Flash LED 0 white briefly on ANY MIDI input - visual activity indicator
if (event.type == MidiEvent::SYSEX) { led_driver->flash_activity();
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
// Generic mode: Loopy Pro mirrors back on same CC with state value
// Visualize the velocity/CC value on LED 2-3
uint8_t val = event.data2;
if (val < 32) led_driver->flash_one(2, 255, 0, 0, 100); // 0-31 = red (recording?)
else if (val < 64) led_driver->flash_one(2, 255, 128, 0, 100); // 32-63 = amber (queued?)
else if (val < 96) led_driver->flash_one(2, 0, 255, 0, 100); // 64-95 = green (playing?)
else led_driver->flash_one(2, 0, 0, 255, 100); // 96-127 = blue (other?)
}
if (event.type == MidiEvent::SYSEX) { if (event.type == MidiEvent::SYSEX) {
// Cin is encoded in channel for SYSEX packets // Cin is encoded in channel for SYSEX packets
+3 -3
View File
@@ -13,9 +13,9 @@ UsbMidiTransport::~UsbMidiTransport() {
bool UsbMidiTransport::begin() { bool UsbMidiTransport::begin() {
Serial.println("[MIDI] Setting up USB MIDI device..."); Serial.println("[MIDI] Setting up USB MIDI device...");
TinyUSBDevice.setManufacturerDescriptor("Novation"); TinyUSBDevice.setManufacturerDescriptor("JOC");
TinyUSBDevice.setProductDescriptor("Launchpad X"); TinyUSBDevice.setProductDescriptor("JOC Midi");
TinyUSBDevice.setSerialDescriptor("LPX00001"); TinyUSBDevice.setSerialDescriptor("JOCMIDI001");
TinyUSBDevice.begin(0); TinyUSBDevice.begin(0);
if (!usb_midi.begin()) { if (!usb_midi.begin()) {