In a recent post (
![]() |
| image taken from https://www.spokeboard.com/ |
Because the SPOKE board acts as a MIDI controller, my mind immediately went back to
For this experiment, I connected the SPOKE board as before, but instead of using an installed desktop app, I ran the web version of Sonic Pi (
The only thing I needed to do in Sonic Pi was go into the preferences to enable MIDI (see below).
![]() |
| Screenshot of Sonic Pi MIDI preference |
Once that was ticked, touching the pads on the SPOKE board started registering in Sonic Pi's cues log straight away.
Next, I tried the standard MIDI code from the Sonic Pi tutorials. The messages were clearly coming in, and the board and browser were talking to each other, but no sound was playing at all.
After a bit of searching, I found a post on the Sonic Pi forum that solved the problem:
The issue was down to how Sonic Pi matches the MIDI device in the sync command, and how MIDI controllers often send a velocity of 0 when you lift your finger off a pad. Using the advice from the forum (and changing the synth to :blade), I ended up with this short bit of code:
use_synth :blade
live_loop :midi_piano do
use_real_time
n,v = sync "/midi*/note_on"
play n,amp: v/127.0,sustain: 0.2 if v>0
end
Using the wildcard /midi*/note_on tells Sonic Pi to listen for a note_on signal from any connected MIDI port without getting tripped up by the exact device name, and use_real_time keeps the delay down so it reacts as soon as you touch a pad. Adding if v>0 at the end stops it from trying to trigger a silent note when you take your finger off the board.
Touch a pad on the SPOKE board, and you now get the :blade synth playing right out of the browser. It is a really nice, immediate way to link physical touch to live-coded sound without needing to install anything.
The next things I want to try revolve around two areas:
Digging deeper into the Sonic Pi coding to make it do a bit more than just play single notes. I don't have any particular ideas on what yet, so if you have any suggestions or things you would like to see tried, please drop them in the comments below!
Playing more with the physical side of the SPOKE board. Because the board is made up of capacitive touch connectors, you can attach crocodile clips, copper tape, or conductive objects to it—in some respects, it is like a MIDI version of the brilliant
devices. Combining that physical making side with Sonic Pi should be a lot of fun.Makey Makey


Comments
Post a Comment