Music visualizer

Every analyzer of Pyzed in one window: examples/audio/visualizer.py.
python examples/audio/visualizer.pyIt plays a short groove made with the engine (a sequenced bass, kick, snare, hats and chords).
Switch the source to Microphone to see your own voice. The panel on the left changes the main
spectrum live: its look (variant), its colors (colors), how many bands it has, how fast
the bars fall and whether the peaks stay.
How it is built
Section titled “How it is built”demo_song(engine)builds the groove: aclockdrives asequencerfor the bass and another one for the snare, and its beat output strikes the kick. Everything goes through ascopemodule before the speakers, so it can be analyzed.- Each frame, the view asks that module for its analysis, computed in Rust:
mags = tap.spectrum(512) # 512 bands, 20 Hz to 24 kHz, in dBrms, peak = tap.level()wave = tap.scope(2048) # the last 2048 samples- The same
magsfeed aSpectrumin two looks and aSpectrogram;wavefeeds aScope; the levels feed twoVuMeters.
When the source is the microphone, the song’s output is muted so the speakers do not feed back into the microphone.