Project 17 of 35  ·  Scratch Programming  ·  Level 3
Level 3

Music Maker

Build a music composition tool that lets you record and play back melodies.

🍓  Open on Raspberry Pi Projects  ↗ Opens the official Raspberry Pi Foundation project — includes starter files and full step-by-step guide

What You Will Build

Build a music composition tool that lets you record and play back melodies. Follow the guide below to build the project, then open the official Raspberry Pi page for starter files, worked examples and extra help.

🍓 This project is on the Raspberry Pi Foundation website. Click the orange button above to access the full guide, starter Scratch project and extension activities on projects.raspberrypi.org.

What You Will Learn

  • Use the Music extension to play notes at specific pitches and beats
  • Create a visual keyboard using clickable note sprites
  • Record a sequence of notes to a list
  • Play back the recorded sequence with correct timing
  • Control tempo using a variable

Step-by-Step Guide

  • 1Enable the Music extension from Extensions.
  • 2Add 8 sprite buttons arranged as a keyboard: C, D, E, F, G, A, B, C.
  • 3Each key: when clickedplay note [pitch] for [0.5] beatsadd pitch to [notes] list.
  • 4Add a Record button. When clicked: clear the notes list, set recording to true.
  • 5Add a Stop button: set recording to false.
  • 6Add a Play button: for each item in [notes]play note [item] for [0.5] beats.
  • 7Add a tempo slider variable. Use set tempo to (tempo) from Music extension.
  • 8Add a Clear button that empties the notes list.
  • 9Add different instruments using set instrument to [ ] from Music.
  • 10Display the number of notes recorded using a variable readout.

Extension Challenges

Finished the main project? Push further:

  • Add multiple instrument tracks that play simultaneously using parallel scripts.
  • Add a loop button that repeats the playback automatically.
  • Create a visual waveform that animates with each note played.