Create audio spectrum
create_spectrumCreates an FFT audio spectrum analyzer with exposable frequency-bin channels for binding to parameters or driving visuals.
Instructions
Build an FFT audio-spectrum analyzer that exposes N separate, ready-to-bind frequency-bin channels (band0..band{N-1}) on a Null CHOP. This is the per-band complement to extract_audio_features (which only gives overall level + bass/mid/treble): bind a row of parameters to op('…/spectrum/spectrum')['band0'], ['band1'], … to drive a bank of bars, or pick one frequency. A Sensitivity knob scales every band. Source can be the live device (mic/line — may prompt for macOS permission), an audio file, a synthetic oscillator (for testing), or an existing CHOP.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | Audio source. 'device' = live microphone/line in (the real-world default; creating it may pop a one-time macOS microphone-permission dialog — click Allow). 'file' = an audio file. 'oscillator' = a synthetic tone (white noise → energy in every band, handy for testing without any device permission). 'existing_chop' = reuse a CHOP you already have. | device |
| audio_file_path | No | Audio file path (source='file'). | |
| existing_chop_path | No | Path of an existing audio CHOP to analyze (source='existing_chop'). | |
| bands | No | Number of frequency bins to expose as separate, bindable channels (band0..band{N-1}). 16 or 32 is typical; higher = finer frequency resolution. | |
| expose_controls | No | Expose a live 'Sensitivity' knob (a gain over every band channel). | |
| parent_path | No | /project1 |