The Keyboard Box
BACKGROUND
When I first started playing the B-3 organ on my computer, I wanted a quick way to change the vibrato speed with a switch, like the real one. but my digital keyboard didn't have those features. then I added a secondary small 25 key digital midi keyboard to the setup and I noticed that the modulation wheel can control it, do I had an idea.
THE FIRST PROTOTYPE
A small box, that had 2 switches and a potentiometer. and it will basically emulate a modulation wheel.
it had 2 modes: a digital mode, that uses the switch to control it, on or off, like the real organ.
and an analog mode, where the potentiometer controls the modulation, so it acts more like a regular modulation wheel on a midi keyboard, the second switch changes the modes.
(picture of original keyboardbox)
It was a quick project, I used what I had, and it worked perfectly fine.
ISSUES
But it being a quick project, means it has some major flaws and annoyances.
1. The Case - the case has a small friction clip that is supposed to just hang on the side, like this:(show picture)
you can probably guess, if you looked at it wrong, or bumped the cable, it fell.
2. The Microcontroller - I used the smallest microcontroller I had lying around - an Arduino nano.
it does the job, it's small, it supports digital and analog data, and most important, it was in my drawer, waiting for use.
but it has a problem, it doesn't support native usb otg or midi, only serial data.
so I needed a program to convert the serial data to midi data(hairless midi);
and a program to create a virtual midi port so that the first program has something to send the converted data to(loopmidi).
while those programs worked, it wasn't all the time, sometime you needed to restart one of the programs, sometime it just didn't work, and over all it was too much fuss, I wanted something that was plug and play.
NEW IDEA
The idea is simple, fix all the issues and make it more like I imagined.
first, the microcontroller, instead of the Arduino nano I used a RP2040-Zero microcontroller that is smaller, has usb-c instead of mini-usb, supported usb-otg, and still had more than enough digital and analog pins for the switches and potentiometers.
then it was onward to the case:
THE CASE
This time, instead of a quick square case with a dinky lid and a crappy clip. I designed a full 5 part case, that fits perfectly in the lower groove on the keyboard, and has a switch mount similar to a half-moon switch you would see on the actual B-3 organ.
(assembly view in solidworks)
The entire case is 3d printed and uses heat set inserts for screws.
(heat set inserts photo or something ig)
For the mount, I printed a bunch of fillet gauges in the approximate sizes to find the perfect inner and outer radius of the lip.
(photo of the gauges and the right sized gauges fitting on the lip)
THE CODE
The RP2040 uses CircuitPython instead of Arduino C, that was new to me, I never used CircuitPython, but I must say, in my opinion, it's better than Arduino C, mainly because you can edit the code live while it running, and it will compile locally on the chip itself every time you save.
The code was written by me using official documentation in the CircuitPython docs and midi examples written by Adafruit.
The code will be available on the GitHub link below.
THE FINAL DEVICE
Well, the final device works exactly like i`d imagined, sits just right on the keyboard, very responsive, and if I have something to change, I can very quickly bring up the code from the filesystem on the chip and edit immediately. (photo of the final product)