Project 09 of 35  ·  Scratch Programming  ·  Level 2
Level 2

Drum Star

Build an interactive drum kit where clicking sprites and pressing keys plays drum sounds.

🍓  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 an interactive drum kit where clicking sprites and pressing keys plays drum sounds. 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 when this sprite clicked to trigger drum sounds
  • Map keyboard keys to different drum instruments
  • Animate each drum with a size change on hit
  • Use the Music extension to play drum notes
  • Create a record and playback system using lists

Step-by-Step Guide

  • 1Create or find a drum kit backdrop.
  • 2Add four drum sprites: bass drum, snare, hi-hat, cymbal.
  • 3On each drum: when clickedplay sound [drum sound] → size animation (change size by 10, wait 0.1, change size by -10).
  • 4Add key mappings: when [space] pressed → bass drum; [a] → snare; [s] → hi-hat; [d] → cymbal.
  • 5Add the Music extension from Extensions menu.
  • 6Replace sound blocks with play drum [1] for [0.25] beats for more options.
  • 7Create a record variable. When record = true, add each key pressed to a list.
  • 8Add a Record button sprite that sets record to true/false.
  • 9Add a Play button that loops through the list and plays each stored drum.
  • 10Show a BPM meter using a variable that counts hits per 10 seconds.

Extension Challenges

Finished the main project? Push further:

  • Add a metronome click sound on a timer to help keep rhythm.
  • Create different drum kits by switching all costumes at once.
  • Build a pattern memory game: the drum plays a sequence you must repeat.