Building Your Own Midi Fighter
Tags: music, hardware, midi, arduino
Published: 2020-08-22 21:30:17

***(Note: these posts are migrated from my previous [medium.com](https://medium.com/@monkeytypewritr) blog)***

## What’s a Midi Fighter?

A Midi Fighter is a music controller equipped with high quality arcade buttons for a great tactile feel, low latency action, and durability. Every button is also backlit with RGB LEDs, illuminating the translucent buttons with customizable colors and animations.

## What can you do with a Midi Fighter?

Me? Not much. But check out what other skilled people can do:

{% youtube ieSzJh4yKmA %}

## Design Process

After spending a few hours on YouTube watching amazing performances by these talented individuals (check out Shawn Wasabi’s [YouTube channel](https://www.youtube.com/channel/UCXLrdG_ZVt4US1iV40ytiQQ)), I decided I wanted to build my own! There were plenty of DIY projects out there on building a MIDI controller with an Arduino, but most of them lacked LEDs, or were in a larger form factor.

Designing the enclosure was the first step. I came across a lot of designs that used MDF or Acrylic boards as the mounting plate. I didn’t want any flex when pushing the buttons, and also a premium feel to the end product, so I opted for anodized aluminum plates to form the enclosure.

![I did some quick design work with Fusion 360 and exported the layout to a DXF file for CNC cutting.](https://cdn-images-1.medium.com/max/2000/1*SpAZpikbBsIThdY6u4TJ4g.jpeg)

The PCB would be sandwiched between the top and bottom plates, and held together with M3 machine screws; on the 4 corners, aluminum standoffs would provide support and clearance for the arcade buttons, and components on the PCB.

For the arcade buttons, I chose the Sanwa OBSC 24mm translucent buttons; these are high quality Japanese arcade buttons rated for 15 million presses! They require very little actuation force, and are spring loaded to provide quick feedback. It was also important to choose translucent buttons to let the RGB LEDs shine through :)

![These buttons were pricey but they’re so worth it :)](https://cdn-images-1.medium.com/max/2000/1*Br4X7qQjQFWKMaTi8eFFTw.png)

For the PCB, I designed everything using KiCad. The layout wasn’t too complicated as the board was fairly big (~15cmx15cm), so I had plenty of room to route the components. I did spend some extra time on the PCB art and also making sure all the dimensions were correct. The microcontroller is an ATmega32u4, with each of the 16 buttons connected to a GPIO pin. I chose this MCU because it’s the same one as the Arduino Leonardo, and I could take advantage of the many already available libraries.

![No PCB design is complete without some artwork :)](https://cdn-images-1.medium.com/max/2000/1*FeLCi4CPY3EkUiHfE-Lv3g.png)

![The cluster of mess on the right are the LEDs coupled with bypass capacitors :p](https://cdn-images-1.medium.com/max/2246/1*brkGpPpBG9yTgy_y_52gVg.jpeg)

You may have noticed that there are **32 RGB LEDs** on this board! To provide even lighting without using light pipes, I decided to place two of these LEDs at a diagonal underneath each button. Now because of the layout, the normal sized 5050 Neopixels were too large to fit, so I went with the SK6812 minis which are only 35mm x 35mm.

![These are so cute!](https://cdn-images-1.medium.com/max/2000/1*6VoRO_RnNLtQycfFfv1cSQ.png)

## Assembly

All the designs were submitted for fabrication and after about 10 days, I received all of the parts:

![Electronics and PCB (Note the coil of SK6812 minis, I bought 200 of them)](https://cdn-images-1.medium.com/max/10666/1*0liCk4yZlEiCNO9U88BoLQ.jpeg)

![Close up on the PCB art. I chose ENIG finish to really let the artwork shine (literally)](https://cdn-images-1.medium.com/max/10666/1*QLPNqu_ucQH3YK71uDOz0g.jpeg)

The first thing I wanted to test was to make sure the PCB, the buttons, and the mounting plate were all aligned properly:

![Yay it fits!](https://cdn-images-1.medium.com/max/10666/1*zEPpUTbiwsLV-mIK7c_MQg.jpeg)

![Top view. I used countersunk aluminum washers with the M3 machine screws.](https://cdn-images-1.medium.com/max/10666/1*RBSpPgrMzFzqojmc9D9i4g.jpeg)

The buttons were really snug with the mounting holes. In retrospect, I should’ve designed it with a little more wiggle room and not precisely 24mm, as it is now close to impossible to remove the buttons.

All of the components were then soldered onto the PCB; I didn’t actually have to solder the arcade buttons because the mounting holes had enough friction to keep the pins in contact. Everything was then sandwiched together to form the final device:

![Shiny, shiny buttons!](https://cdn-images-1.medium.com/max/10666/1*vBTyB6lf-eHK53Bjgq-uPg.jpeg)

![Corner](https://cdn-images-1.medium.com/max/10666/1*xvwlr38iwz2Chvff3HS0IA.jpeg)

![Lights On! Better view of the sandwich construction](https://cdn-images-1.medium.com/max/10666/1*4ZagBKo5U9Cds4HWh3TlPQ.jpeg)

![Color: RGB(30,10,10) An improvement would be to add a cylindrical housing for each button to avoid light leaking](https://cdn-images-1.medium.com/max/10666/1*jJ8Xr0jTHXZC3RPQP8B4LQ.jpeg)

![Lowered the brightness for my camera, these LEDs are bright!](https://cdn-images-1.medium.com/max/10666/1*r9_J7b7yaBP2jw_WyWH06A.jpeg)

![Completed build (Top Right) and all the parts to build one. I bought enough parts to build 5 :)](https://cdn-images-1.medium.com/max/10666/1*FA2OjUDONjthuMkbail71A.jpeg)

## Code

The first order of business was to flash the device with the Arduino bootloader, this would allow us to upload our firmware via USB with the Arduino IDE. This can be done using another Arduino as an ISP (in-system programmer). Once this is complete, your device should be recognized by the IDE as an Arduino Leonardo. I’ve included an ISP header on the top right corner of the PCB.

![Follow this guide [https://www.arduino.cc/en/Tutorial/ArduinoISP](https://www.arduino.cc/en/Tutorial/ArduinoISP)](https://cdn-images-1.medium.com/max/2000/1*deV4rZJLcd1qywvct3nWlw.png)

For the firmware, I used Adafruit’s [NeoPixel library](https://github.com/adafruit/Adafruit_NeoPixel) and the [MIDIUSB library](https://www.arduino.cc/en/Reference/MIDIUSB). All of the buttons were mapped to a different note, and the LED underneath would change from pink to white when pressed:

{% gist https://gist.github.com/w4ilun/248bb9d376315d838591a85303b8789e %}

Firmware source code and hardware design files are all open source and available on GitHub: [https://github.com/w4ilun/midifighter](https://github.com/w4ilun/midifighter)

## Showtime!

{% vimeo 233169523 %}

I made the above track with GarageBand, it immediately recognized my Midi Fighter when plugged in; other music creation software e.g. Ableton Live, Traktor, etc. should also be supported.

![](https://cdn-images-1.medium.com/max/2212/1*O80c1jwiS340dcNAZsgMag.png)

## Next Steps

It would be great to have some GUI software that would allow you to easily design LED animations/patterns, as well as configure the button mappings to play different notes. Right now, everything is hardcoded, so any changes would require directly modifying the sketch. This would be a great opportunity to use WebUSB and do everything over a browser :)

GLHF!