Build a music visualizer lesson plan
Turn sound into light: levels, a fixed-point FFT into octave bands, beat detection, LED matrix bars, color themes and a party wall.
Objectives and materials
By the end, students can
- Levels, then frequencies with an FFT.
- Beats that flash, and bars that dance.
- Colors, then the whole wall.
Materials for the whole unit
- Addressable RGB LEDs
- Arduino Uno R3
- Full-size breadboard
- Function generator x 2
- Pushbutton
- Resistor x 2
- Sound sensor, KY-038
Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.
Hear the music
Levels, then frequencies with an FFT.
| Lesson | Time | What students do |
|---|---|---|
| Microphone levelsSample sound 4000 times a second and measure it: the resting level, the RMS and the peak, and why a bare electret microphone barely moves the ADC. | 55 min |
|
| Bands with FFTSplit sound into frequencies with a 64 point FFT in whole numbers: 62.5 Hz bins, the loudest found, bins gathered into octave-wide bands, and aliasing. | 55 min |
|
Materials
- Addressable RGB LEDs
- Arduino Uno R3
- Full-size breadboard
- Function generator x 2
- Pushbutton
- Resistor x 2
- Sound sensor, KY-038
Check for understanding
Each student finishes "Bands with FFT" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Aliasing".
Show the music
Beats that flash, and bars that dance.
| Lesson | Time | What students do |
|---|---|---|
| Beat flashFind the beat: a block of sound much louder than the running average flashes the panel, with a lockout, and a few beats give the tempo. | 45 min |
|
| Matrix barsDraw the spectrum on a 16 x 8 WS2812 panel: eight bands as bars two columns wide, 4 dB a LED, with peak dots that hold and fall. | 45 min |
|
Materials
- Addressable RGB LEDs
- Arduino Uno R3
- Full-size breadboard
- Function generator x 2
- Pushbutton
- Resistor x 2
- Sound sensor, KY-038
Check for understanding
Each student finishes "Matrix bars" on their own, without opening the hints. The simulator checks 4 of its 4 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Bass only".
Throw the party
Colors, then the whole wall.
| Lesson | Time | What students do |
|---|---|---|
| Color themesColor the bars three ways on a button: fire and ocean by height, rainbow by column on a hue wheel, every color worked out per LED. | 45 min |
|
| Project: a party wallEverything at once: bars, themes, a beat flash from the microphone, and an automatic gain so quiet and loud music both fill the wall. | 55 min |
|
Materials
- Addressable RGB LEDs
- Arduino Uno R3
- Full-size breadboard
- Function generator x 2
- Pushbutton
- Resistor x 2
- Sound sensor, KY-038
Check for understanding
Each student finishes "Project: a party wall" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.
Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Share the wall".
Teach this unit as a class
Start a class from this course and its 6 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.
The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.