Learning Goals 3 min
By the end of this lesson you will be able to:
- Put a sound inside a
foreverloop to make it continuous. - Explain why the loop must use
play sound [Meow v] until donerather than the other block. - Layer several looping sounds without them turning into noise.
Warm-Up 7 min
Your market makes all its noise in the first few seconds and then falls completely silent. Real places do not do that — there is always something going on underneath.
Quick-fire puzzle
Wei Jie wanted continuous background noise. He built this and got an unlistenable roar within about two seconds. What went wrong?
when flag clicked
forever
start sound [Chatter v]
end
Reveal the answer
start sound [Chatter v] does not wait. The loop went round hundreds of times a second, starting a fresh copy of the sound each time, all layered on top of each other.
What he needed was the block that holds the loop until the sound has finished — which is the one you have been treating as the boring option since Lesson 35.
New Concept — a sound that restarts itself 15 min
You already know both halves of this. A forever loop runs its contents endlessly, and one of the two sound blocks waits while the other does not. Putting them together correctly is the entire lesson — and putting them together incorrectly is genuinely memorable.
Blocks reference
| Block | Category | Its job here |
|---|---|---|
forever | Control | Runs its contents endlessly, so the sound restarts every time it ends. |
play sound [Meow v] until done | Sound | Holds the loop until the sound finishes. This is the one that works. |
start sound [Meow v] | Sound | Does not wait. Inside a forever this produces chaos. |
Why the boring block turns out to matter
Since Lesson 35 you have mostly reached for start-sound, because overlapping is what makes a market sound busy. Inside a forever loop that instinct is exactly wrong — the loop has no wait of its own, so the sound block has to supply one.
It is worth noticing that the same block can be the right answer and the wrong answer depending only on where it sits.
Loops from the Loops category
The sound library has a category called Loops, and those sounds are made for this. They are recorded so the end joins seamlessly onto the beginning, which means a forever loop plays them as continuous music rather than an obvious repeat.
Any sound will loop, but most will have an audible seam. If you want background that nobody notices, start there.
Layering background
Different sprites can each run their own looping sound, and because they are separate scripts the loops overlap without fighting. Two or three layers is usually plenty — beyond that it stops being atmosphere and becomes noise.
Why it matters
Continuous background is what makes a soundscape feel like a place rather than a sequence of effects. It is also how nearly every game gets its music.
Worked Example — the market that keeps humming 15 min
We make the mistake first, on purpose, because it is much easier to remember once you have heard it.
Step 1 — Make the mistake
On the stall sprite, build the wrong version and run it for about two seconds before hitting the stop sign.
when flag clicked
forever
start sound [Chatter v]
end
Step 2 — Work out why
The loop has nothing to slow it down, so it goes round as fast as the computer allows, starting a new copy of the sound every single time. Within a second there are hundreds playing at once.
Step 3 — Fix it with the waiting block
Swap the sound block for the until-done version and run it again.
when flag clicked
forever
play sound [Chatter v] until done
end
Step 4 — Push it into the background
At full volume the loop competes with everything else. Set it lower before the loop begins.
when flag clicked
set volume to (35) %
forever
play sound [Chatter v] until done
end
Step 5 — Add foreground sounds over the top
On the cat, keep using start-sound for one-off noises. Because it is a different sprite and a different script, it plays cleanly over the background.
when flag clicked
set volume to (100) %
wait (2) seconds
start sound [Murah v]
wait (3) seconds
start sound [Murah v]
Step 6 — Listen for the seam
Focus on the background and wait for the moment it restarts. If you can hear a click or a gap, the sound was not designed to loop. Try something from the Loops category instead and the seam disappears.
Step 7 — Add a second layer
Give a third sprite its own looping sound at a different volume. Two layers of background, at different distances, is where a market starts sounding genuinely convincing.
Step 8 — Check it stops
Press the stop sign. Everything should go silent immediately. A forever loop has no ending of its own, so the stop sign is currently the only way out — which is fine for background music, and worth being aware of.
What changed: your market has an underneath. It no longer runs out of noise after five seconds.
The full assembled scripts (your reference)
when flag clicked
set volume to (35) %
forever
play sound [Chatter v] until done
end
when flag clicked
set volume to (100) %
wait (2) seconds
start sound [Murah v]
Try It Yourself — three small builds 12 min
Goal: Build a continuous background at a volume that sits behind everything else rather than on top of it.
when flag clicked
set volume to (30) %
forever
play sound [Chatter v] until done
end
Think: try it at 100% as well. The sound is identical; at full volume it stops being background and becomes the whole project.
Goal: Build a repeating rhythm rather than a repeating sound — a loop with a gap in it.
when flag clicked
set volume to (50) %
forever
play sound [Bell Toll v] until done
wait (2) seconds
end
Think: the wait sits inside the mouth, so it happens on every pass. Put it below the loop instead and it never runs at all.
Mini-mission: three layers. Build a market with a continuous background, a repeating rhythm, and occasional one-off sounds over the top — three layers that stay distinguishable.
It works if: a listener can pick out all three layers separately, the background never drowns the foreground, and nothing distorts. Keep each stack under 8 blocks.
Think: which of your three layers needs the until-done block, and which needs start-sound? Getting this wrong on any one of them is instantly audible.
Mini-Challenge — the seam hunt 5 min
“Find the join”
Build a looping background and find out whether a listener can hear the moment it restarts. Then find a sound where they cannot.
It works if:
- You loop an ordinary sound and can point out exactly when it restarts.
- You loop something from the Loops category and cannot.
- You can describe what the seam sounded like.
- Your final background uses the seamless one.
Reveal what to listen for (teacher)
Ordinary sounds usually end on silence and begin on an attack, so the seam is a small gap followed by a bump. Loop sounds are recorded to avoid both.
Worth pointing out: this is also why the trimming from Lesson 36 matters. A recording with silence left on the end has a built-in gap every time round.
Recap 2 min
A sound inside a forever loop becomes continuous background — but only with play sound [Meow v] until done, because the loop has no wait of its own. The start-sound block that has served you well everywhere else produces hundreds of overlapping copies here. Add a wait inside the loop and the background becomes a rhythm instead of a drone, and keep background volumes well below your foreground sounds or nothing else can be heard.
- Looping sound
- A sound inside a forever loop, restarting each time it ends.
- Loops category
- Library sounds recorded so the end joins the start with no audible seam.
- Seam
- The audible join where a looping sound restarts.
- Layering
- Several sounds at different volumes, creating foreground and background.
Homework 1 min
The minute test. Find out how long your background survives before it becomes annoying.
- Build a looping background and leave it running for a full minute.
- Write down the moment you first noticed the repeat.
- Try a longer sound, or a second layer, and see whether that moment gets later.
- Screenshot your final script.
when flag clicked
set volume to (30) %
forever
play sound [Chatter v] until done
end
Bring back next class:
- Your two timings, before and after.
- Your answer to: “Why does start sound produce chaos inside a forever loop when it works perfectly well outside one?”
Heads up for next class: SCR-L01-39 is the arc finale. You assemble the whole soundscape and save it to show.