Wearabits Project

The Wear-a:bits Project

Microbit Music

A v1 micro:bit (with its logo on the front in blue, green, yellow or red) has no built-in loudspeaker, but you can hear the sounds it produces by connecting it to a buzzer or by using crocodile clips to connect it to a pair of headphones.

A v2 micro:bit (with its logo on the front in gold) has a built-in loudspeaker (and microphone).

You can code the microbit to play tunes using the red Music blocks. If you click the number in the white box after play tone the editor will show you a piano keyboard and the name of the note you’ve clicked on.

You can also change the length of the note by clicking on the dropdown list for the number of beats to hold it for. There are three versions of each letter name for a note on the keyboard: Low, Middle and High.

Finding Tunes

If you (or a friend) can read music, you can find the notes for lots of popular tunes on the web by looking for “sheet music”. And the musescore site has lots of free arrangements of songs that people have made and shared.

If you don’t read music, you could try https://noobnotes.net/popular/ which gives the letter names of the notes instead of the musical notation.

Each tune’s page has a picture of a piano keyboard at the top, with the note names on the keys. Instead of using the words Low, Middle and High for notes they have:

.A = Low A

A = Middle A

^A = High A

They don’t include the length of the notes, so you’ll have to work out how many beats to tell the micro:bit to play each one.

Start the Music

So that you can control when the microbit plays the tune, you could put the music blocks inside a pink Input block:


Shake it off

Or code the micro:bit to play the chorus of “Shake it off” if you shake it:

Inside the green repeat block, add the blocks to play the notes middle A for 1⁄2 a beat, middle B for 1⁄2 a beat and middle G for 2 beats.

Move it

Or don’t worry about tunes and just code the micro:bit to turn its acceleration into sounds that change when you move it and tilt it: