BBC micro:bit Theremin

 

 

We've had our first ever bespoke code made for us by the awesome David Whale!

Theramin Being Played | BBC Micro:bit Project

A theremin, for those that don't know what one is!

It turns your micro:bit into a theremin. Perfect for making out of this world UFO noises. For those that don't know what a theremin is, quickly skip to the bottom and watch the video.

We had word that Nicholas Tollervey had been trying to create a micro:trombone using MicroPython so I thought, why not try and make a micro:theremin. It proved way harder than I'd expected; trying to get the musical scales to work properly was a nightmare!

So like any clever (lazy) person, I went looking for help. David came to my rescue and managed to interpret my very vague instructions and create exactly what I wanted! This is from the email I sent to him:

The code I want to build is an accelerometer based music music player. A bit like a theremin. It would begin with a C note, and an LED sprite appearing in 2y 2x on the micro:bit. As the device is tilted left the note goes down by a half note, and vice versa for the right. Tilting upwards shifts the pitch. As the note changes the LED sprite moves to show what note you're showing.

BBC micro:bit theremin music code

And he figured it out! In order to play the music out loud you will have to hack a pair of headphones. Fortunately we have a nice and easy guide on how to play music using your micro:bit.

Flash our code onto your micro:bit and make some far out sounds. You can also download the code and import into Block Editor to have a play around with it. I couldn't make it work in terms of the Western Scale but maybe you're the genius who can! For some inspiration, I leave you with Leon Theremin and his eponymous instrument. Talk about an engineering genius.