home/ atoms/ sonic-pi-live-audio

live_audio creates a persistent named audio input stream that can be moved between FX contexts dynamically

live_audio :name captures continuous audio from a sound card input and routes it through the current FX context. Unlike synth :sound_in (which has an ADSR envelope and terminates), live_audio runs forever until explicitly stopped with live_audio :name, :stop. Calling live_audio :name from a different thread or live_loop moves the stream to that context’s FX chain — enabling real-time FX switching on live guitar or microphone input. Multiple inputs and stereo mode are supported via input: and stereo: opts.

Examples

with_fx :reverb do live_audio :guitar end

Later: hot-swap to echo

with_fx :echo do live_audio :guitar end

Assessment

Start a live_audio stream with reverb, then switch it to echo while running. Explain how live_audio differs from synth :sound_in.

“`live_audio` runs forever (at least until you stop it)”
corpus · sonic-pi-built-in-tutorial · chunk 25