Today you will use microphone loudness to control sprites, creating sound-reactive visuals.
1 Warm-Up
2 Predict
3 Try It
4 Plan
5 Build
6 Fix It
7 Extend
8 Math Challenge
For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 2
✦ CSTA 2-AP-12 · CSTA 2-AP-17 · ISTE 1.5.c · Standards
| 🎯 I can | use microphone loudness to control sprites, creating sound-reactive visuals |
| 🧩 New blocks | 1 block |
| 📝 New words | 8 words |
| ⏱ Lesson time | ~40 min |
Teacher Guide
📋 Before class
⚠️ Common misconceptions
- Students often expect loudness to stay high after a loud sound. It drops back to near 0 almost immediately. Effects need to be applied inside a forever loop to feel continuous.
- Students may think loudness returns the exact volume in decibels. It returns a Scratch-internal 0–100 scale that approximates perceived loudness.
- Students expect the sounds list to hold every reading. The
delete (1) of [sounds ▾]block drops the oldest item once the list passes five, so the list is a rolling window, not a full recording.
🎯 Differentiation
🐢 Struggling: Focus only on the size-reactive version (step 1). Skip the clap counter until the basic loudness→size mapping works.
🚀 Advanced: Challenge them to make the sprite color-shift based on loudness — map (loudness) to a color effect value, so quiet = blue and loud = red.
💡 During the lesson
- Warm-UpScratch will ask the browser for microphone permission. Walk students through accepting this before the lesson. If the school network blocks microphone access, run the teacher's setup as a demo and have students observe. The concepts still apply even without microphone access. The microphone is a sensor 🌡️ that reads the room; it measures how loud the sound is, so the sprite can be reactive 🔔, responding the instant the volume changes.
- Try ItAsk: "If loudness = 50 and we set size to (loudness * 3), how big is the sprite?" (150%.) "If loudness = 0?" (0% — Pico shrinks to a tiny dot! Add a minimum: ((loudness) * (3)) + (20).) This is a good preview of the min/max discussion.
In the second experiment, cooldown 0 reveals the frame-rate problem from Section 2 (Predict) — claps shoot up by many per clap. Cooldown 0.5 fixes it. The third experiment reuses the cooldown pattern for a visual pulse (change size by) instead of a counter. Ask: "What happens if you change the cooldown wait from 0.5 to 0.1 seconds? From 0.5 to 2 seconds?" Shorter wait = more sensitive, longer wait = misses rapid sounds. The stage's 🎤 loud button reads as 80, so a threshold of 90 never fires there; in a real room, background noise can pass a threshold of 5. - PlanThree scripts run from one flag click at the same time. Branch A runs every frame. Branch B fires when loudness crosses the threshold. Branch C stores readings in a list, then walks the list with an inner loop to find the biggest one — a loop inside a loop, which the next chapter uses for sorting.
- BuildAll three scripts share one green flag. Branch A grows Pico every frame; Branch B counts claps only when loudness crosses the threshold; Branch C keeps a five-item history and scans it. Ask students to predict what a lower threshold (30) does before they test it — the counter becomes more sensitive, so quieter sounds also count. In step 10 the
repeatsits inside theforever— point at the nesting and count the two loops out loud. The list half of this build needs no microphone: with thepick randomswap from the step 9 tip, the list, the indexi, and the scan behave identically, so a classroom with no microphone still gets the list practice the next chapter builds on.
Show the picture first. Ask what will happen — everyone points or says one word.
Everyone picks an answer first. Then press the flag together.
Change one thing at a time. Run it, watch, then change the next thing.
Pairs put the cards in order before anyone opens Scratch.
Students build step by step. Walk around — help with questions, not with the mouse.
Ask: what did we want, and what did it do? Let them find it.
Fast finishers pick the next tier. Everyone else finishes their build.
Work it out on paper first. Then check it on the stage.