Unit generator
Basic formal unit in MUSIC-N-style programming languages
Unit generators (or ugens) are the basic formal units in many MUSIC-N-style computer music programming languages. They are sometimes called opcodes (particularly in Csound), though this expression is not considered accurate in that these are not written directly as machine-level instructions.
Unit generators form the building blocks for designing synthesis and signal processing algorithms in software. The unit generator theory of sound synthesis was first developed and implemented by Max Mathews and his colleagues at Bell Labs in the 1950s.
01Examples
A simple unit generator called OSC could generate a sinusoidal waveform of a specific frequency (given as an input or argument to the function or class that represents the unit generator). ENV could be a unit generator that delineates a breakpoint function. Thus ENV could be used to drive the amplitude envelope of the oscillator OSC through the equation OSC*ENV. Unit generators often use predefined arrays of values for their functions (which are filled with waveforms or other shapes by calling a specific generator function).
In the SuperCollider language, the .ar method in the SinOsc class inherits methods from an overarching unit generator class (UGen) that generates a sine wave. The example below makes a sine wave at frequency 440, phase 0, and amplitude 0.5.
- SinOsc.ar(440, 0, 0.5);
Sources and credits
This article is adapted from the Wikipedia article “Unit generator”, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.
Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.