- Learnt27 min · loops with no gaps, and a beat
- Basic25 min · build a two-layer track
- Challenge 1–327 min · layer it, hold it, open it
- Extrabonus · put your own voice in it
Review — where we got to 5 min
The Muffin Catcher is finished and saved. Two things from it matter today.
play sound [Pop v]starts a sound and carries straight on.play sound [Pop v] until donewaits for it to finish.- Several sprites can run their own loops at the same time, and none waits for another.
Quick-fire
In the Muffin Catcher, “until done” was the wrong block and it froze a falling muffin in mid-air. Today it is the right one. What changed?
Reveal the answer
The job. A falling muffins has somewhere to be. A backing track has nothing else to do, so waiting for the sound to finish is exactly what you want.
Today’s Topic 3 min
- The Sound tab: choosing a sound, and recording one
foreveraroundplay sound [Dance Snare Beat v] until done— a loop with no gap- A beat of your own:
play sound [Drum Bass1 v]thenwait (0.5) seconds set volume to (100) %, and two sprites playing together
Learning outcome
By the end of this lesson you will be able to:
- Loop a backing track so it plays with no silence between repeats.
- Build a beat from a sound and a wait, and change its speed with one number.
- Run two layers at once and keep them in time.
Learnt — loops, beats and layers 27 min
A music video is two jobs. The music, and the moving. They are easier apart, so today is all music and nothing moves at all.
Set the stage
- Start a new project. Delete the cat.
- Choose the Concert backdrop.
- Add the Drum Kit sprite. It is not going to move; it is who the music belongs to.
A backing track is one block in a loop
Pick a sound long enough to be a track. Dance Snare Beat is four seconds and it is built to repeat.
- Click the Drum Kit, then the Sound tab.
- Choose a Sound, search
Dance Snare Beat, and click it. - In Code, build
when flag clicked, then aforever. - Put
play sound [Dance Snare Beat v] until doneinside the forever. - Press the flag. It should go round with no silence in the join.
when flag clicked
forever
play sound [Dance Snare Beat v] until done
end
when flag clicked
forever
play sound [Dance Snare Beat v]
end
How to use this: Click the green flag to start it. Nothing else to press — watch it through, then use ↺ Reset to run it again.
A beat is a hit and a gap
The other way to make music is to hit something on a timer. One short sound, one wait, in a forever.
when flag clicked
forever
play sound [Drum Bass1 v]
wait (0.5) seconds
end
play sound [Pop v] is right, because the wait is what decides the timing, not the sound.That number is the speed of your track. 0.5 is a walking beat. 0.25 is twice as fast. 1 is a slow march.
How to use this: Click the green flag to start it. Nothing else to press — watch it through, then use ↺ Reset to run it again.
Layers
One sprite, one job. The drum kit holds the beat; a second sprite claps over the top of it. Both start on the flag and neither waits for the other.
when flag clicked
forever
play sound [Drum Bass1 v]
wait (0.5) seconds
end
when flag clicked
forever
play sound [Clapping v]
wait (1) seconds
end
Waits of 0.5 and 1 fit together, because one is exactly twice the other. Waits of 0.5 and 0.7 do not, and the two layers drift apart while you listen.
How to use this: Click the green flag to start it. Nothing else to press — watch it through, then use ↺ Reset to run it again.
Volume
Every sprite has its own volume. That is how a layer sits under another one instead of fighting it.
when flag clicked
set volume to (60) %
forever
play sound [Clapping v]
wait (1) seconds
end
set volume to (100) % at the top of a stack also undoes whatever the last run left behind.Basic — build the track 25 min
Build it in this order, with the volume up, and listen after every step.
How to use this: Click the green flag to start it. Nothing else to press — watch it through, then use ↺ Reset to run it again.
Step 1 — the stage
- New project, cat deleted, Concert backdrop.
- Add the Drum Kit and the Drums Conga.
- Put them where a band would stand. They will not move today.
Step 2 — the backing track
- On the Stage, open its Sound tab and add
Dance Snare Beat. - Give the Stage the forever-until-done stack.
- Press the flag and listen for the join. There should be no gap.
Step 3 — the drum
- On the Drum Kit, add the sound
Drum Bass1. - Build the hit-and-wait loop with
wait (0.5) seconds. - Play both together. Tap your foot. Does the drum fit the track?
Step 4 — the clap
- On the Conga, add
Clapping. - Build the same shape with
wait (1) seconds. - Now you have three layers. Listen to the whole thing for twenty seconds.
Step 5 — mix it
- Give each sprite a
set volume to (100) %at the top. - Turn the clap down to 60 and the drum down to 80.
- The backing track should sit underneath, not on top.
Step 6 — change the speed
- Set the drum wait to 0.25 and the clap to 0.5.
- Listen. The whole track is twice as fast and still together.
- Now try 0.3 and 1. Hear them drift apart, then put them back.
My project sounds like a roar.
A whole track is being started every frame. Find the play sound [Dance Snare Beat v] inside a forever and change it to the until done version.
My drum plays once and stops.
The loop is a repeat (10) rather than a forever, or the play block is above the loop instead of inside it.
The layers slip apart after a while.
Your waits are not related. 0.5 and 1 stay together for ever. 0.5 and 0.7 never do.
Your own two layers
Make a beat nobody else in the room has, out of two sounds and two waits.
- Two sprites, one sound each, both looping.
- The two waits are related — one is double the other.
- You can say which sound is the beat and which is the layer on top.
Thirty seconds, no drift
Anyone can make two sounds fit for three seconds. Make a track that still sounds right after thirty.
- At least three layers running together.
- It plays for thirty seconds without slipping out of time.
- Each layer has its own volume, and you can hear all three.
Teacher note — why drift happens
A wait is not a metronome. wait (0.5) seconds waits at least half a second, and the sound before it takes a moment too, so a loop is always a shade slower than its number. Layers whose waits are doubles of each other drift together and nobody hears it. Layers on odd numbers drift apart and everybody does.
An intro, then the track
Give your track a proper opening: something that happens once, before the loops start, and never again.
- A count-in, a cymbal, or a spoken line — once only.
- The loops begin after it, not underneath it.
- Running it twice gives the same opening both times.
How to use this: Click the green flag to start it. Nothing else to press — watch it through, then use ↺ Reset to run it again.
Teacher reveal — where the intro goes
when flag clicked
set volume to (100) %
play sound [Cymbal Crash v] until done
wait (1) seconds
forever
play sound [Drum Bass1 v]
wait (0.5) seconds
end
Above the forever, so it runs once. This is the three-zone shape — set-up, loop, and the loop never ends here because a track has no curtain call.
Put your own voice in it
Every sound so far came out of the library. Record one of your own and make it the hook — the bit somebody remembers.
- Click a sprite, then the Sound tab.
- Hover the speaker button at the bottom left and choose Record.
- Press the round button, say your word, press stop.
- Drag the handles to trim the silence off both ends, then Save.
- It is now in that sprite’s sound dropdown like any other.
- The hook is a sound you recorded, not a library one.
- It comes round on a timer, not at random.
- It sits over the track without drowning it.
- The trimmed sound has no long silence at either end.
Teacher notes — the two things that go wrong
An untrimmed recording has a second of room noise at each end, which puts the hook off the beat every single time. Trimming is the fix, and it is worth doing together on the board once.
The other is volume: a recording made close to the microphone is much louder than a library sound. set volume to (70) % on that sprite is usually enough.
Going further: change [pitch v] effect by (10) in the Sound drawer turns your own voice into a chipmunk, or a giant. Nobody has met sound effects yet.
Summary 4 min
Music in Scratch is two shapes, and knowing which is which is the whole lesson.
- A track:
play sound [Dance Snare Beat v] until doneinside aforever. No gaps. - A beat:
play sound [Drum Bass1 v]andwait (0.5) secondsinside aforever. The wait is the speed. - Layers are just more sprites doing the same thing, with related waits.
- Backing track
- A long sound looped with no gap, underneath everything else.
- Beat
- A short sound repeated on a timer. The wait between hits is its speed.
- Layer
- One sprite’s loop. Several together make a track.
- Volume
- How loud one sprite is. Set it at the top of a stack, not once and for ever.
Next lesson: the dancers arrive, and they move on the beat you built today.