MIDI Clock LED without any soldering
MIDI Clock LED without any soldering Posted on: 10.03.2011 by Tynisha Teeman 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. | |
Tynisha Teeman 15.03.2011 | Make sure you are sending MIDI clock data. In Traktor Preferences, make sure "Send MIDI Clock Data" is checked. Also, in the Master Clock Panel, be sure the Play button under "Send" is selected.
Originally Posted by erpi
|
Leonardo Papajohn 11.03.2011 |
Originally Posted by notshy
Would you be able to share a video showing it in action, I would like to see how it looks first before I go through the trouble of doing it on my own. It would be very much so appreciated! |
Tynisha Teeman 10.03.2011 | 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. |
Lorelei Przybylowicz 15.03.2011 | @OverZero - do you want to add this link to your top post so that people can find the original video on it ? DJ Tech Tools Blog Post - LED Mod |
Kori Shatz 15.03.2011 | Thank you so much Overzero - I was sure I was missing something obvious! It works perfectly. |
Tynisha Teeman 15.03.2011 | Make sure you are sending MIDI clock data. In Traktor Preferences, make sure "Send MIDI Clock Data" is checked. Also, in the Master Clock Panel, be sure the Play button under "Send" is selected.
Originally Posted by erpi
|
Kori Shatz 15.03.2011 | Thanks Overzero - that is a great idea!!! I tried on Mac OS to load the hex, MF successfully flashed but no blinking led... I am certainly doing something wrong. Thanks again! |
Evangeline Abraha 12.03.2011 | Flashed it today with Atmel flip on my pc & it works beautifully ! : ) |
Leonardo Papajohn 11.03.2011 |
Originally Posted by notshy
Would you be able to share a video showing it in action, I would like to see how it looks first before I go through the trouble of doing it on my own. It would be very much so appreciated! |
Lorelei Przybylowicz 11.03.2011 | Flashed it with Overzero's firmware and I love the flashing LED. I love it so much I believe I'm off to buy a soldering kit and mod my MF !!!! Thanks for this !!!! |
Tynisha Teeman 11.03.2011 | WARNING: Neither DJ Tech Tools nor myself guarantee any support whatsoever for this code or firmware. Use at your own risk! I'm happy to help along the way, but I cannot take any responsibility for any problems this code or firmware may cause. This code is still in development, so there may be bugs. I encourage you to let me know about any problems, or better yet, fix them and contribute your changes back into the project! Now that we have the scary stuff out of the way, there are two ways to get my modified midi firmware image: the easy way (download the binary), and the fun way (download the source code and build the binary). Let's start with the fun way! The fun way - Building the binary from source Follow the instructions to set up your build environment for you OS; however, instead of downloading the source from http://sourceforge.net/projects/midifighter/, download the source from https://github.com/kevinreedy/midifi...midi-clock-led, which contains the changes. Here are the build environment setup instructions: The above build environment instructions also tell you how to flash your midifighter with your newly built firmware! The easy way - Downloading the binary For those of you who just want the binary without all of the fun of compiling from source, you can download it at http://djoverzero.com/midifighter/. The Mac OS X MF Updater application allows you to select a specific firmware image (instead of downloading the latest one) by going to 'File' and then 'Load HEX...' I image the Windows version of the MF Updater also has this functionality, but I don't have a Windows box to test on. |
Lorelei Przybylowicz 11.03.2011 | I'd like the compiled binary for this please ?! Any chance you could post it or PM it? |
robert chanda 10.03.2011 | Using the bank select LED to also indicate MIDI clock? Great idea! How to use that code? There's a command-line utility called "patch" that takes a working set of source files and applies the differences inside the patch file (that thing above) to the source: |
Candie Kletter 10.03.2011 | GREAAAAAT!!!! How can I put the code into my MF? |
Evangeline Abraha 10.03.2011 | That looks very interesting. I must admit I have no experience as how to put that code into use on my machine. could you post an idiots guide if possible ? Cheers, M |
<< Back to MIDIfighter Resources and DiscussionReply