When it rains in San Francisco, the raindrops ping off of some sort of pipe near my office window, and it sounds just like a thumb piano being plucked. I love this association, and I think it's also a kalimba that Max Cooper uses in the song Order from Chaos. I wanted to build something that lets me have my own "pet rainstorm".
- Person picks up the kalimba and starts to plink on it.
- Rain noises start to plink back.
- As the person plays more, the plinks grow more frequent, and then thunder begins to roll in. Rain and thunder tracks have multiple options, which are randomly chosen, for variety.
I figured I could control this with a simple counter, which increments when the kalimba is plinked, and decays over time, so that you get a storm which builds and then rolls away depending on the amount of plinking.
I grabbed some thunder samples from the BBC's open sound effect collection. There's one that isn't even real thunder, but a recreation of an old theater sound effect made by rolling a cannonball over a wooden floor! The BBC files come as WAVs, so I imported them into Audacity and then exported them to mp3.
The rain came from Freesound.
I ended up with 17 tracks total, and it handled them just fine.
This is pretty simple! I plugged in a small LiPo battery and speaker, so the kalimba could run autonomously. (The output device has been modified to use an 1/8" audio plug directly to the speaker, instead of using Bluetooth, so it doesn't actually require its own power.)
Then, I attached the board to the back of the thumb piano and ran a wire from E11 to the front of the instrument, where it was screwed into place on one of the metal bars that holds the plinky tines in place.
I thought about making each tine have its own electrode, but every time I tried to isolate them electrically, it would dull the sound. Not acceptable!
Making it touch-responsive means that I don't have to worry about calibrating for ambient sound.
I combined a number of Bare Conductive's tutorials to pull together the effect I wanted:
- Getting started with the Touch Board
- Changing the mp3s on the board – really simple! Just rename, then drag and drop onto the board, which appears as a USB flash storage device.
- Changing the volume, so the storm slowly builds and fades away
- How to play more than 12 tracks with the Touch Board – This was useful to read; I went a different route since I was only using a single electrode to trigger the action. So I took the "electrode" folder code and swapped it out for random number generators that would choose a track depending on the intensity level.
I used these variables:
- threshold – the intensity of the storm, based on the amount of recent plinking
- counter – taper the storm down over time
- volume – the threshold, scaled to match the Touch Board's audio profile
- LVol & RVol – used to add a bit of randomness to the left and right speaker volumes, if plugged into a stereo sound system; hopefully, this should make it feel more realistic and immersive.
- trackno – the randomly generated track number that we feed into MP3player.playTrack()
Eventually, I'd like to add a thunder cloud that sparks "lightning" as you play on, with a mister that feeds my air plants. But that might be a project for another day :)