Make Music with the Micro:bit Music Maker Project

 

BBC micro:bit Music Maker Project and Code

Think you’re the next Mozart? Or the next Bach? The next Timbaland? Turn your micro:bit into a music player with any old pair of headphones, learn how to program it to play music using MicroPython (read up on MicroPython on our page) and wow your friends with your monophonic production abilities. We were inspired by this cool video on CBBC and thought we'd give it a try ourselves.

You will need:

Project Time:  15 minutes
Skills required: Electronics, Coding, Perfect micro:pitch
Age: 11+
Difficulty Level: Intermediate

 

 

1

First, I  hacked my headphones to play music from the micro:bit.

The first step was to take a crocodile lead and connecting it to the GND pin on the micro:bit. Then connect the second lead onto the 0 pin. As with most of my projects, I made sure I had a few different coloured wires.  

2

Next, the other end of the GND connected crocodile lead was clamped onto the base (part closest to the flex) of the jack on my headphones. This was done because the base of the headphone is considered ground and so is connected to the GND pin.

3

I repeated Step 2, but this time connecting pin 0 to the tip of the headphone jack with a crocodile wire. The tip of the jack feeds into the right side speaker on the headphone. Then I plugged my micro:bit into a computer to program and run some music!

4

There's a really handy resource on the MicroPython coding language, and how you can be used to unlock the micro:bit's music abilities. I'm no Python whiz so this was a good introduction. 

Once you’ve learnt the basics of music coding using the micro:bit, why not try and load their Mozart example and see what it sounds like? Then move on to making your own tunes!

If you want to take this micro:walkman around, you'll need to get a battery cage and a couple of AAA batteries, flash your program to the micro:bit, and get blaring.

BBC micro:bit Music Maker Project and Code

Snap those clips into place!

Extra Task

How about making a music player that changes note using the micro:bit's accelerometer. Left goes down the scale and right goes up the scale. Up and down shifts the pitch! You could use this game code as the foundation for your own. Show where the accelerometer is pointing on the axis by using the micro:bit's LEDs.