Build-A-Band with Raspberry Pi
Create your own virtual band using Raspberry Pi, Scratch 3, and sprite-based music programming.
- Raspberry Pi
- Beginner
- 30–45 minutes
- 7 steps
Shop this project
CartYou'll need
Raspberry Pi 5 8GB Board Only$175.00
Vilros Raspberry Pi 5 Basic Starter Kit4GB / Aluminum Alloy W/ Passive+ Active Cooling$179.99
Prices from vilros.com. Tax and shipping at checkout.
Before you start, you'll need
- Raspberry Pi (any model)
- Keyboard and mouse
- Monitor
- Internet connection (for online Scratch) or Scratch 3 Desktop
Start Scratch 3
About 3 minutes
Open Scratch and set up your project.
- On Raspberry Pi, go to the Programming menu and open Scratch 3.
- Alternatively, use the online editor at scratch.mit.edu.
- Delete the default cat sprite (right-click → Delete).
- Click File → Save Project and name it 'MyBand'.
You should see
Scratch 3 is open with a blank stage.
Add a drum kit sprite
About 5 minutes
Create your first band member with a drum.
- Click 'Choose a Sprite' and search for 'Drum'.
- Select a drum kit sprite and add it to the stage.
- Drag it to the left side of the stage.
- Click the 'Add Extension' button (bottom left) and add the 'Music' extension.
You should see
A drum sprite is on the stage and the Music extension is loaded.
Program the drums
About 7 minutes
Make the drum play when clicked.
- With the drum sprite selected, go to the Code tab.
- Drag a 'when this sprite clicked' block (yellow Events) to the scripts area.
- From Music blocks, attach 'play drum (1) Snare Drum for 0.25 beats'.
- Click the drum sprite on the stage to test the sound.
- Duplicate the code (right-click → Duplicate) and change to a different drum sound and beat length.
You should see
Clicking the drum sprite plays drum sounds.
Add a singer sprite
About 5 minutes
Create a vocalist for your band.
- Click 'Choose a Sprite' and select a person sprite (any character you like).
- Drag it to the center of the stage.
- Click the 'Sounds' tab.
- Click 'Choose a Sound' → Voice, and add a singing sound.
You should see
A singer sprite is on stage with a voice sound added.
Program the singer
About 5 minutes
Make the singer play a voice when clicked.
- Go to the Code tab with the singer sprite selected.
- Add a 'when this sprite clicked' block.
- From Sound blocks, attach 'start sound [your voice sound]'.
- From Looks blocks, add 'switch costume to [costume2]' to make the singer change appearance.
- Add a 'wait 1 seconds' block.
- Add 'switch costume to [costume1]' to return to normal.
- Test by clicking the singer.
You should see
Clicking the singer plays a voice and changes costume.
Design the stage backdrop
About 5 minutes
Give your band a performance venue.
- Click 'Choose a Backdrop' (bottom right, next to sprites).
- Browse to 'Indoors' and select a stage or concert hall backdrop.
- The backdrop appears behind all sprites.
You should see
Your band has a stage backdrop.
Add more instruments
About 10 minutes
Build out your full band.
- Add more sprites: guitars, pianos, bass, or backup singers.
- For each sprite, add sounds from the Sound library (Music category).
- Program each sprite with 'when this sprite clicked' and 'play sound' blocks.
- Experiment with different instrument sounds and timing.
- Try using 'when space key pressed' to trigger multiple instruments at once.
- Add 'play note (60) for (0.5) beats' blocks for melodic instruments.
You should see
You have a full band with multiple clickable instruments.
It didn't work
Sounds don't play or are cut off.
Use 'play sound until done' instead of 'start sound' to ensure sounds complete before the next action.
What to do next
- MP3 Player with Sense HATBuild another Raspberry Pi music project.
- More Raspberry Pi projectsExplore beginner Raspberry Pi builds.
Stuck? Contact Vilros Support with your board model and what you see on screen.