Extracting Loudness and Spectrum From Live Audio
Learning objectives
- learner can compute an RMS loudness value and a perceptually meaningful FFT spectrum from an audio stream
- learner can rescale FFT bins logarithmically to match human pitch perception and read both frequency and waveform data
- learner can derive a spectral-centroid brightness feature and explain what musical quality it tracks
Capstone — one whole task that evidences the objectives
From a running audio source, build an analysis readout that shows live RMS loudness, a log-scaled FFT spectrum, the time-domain waveform, and a spectral-centroid brightness number, and annotate which musical events move each meter.
Prerequisite modules
Every audio-reactive rig — a p5.js visual layer riding on a TidalCycles or Ableton set, a VJ patch listening to the house feed — starts with the same question: what is the music doing right now? This module builds the answer as a whole artifact: a live analysis dashboard that turns a raw audio stream into four honest numbers-and-pictures — loudness, spectrum, waveform, brightness. In performance, this dashboard is what you map from; a bass drop, a hi-hat run, or a filter sweep each move a different meter, and knowing which is what makes your visuals feel musical rather than random.
The arc runs from supported to solo. Start with a single meter: wire up an amplitude analyser and lean on “RMS amplitude gives a perceptually smooth loudness value” to understand why you read RMS, not peaks, and why smoothing matters. Next, add the spectrum bar chart using the FFT-decomposition atom as your how-to, then confront its flaw — all the musical action squashed into a few bass bars — and fix it with “logarithmic and 1/3-octave FFT scaling”. Add the oscilloscope view via the dual analyze()/waveform() fact, and finally compute the centroid as a weighted mean over your existing bins. The capstone then removes the scaffolding: you assemble all four readouts yourself and annotate, by ear and eye, which musical events drive each.
Every required atom gates the capstone directly — drop any one and a panel of the readout can’t be built or explained. There are no supporting atoms here; this module is deliberately lean, a foundation the mapping and reactive-visuals modules build on.
Atoms in this module
Required — these gate the capstone
Part of curricula
- Audio-Visual Performer — integrated, synced live AV — Make the image listen (audio-reactive show) required
- Live Visualist — zero to performing live-coded & generative visuals — Reactive & procedural — make it listen, and go to the GPU required
- Shader Artist — real-time GPU craft to a demoscene-grade visual — The demoscene-grade piece: pipeline, reactivity, and release recommended
- VJ — visual performance with projection, light & video — Lock to the music: sync to a DJ or band required
Unlocks — modules that require this one