RK-004 midi interact and the Raspberry Pi 3 Model B+ programming

There’s a midi interface that looks like a good fit for my live music setup and the recommended add-on to make it work as a USB midi interface is to add a Raspberry Pi. The device is called the RK-004. Details can be found here:

The question I have for the SonicPi community is first, if anyone has used the RK-004 with a Raspberry Pi and if so, have you attempted to install SonicPi?

My wish is that I could get the latest greatest Raspberry Pi 3 Model B+ and run SonicPi and use the RK-004’s midi clock as the clock source for SonicPi. Also, I’d like to be able to use SonicPi as my metronome sound source. There are images for using the RaspberryPi with the RK004, I do need to see if it’s been update to the latest B+ version yet. The basic function is so that the RK004 can be connected to a computer with USB, otherwise the onboard USB on the RK004 is simply for power and data, not USB control. So, while I personal will tend to do most of my coding on the Mac, being able to send the midi out USB over to the RK004 and then to other sound modules will be of importance down the road. More on that later in the post.

The second part to this question may be in discussion elsewhere so if you have seen it discussed please let me know. For this particular setup I’d like to be able to load SonicPi compositions and save them on the RaspberryPi. I don’t plan to do much in the way of live coding directly on the RaspberryPi, at least not for a while, I will compose mostly on my MacBook.

The ideas I want to use with the RasberryPi will be mostly looped ideas, simpler concepts using some randomization etc… if possible I’d like to be able to create something like a setlist or even something as basic as a set made up of 9 Buffers, I haven’t used SonicPi on anything but MacOS, so assuming it’s the same on other OS’s, I could see simply have those 9 buffers load when I start the RaspberryPi and then having a way to run each one, or stop them. So, I’m looking for some ideas on that. One way that would make sense for my live set would be to have a midi keyboard that can start or stop a buffer from playing.

Logically, I’d probably create 2 different metronome loops, maybe a 3rd, and then the rest of the Buffers would be populated with the looped sequenced music ideas that add texture to the music I perform live. I’d probably create each in a different key so I’d have a nice variety to use somewhat spontaneously in my live set.

I also want to be able to use the midi generated in SonicPi to go out the midi outs of the RK004 so I can start adding additional midi synths.

I know this was a long one, any feedback and ideas will be most appreciated. If you think you can help me directly in getting this setup please let me know if there’s cause for connecting directly. Thank you all very much!

Best, Jeff

I’ve had my eye on these. My understanding is that it’s all laid out for a Raspi Zero to fit in it, but it may be awkward and bulky with a 3 attached. I’m pretty sure the integration is mostly a bridge between USB and DIN MIDI, you wouldn’t be running a desktop off of that Pi. However, I have a PiSound, and that’s what I plan to run into the RK-004 when I get it.

1 Like

I just heard back from Gerrit, the maker of the RK004, and he informed me that he’s working on the RK005 which will feature a USB host, and client at the same time and some other goodies.

Can you gauge how complicated it would be to add a couple midi ports to a PiSound?

Here’s my wishlist so to speak, that I’m trying to figure out what’s doable.

  1. have SonicPi running on PiSound to provide the midi clock out to standard midi 5 pin, or possibly even mini TRS to 5 pin connector, if space was an issue to fit the full sized, but not midi per USB.
  2. provide an audible metronome click track (programmed with SonicPi)
  3. playback code in sync with the current clock, basically I’m looking at is as if it’s playing multiple buffers at once in sync just panned hard left and right to separate music from metronome.

The purpose of the metronome is so that when I start my live looping (using audio, instrumented and phrase looper) I typically start with a very ambient passage, so it’s recored freeform, if I have a click in my ear I can still have a way to keep track of the actual bars and beats a specific tempo, meanwhile my looper locks in with the tempo so the in and out puts are on the end of a bar. That way, later when I being in a rhythmic part it will fit the tempo perfectly, since I have the click to reference.

It’d be nice if there was a simple way to also switch either SonicPi audio routing or PiSound audio routing to go from the dual mono to true stereo, as once I have built up the loops I wouldn’t need the metronome in ear so getting the full stereo field of the SonicPi would be ideal, especially if I wanted to allow that to play on while I fade out audio loops and get prepared for the next music piece. Even if it wasn’t easy to do on the fly, I would maybe approach is with having some of the buffers programmed for stereo and some for mono, some panned left/right depending on their purpose. It’s reasonable that I can map all that out ahead but just looking for ideas where the can be done on the fly.

PiSound has an in and out onboard. Tying into an unused GPIO would be quite a task.

  1. Doable. No problem.
live_loop :metro do
  synth :noise, release: 0.03, pan: -1
  sleep 0.5
live_loop :beat, sync: :metro do
  use_sample_defaults pan: 1
  sample :bd_ada
  sleep 0.5
  sample :sn_dolf
  sleep 0.5

Everything you ask about is quite possible, I don’t do much with the audio routing, but there’s a lot to look into there. Plenty of info in the built in tutorial. I switch between Mono and Stereo all the time, no problem. Adding stereo space can be as simple as

sample :drum_cymbal_closed, pan: rrand(-1,1)
1 Like

Thank you this is very helpful. I sincerely appreciate it.

1 Like