Reply to MIDI Clock LED without any soldering
MIDI Clock LED without any soldering Hey everyone! I finally got around to hacking on the Midi Fighter firmware. My first idea is to be able to get the MIDI Clock LED without soldering a new LED onto my Midi Fighter. The fourbanks_off mode, I'm using the top-left LED. In fourbanks_internal mode, I'm using the selected bank LED. In fourbanks_external mode, I'm not using anything. I'll probably publish my code to github or something similar in the near future, but in the mean time, here is a diff: WARNING: I take no responsibility for any damage my code does to your midi fighter, etc, etc Code:
diff --git a/constants.h b/constants.h index d03d541..30b3acd 100644 --- a/constants.h +++ b/constants.h @@ -68,4 +68,7 @@ // Note number of the basenote for the keys #define MIDI_BASE_NOTE 36 +// midi note led to use for groundfx in fourbanks_off mode +#define GROUNDFX_LED 48 + #endif // _CONSTANTS_H_INCLUDED diff --git a/midifighter.c b/midifighter.c index 51b0008..dff20d0 100644 --- a/midifighter.c +++ b/midifighter.c @@ -684,7 +684,15 @@ void Midifighter_Task(void) // MIDI keystate array and set an LED bit if that MIDI note has a // velocity greater than zero. for (uint8_t i=MIDI_BASE_NOTE; i<MIDI_BASE_NOTE + 16; ++i) { - if (g_midi_note_state[i] > 0) { + if (i == GROUNDFX_LED) { + if (g_led_groundfx_counter < 8) { + leds |= 1 << midi_note_to_key(i); + } else if (g_led_groundfx_counter < 24) { + leds |= 0 << midi_note_to_key(i); + } else { + leds |= 1 << midi_note_to_key(i); + } + } else if (g_midi_note_state[i] > 0) { leds |= 1 << midi_note_to_key(i); } } @@ -701,7 +709,15 @@ void Midifighter_Task(void) // ------------------ // The top four keys display which bank is selected. At least one // bank is always selected. - leds = (1 << g_key_bank_selected); + + // Use the selected deck to show groundfx + if (g_led_groundfx_counter < 8) { + leds = (1 << g_key_bank_selected); + } else if (g_led_groundfx_counter < 24) { + leds = (0 << g_key_bank_selected); + } else { + leds = (1 << g_key_bank_selected); + } // Update the bottom 12 LEDs with the MIDI state of the selected // bank. | |
You need to login in order to write on our forum |
<< Cancel