Anavi Macropad8 for MIDI control

Every now and again, ya need a simple, small device to send MIDI commands. The V3 Sound Yammex XXL sound module is one such use case. It requires full Bank Select plus Program Change message sequences to select a voice. You’d be surprised at how many MIDI controllers are incapable of sending a full three message selection sequence! [This is one of my pet peeves about some MIDI controllers,]

So-called “macro keypads” are one possible solution. Typically, macro keypads are used by gamers to send repeated, complicated key sequences. [Hadoken!] The trick is getting the macro keypad to send MIDI instead of ASCII or whatever.

I did a search last year and found the Anavi Macropad8. The Macropad8 has eight keys, a micro USB connector and an optional OLED display. I planned to plug it into the USB host port on the Yammex module and send voice selection messages to it over USB — while the Yammex 5-pin MIDI IN port handles notes from a brain-damaged MIDI keyboard controller.

Anavi’s fulfillment via Tindy.com was really fast. Then, I let the Macropad8 languish for almost a full year. Until now.

First off, I like the Anavi Macropad8 hardware. I bought the Developer Kit which requires some minor assembly. It’s no more complicated than assembling a KORG NTS-1 or NTS-2. Unlike the KORGs, the Macropad8 does not fully enclose the electronics. Still, the final assembly is decently robust. The OLED is probably the most vulnerable component as it sits on top of the plexi top cover. I’m good with this for home use.

After assembly, I wrangled with the QMK (Quantum Mechanical Keyboard) development environment. I figured a few bytes here and there, and the Macropad8 should be good to go. Ha! Two gigabytes of development environment later, I was ready to run the QMK compiler and flash software. Yikes, that is bloated. QMK downloads with the default keymap definitions, etc. for every QMK-compatible macro keypad known to man, woman and dog.

Plus, QMK is, at best, user-hostile for QMK n00bs. Even figuring out where source code goes is an adventure game. Then, the default Macropad8 keymap is too large to flash. QMK doesn’t offer any real hints about reducing code size and one is quickly in the deep water. I turned off tap dancing, N-key rollover and backlighting in order to get the code size down.

Fortunately, there is the shell of an “advanced” MIDI keymap.c file in the documentation from which I did extensive copy and modify. You’ll need to dive into the MIDI library source code to suss out the MIDI API. The API is complete, but it is undocumented.

At long last I had a QMK app ready to go. The concept of operation is pretty simple — respond to key codes and send Bank Select MSB, Bank Select LSB and Program Change for each key press. User code runs in the middle of an infinite loop provided by the QMK infrastructure. QMK calls process_record_user() when a key code is ready for processing. If the OLED is enabled, QMK calls oled_task_user(), so your code can update (redraw) the display.

I did a quick check out with MIDI-OX to make sure the MIDI messages were being sent correctly. The Macropad8 exposes two USB ports — one to send characters to the keyboard stream and one to send MIDI. Fortunately, both Windows (MIDI-OK) and the Yammex immediately recognized the MIDI port.

Hooked up to Yammex, the Macropad8 worked as expected. I couldn’t get the arrangement to glitch even once while practicing. Overall, I would call Anavi Macropad8 a success and I recommend it.

The Macropad8 can run Arduino sketches, too. My back-up plan, in case QMK failed, was to program the Macropad8 as an Arduino (Leonardo). As an Arduino, the Macropad8 makes a neat application-specific system. I wish there was direct hardware access to the Arduino pins, but that would push Macropad8 into a different product direction entirely. Would make an interesting hack, anyway…

I noticed that newer Anavi products have moved to the Raspberry Pi RP2040 Pico. So, exercise care when ordering if you want a Microchip ATmega32U4 microcontroller.

Copyright © 2024 Paul J. Drongowski