home/ atoms/ sc-soundin-microphone-input

SoundIn reads from hardware audio input buses; use headphones to prevent feedback

SoundIn.ar(index) reads live audio from hardware input bus index (0 is first hardware input). The resulting signal can be processed identically to any other UGen signal. To duplicate a mono mic to both speakers, use SoundIn.ar(0!2) which invokes multichannel expansion. Crucially, whenever a microphone feeds live into speakers in the same room, acoustic feedback is always a risk — always use headphones when coding with live microphone input. SoundIn is conceptually equivalent to In.ar(s.options.numOutputBusChannels + index) but more readable.

Examples

x = {SoundIn.ar(0!2)}.play; — mono mic duplicated to stereo. x = {SoundIn.ar(0) + CombN.ar(SoundIn.ar(0), decaytime:2, mul:0.5)}.play; — mic with delay feedback.

Assessment

A student runs {SoundIn.ar(0)}.play without headphones. What risk do they face? Write a corrected line that outputs the mic signal in both speakers.

“whenever you've got a situation with a live mic being sent to loudspeakers, there's always a risk of acoustic feedback”
corpus · supercollider-tutorials-full-transcripts-and-code-eli-fields · chunk 69