Skip to content


Exploring music with the BBC micro:bit

16 Jun 2024

On World Music Day you can use the micro:bit to explore music through coding. Here's how BBC micro:bit music projects have been used in classrooms around the world.

Six students from Malvern Wells Primary School, UK, stand in a circle holding their micro:bits, which are all loaded with music.

6 pupils from Malvern Wells Primary School, UK, with their musical micro:bits. Photo from Bob Bilslund

Taylor Swift, BTS, The Weeknd… these superstars are household names for adults and young people alike, making music part of our day-to-day lives. You could inspire students to develop a deeper interest in coding by tapping into their passion for music in your lessons with the micro:bit.

Learning about music with the micro:bit is simple. It’s easy to play your favourite song because you don’t need to learn which strings to pluck or keys to press, you can just program the notes you want to play by trial and error using the play tone block in the MakeCode editor.

Play tone block

You can easily introduce concepts such as tones, rests, beats, volume, sound waves, frequency, and tempo because there are blocks referring to each.

Teaching music with the micro:bit can also be inexpensive. If your school already has a class set of micro:bits for computing, your school has a set of musical instruments for music lessons that students are already familiar with!

By teaching students how to write music on the micro:bit, you give them a tool for creativity. You may find your less academic students more engaged in lessons, or inspire students to pick up a ‘proper’ musical instrument when they have enjoyed composing on the micro:bit.

Music is one of the most popular things I do with the micro:bit and MakeCode. Even for those of us who are musically challenged and can just about cope with four notes, creativity always shines through!

Amanda Pickard, primary school teacher and Digital Development Officer, Scotland

So how do you get started? First of all, find out if you have a V1 or V2 micro:bit (a V1 micro:bit has a straight bottom but the V2’s bottom is bumpy). If you have the V1 micro:bit, simply attach crocodile clip leads to the GND and 0 pins and join to headphones or speakers to play sounds. The micro:bit V2 allows you to play and sense sounds without any extra equipment.

Easy projects to get going

P7 students from St Patrick's Coatbridge School

Frère Jacques loops

Linsey Owens, P7 teacher at St Patricks Primary School in Coatbridge, Scotland, taught a lesson on the Frère Jacques loops project. This project uses loops that play each bar of the popular French folk song twice to save having to program the same notes again.

Linsey's students adapted the project to play the theme from Harry Potter and ‘Never gonna give you up’ by Rick Astley.

Not all of the children can read music, and we have a limited range of pitched instruments, but by experimenting with the MakeCode website, the children are able to explore pitch and tempo, and recreate some well-known (and well-loved!) tunes!

Linsey Owens, P7 teacher, St Patricks Primary School


The Malvern Wells Primary School Code Club recently made their own music players using the Jukebox project and set them off all at once, creating joy but also what their teacher described as a ‘cacophony’.

The Jukebox project will allow your students to make a music machine that plays different tunes at the push of a button. It’s a simple project to get started as it works by playing up to 20 tunes that already exist in MakeCode.

Guitar 1

SEMI High Tech U, a non-profit that introduces students to the microelectronics industry, recently ran a workshop in Germany which included the Guitar 1 project.

One fourth grader said, 'I enjoyed the workshop — it was a lot of fun! The guitar activity was especially enjoyable, and the micro:bit activities were great too!'

The Guitar 1 project is similar to the Jukebox project but instead of using the micro:bit’s buttons as an input, you make your own input device using cardboard covered in strips of tin foil connected by crocodile clip leads to the micro:bit's pins.

The project works by using your body to complete an electrical circuit, so it’s a great project to teach about conductive materials. It also appeals to students who love arts and crafts.

Get cross-curricular

There are lots of ways to experiment with projects and get cross curricular with a micro:bit.

  • Terrace Road Primary in Swansea, Wales incorporated the micro:bit into their study of Ernest Shackleton's race to the pole. They programmed a sea shanty into the micro:bit and sang to each other with it.
  • Students at Westerly School of Long Beach, USA programmed pins and buttons to play notes, and in doing so learned about circuitry and positive and negative currents.
  • micro:bit Champion Allen Tsui even looked at the musical notation of the Doctor Who theme tune and converted it to code!

Lessons and professional development

If you’re short of planning time, why not use the Musical micro:bit unit of work? It’s designed for students aged nine to ten. Students compose musical phrases and algorithms before exploring how the micro:bit can be programmed to play music.

The Making and sensing sound online course explores music and creative sound-making with the micro:bit. Free and just 40 minutes long, the course also shows how you can create code that uses the micro:bit V2’s built-in microphone to respond to and measure sound.

Share your experiences

Music can be a fun way to spark off students' interest in coding. Try out some of the resources mentioned here and share your experience on X, Instagram or Facebook .

Latest stories