A Unit Generator (UGen) is an object that generates or processes signals entirely in the server
A Unit Generator (UGen) is the fundamental signal-producing object in SuperCollider — the building block of all synthesis. Each UGen generates a continuous stream of samples that is either audio (sent to outputs) or control data (used to modulate other UGens), and every UGen class derives from the UGen class. All UGen computation happens in the server (scsynth), not in the language. Common examples: SinOsc (sine), Saw (sawtooth), Pulse (square), LFNoise0 (stepped random), MouseX/MouseY (mouse position). A UGen is instantiated at a rate — SinOsc.ar audio-rate, SinOsc.kr control-rate. A critical misconception to correct: Pbind is not a UGen (it is a score) and EventStreamPlayer is not a UGen (it is the player). In the instrument analogy, UGens are the vibrating mechanism that makes the sound, distinct from the score and the performer.
Examples
{SinOsc.ar(440, 0, 0.1)}.play; // sine, 44100 samples/s in the server
{Saw.ar(220)}.play;
{Pulse.ar(LFNoise0.kr(2).range(100,1000))}.play; // stepped-random control drives audio
{LFNoise0.ar(10).poll}.play; // prints ~10 values/s to Post
Assessment
Name three UGens and state what signal each generates and whether it is typically audio or control. Which would you use to slowly sweep a filter cutoff, and which for an audible tone? Is Pbind a UGen? Is EventStreamPlayer a UGen? Justify each answer.