Learning Goals 3 min
By the end of this lesson you will be able to:
- Use
set volume to (100) %andchange volume by (-10). - Use
change [pitch v] effect by (10)to change a sound’s character. - Reset sound effects so every run sounds the same.
Warm-Up 7 min
Every sound in your market is playing at exactly the same loudness, which means everything sounds equally close. A real market has things right in front of you and things three stalls away.
Quick-fire puzzle
Daniel clicked the flag four times. By the fourth, he could barely hear anything. What happened?
when flag clicked
change volume by (-25)
start sound [Meow v]
Reveal the answer
Volume went 75, 50, 25, 0. Each click subtracted another 25 from wherever it already was, because change blocks add to the current value.
You have met this exact trap three times now — with position, with heading, and with size. Volume is the fourth.
New Concept — placing a sound 15 min
Two things tell your ear where a sound is coming from: how loud it is, and what it sounds like. Scratch gives you a block for each, and between them you can put a noise anywhere in a scene.
Blocks reference
| Block | Category | What it does |
|---|---|---|
set volume to (100) % | Sound | Replaces this sprite’s volume with that percentage. |
change volume by (-10) | Sound | Adds to the current volume. Good for fades. |
change [pitch v] effect by (10) | Sound | Makes a sound higher or lower without changing which sound it is. |
clear sound effects | Sound | Removes any pitch change, back to normal. |
Volume is per sprite
This surprises people. Volume belongs to the sprite, not the project — so the cat can be quiet while the stallholder is loud, and that is exactly how you build distance.
It also means a volume block on one sprite does nothing to any other. If you want the whole market quieter, every sprite needs telling.
Pitch changes character, not identity
The pitch effect stretches or squashes a sound. Raise it and a voice becomes small and squeaky; lower it and the same voice becomes slow and enormous.
It is the cheapest way to get several characters out of one recording. Record yourself once, then play it at three different pitches, and you have three people.
Effects stick — the fifth kind of state
By now you can guess. Volume and pitch both survive between runs, so a project that fades something out will still be faded next time you click the flag.
The reset pair is set volume to (100) % and clear sound effects, and they belong at the top of the script alongside everything else you now reset by habit.
Why it matters
A soundscape where everything is equally loud is a list of noises. Vary the volume and suddenly there is a foreground and a background — which is the difference between hearing sounds and hearing a place.
Worked Example — a market with depth 15 min
We give the market a foreground and a background, then use pitch to turn one recording into two characters.
Step 1 — Put one sound in the foreground
On the cat, set the volume explicitly rather than relying on whatever it happens to be.
when flag clicked
set volume to (100) %
start sound [Meow v]
Step 2 — Push the other one back
On the stallholder, set a much lower volume before her sound plays.
when flag clicked
set volume to (40) %
start sound [Chatter v]
Step 3 — Run it and listen for the depth
The two sounds no longer compete. One is clearly in front and one is clearly behind, and you changed nothing but a number on each.
Step 4 — Make it match the picture
Shrink the distant sprite with set size to (60) % and move it higher up the Stage. Sound and picture now agree, and the illusion of depth gets much stronger.
Step 5 — Fade something out
Use the change block for what it is good at — a gradual fade as somebody walks away.
when flag clicked
set volume to (100) %
start sound [Chatter v]
repeat (8)
change volume by (-10)
move (25) steps
wait (0.2) seconds
end
Step 6 — Notice the state problem
Run that twice. The second time it starts at 100 again — because of the set block at the top. Now delete that set block and run it twice more. The second run is nearly silent from the start.
That is the fifth kind of state you have had to reset. The habit is the same as it has always been.
Step 7 — Two characters from one recording
Take your recorded phrase from last lesson and give one sprite a raised pitch and another a lowered one.
when flag clicked
clear sound effects
change [pitch v] effect by (40)
start sound [Murah v]
Step 8 — Compare the extremes
Try pitch values of 10, 40 and 200. The small one sounds like a different person; the huge one sounds like a broken machine. Subtlety wins here almost every time.
What changed: your market has a foreground and a background, and one recording can now supply several voices.
The full assembled scripts (your reference)
when flag clicked
set volume to (100) %
clear sound effects
start sound [Murah v]
when flag clicked
set volume to (40) %
clear sound effects
change [pitch v] effect by (40)
start sound [Murah v]
Try It Yourself — three small builds 12 min
Goal: Make one sprite sound close and another sound distant, using nothing but volume.
when flag clicked
set volume to (100) %
start sound [Meow v]
when flag clicked
set volume to (30) %
start sound [Meow v]
Think: identical sound, identical block, one number apart. Your ear does the rest without being asked.
Goal: Build a sprite that walks toward you and gets louder as it comes.
when flag clicked
set volume to (20) %
set size to (40) %
repeat (8)
change volume by (10)
change size by (8)
wait (0.2) seconds
end
Think: the two change blocks work as a pair. Take either one out and the effect collapses into something odd.
Mini-mission: one voice, three people. Use a single recording at three different pitches so a listener believes there are three characters at the market.
It works if: all three sprites use the same recording, a listener believes there are three different characters, and none of the three sounds like broken machinery. Keep each stack under 8 blocks.
Think: the same sound has to be added to all three sprites separately. What does that tell you about where the effect blocks have to go?
Mini-Challenge — the fade away 5 min
“Leaving the market”
Build a sprite that walks out of the market and fades to silence as it goes — and make sure it comes back at full volume next time.
It works if:
- One flag click sends the sprite away and fades its sound smoothly to nothing.
- The fade matches the movement rather than finishing early or late.
- Running it a second time starts at full volume again.
- You can say which block rescues the second run.
Reveal one valid solution (teacher)
when flag clicked
set volume to (100) %
go to x: (-150) y: (0)
start sound [Chatter v]
repeat (10)
change volume by (-10)
move (30) steps
wait (0.15) seconds
end
Ten repeats of −10 lands exactly on zero, which is neater than overshooting. The set block at the top is the whole answer to the second criterion, and pupils who omit it get a project that is silent from the second run onward.
Recap 2 min
Volume belongs to each sprite separately, which is what lets you build a foreground and a background out of the same sounds. Set replaces and change adds, exactly as with position, heading and size — so fades use change and resets use set. Pitch alters a sound’s character without changing which sound it is, and small values are far more convincing than large ones. Both volume and pitch stick between runs, so both need resetting at the top.
- set volume to
- Replaces a sprite’s volume with a fixed percentage.
- change volume by
- Adds to the current volume. Used for fades.
- pitch effect
- Makes a sound higher or lower without changing which sound it is.
- clear sound effects
- Removes pitch changes. Does not reset volume — that needs its own block.
Homework 1 min
The pitch experiment. Find out how far you can push a sound before it stops being recognisable.
- Take one recorded sound and play it at pitch 0, 20, 50, 100 and 200.
- Write down what each one sounds like, in a few words.
- Mark the highest value at which it still sounds like a person or thing rather than noise.
- Screenshot your script.
when [1 v] key pressed
clear sound effects
change [pitch v] effect by (20)
start sound [Murah v]
Bring back next class:
- Your five descriptions and your chosen limit.
- Your answer to: “What happens if you leave out the clear sound effects block and press the key five times?”
Heads up for next class: SCR-L01-38 puts sounds inside forever loops, so the market keeps humming without you doing anything.