The definitive MIDI controller | This is not rocket science

What is RPC?

The Raspberry Pi Controller is intended to be a stand-alone MIDI sequencer workstation, made with open-source software and DIY electronic components. It is built around a Raspberry Pi board delivering a solid user interface. The I/O connections are served by an Arduino feeding directly to four MIDI inputs and outputs, guaranteeing accurate timing.

The name pays homage to the venerable Akai MPC series, but this is going to be a whole new kind of beast.

If this project is of interest to you, or if you would be interested in having your own little RPC (DIY, kit or pre-built, doesn’t matter) please drop me an email, tell me what you want to see me accomplish, and I will add you to the news email list. You’ll be the first to hear of updates, and I will be aware if someone actually wants one! No spam.

The protosynth

The DSP synthesizer project has taken most of my attention lately, with the RPC making steady progress on the background. The unique synthesis algorithms of the synth will make it a beast of a companion for the RPC.

Recent posts

It’s alive!

The box for the protosynth is finally complete. See the previous posts for details. The paint is still not entirely finished and could use some final touch-up, but it’s good enough for now. First pics!

Sumutor-1 ready to rok

Sumutor-1 ready to rok

All the hardware is in there and, most importantly, it all seems to work. All knobs and buttons register, leds light, and although there is no real gui, you can tap on the mock buttons and they register. Headphone output works, but I’m not sure yet if the voltage levels are right or if it’s clipping. All the parts of the synth work just as before.

The picture is taken at such an angle that the display looks empty. No, it works just fine. The led segment displays will get covered later, I still have to find some nice red film to put on top of them.

Sumutor-1 with its fleshy belly open

Sumutor-1 with its fleshy belly open

All the internals are in place. In the cover: thumbstick, big buttons and the headphone amplifier on the left, with the main UI panel and the touch TFT screen with its SD card slot taking the rest of the space. On the bottom: the synth on the left has grown itself an opamp attachment and a couple of admittedly ugly connectors, the USB+MIDI interface in the middle, and power supply board and the power connector and switch on the right. Oops, I forgot to remove the jtag cables for the photo shoot.

I’ll take some fancier shots and soundclips later (see the previous posts though!). There’s still much to do on the software side.

So you think you need Bluetooth audio…

You know the feeling, there’s this little project itching in the back of your mind, and as you procrastinate upon it, you realize just one part is missing.

It needs Bluetooth. The audio kind. It should play music from your phone. But you really don’t want to delve into antenna design and protocols just now… And it should sound good. Like, really good. How to go about that?

For me, the answer was in my pocket! I had been using one of these TaoTronics audio dongles for a while and the sound quality is great. So maybe I could just figure out which chip it is using, get one, and embed one into my project?

It’s a very simple device though. You press the “play” button for a second or two, the power comes on. You long press the play button again and it powers off. There’s a volume control, a microphone, and the play button… USB charging, and a battery… No need to make it complicated.

I don’t want to do this the hard way. I don’t want to deal with another complex IC and crazy datasheets.

How about I just use the dongle itself, without any modifications? It does everything I need. I could just take the sound out of it with a cable, the way it’s supposed to be used. But I don’t want a separate dongle, really. And I don’t want to keep on charging the battery constantly. Maybe I could hide it, just put one of those directly into my project! The size is right…

But I don’t need a battery at all. I’m going to have a proper power supply. And I can do better than whatever headphone amp is in that thing. I don’t need the buttons either, if it’s always on.

Time to crack it open and see what’s inside! (After ordering a second one for continued personal use – these are lovely devices.)

Long story short, after a little bit of probing, I could figure out how the battery and power button are wired. When power comes on, the dongle starts blinking two leds. I could “press” the power button with a transistor, and probe those leds to detect when the chip is alive to let go of the “button”. It did not take much time at all to write a piece of code on an NXP KL02z to control the dongle. A simple state machine would do.

It turns out that the chip in there has a rather neat, high quality differential audio output. It was AC-coupled to the internal headphone amp, so I replaced that with my own preamp circuit+antialiasing filter (just in case.)

It’s a bit of a crude hack. I removed the battery and power it with a regulator with roughly the right voltage. The board is literally just soldered on. OK, the audio DC bypass caps are a bit exaggerated perhaps, but it adds to the sound.

But it does the trick, and it does it marvellously!

Eurorack DSP development platform

We wanted to start making DSP-based modules for the Eurorack modular synthesizer format. The problem was just that there is no easy way to get started; there are no evaluation boards on the market made for this purpose, so you always need something custom for every project. So I decided to make one.

Eurorack is a relatively simple platform: it provides you with dual power supplies (+/-12V), a standard signal level of about 10V p-p, and control voltages roughly in range 0-5V. Pitch control is in 1V/octave; one volt increase in a pitch control voltage should double the pitch of a controlled oscillator.

You want to write DSP code, so you need a DSP processor. Everything is ARM these days, and with the good experiences with the KL26, we decided to try the Kinetis MK22F series. This one has hardware floating point support (single precision) and set of integer DSP instructions: it can do integer MACs in 1 clock, with a 64-bit accumulator! At 120 MHz!

The board would also need some way to get audio in and out of the processor, and the standard way to do that is to use an audio codec connected over an I2S bus. After some searching I found the AK4558 stereo codec, which has some very intriguing capabilities. It allows you to select between different antialiasing filters, some with very short group delay! The codec can also run at 192 kHz sample rates, which, combined with low-latency filters, means that the total latency for passing audio through the CPU is very low. It’s not zero, so if you mix the processed output with the input, it will still result in phase interference, but it looked very promising for short delaylines.

What else do we need? Not much, really. I wanted to have a module that could be used for development, or plugged in to an Eurorack module frontpanel for placing it in a rack.

The finished development board looks like this. On the bottom there’s a standard Eurorack power connector, and on the top two rows of pins for connecting to a front panel (or plugging in other things.)

Voltage conversions have to be provided off the board: gate signals have to be adapted to (and from) 3.3V range, and adding more CV output signals needs an external DAC. But those can be added on the front panel boards.

You can think of it as an “Arduino for Eurorack DSP code”. Development takes place in the Kinetis Design Studio, which also provides full debugging capabilities. All code is written in C++ (unless you insist on Assembly…)

And here’s how it looks like when plugged in to a frontpanel!

USBmidi2 4×4 teaser

Here’s a snap of the USBmidi2 4×4 fit on a lasercut half-rack proto panel (can you find it?):

USBmidi2 4x4 halfrack

USBmidi2 4×4 halfrack

The rack PC mount was another small side project. I have had that Nord Modular for some 13 years. Now finally I got its editor running in the place where it belongs, right next to the synth! The PC and screen are from ebay, with the PC hiding behind the display. The mount for buttons and the PC was manufactured Protocase. Some wires are still sticking out, the buttons are not hooked up yet.

USBmidi2 4×4 coming soon!