Unit generator
Encyclopedia
Unit generators are the basic formal units in many MUSIC-N
MUSIC-N
MUSIC-N refers to a family of computer music programs and programming languages descended from or influenced by MUSIC, a program written by Max Mathews in 1957 at Bell Labs. MUSIC was the first computer program for generating digital audio waveforms through direct synthesis...

-style computer music programming languages. They are sometimes called opcode
Opcode
In computer science engineering, an opcode is the portion of a machine language instruction that specifies the operation to be performed. Their specification and format are laid out in the instruction set architecture of the processor in question...

s (particularly in Csound
Csound
Csound is a computer programming language for dealing with sound, also known as a sound compiler or an audio programming language, or more precisely, a C-based audio DSL. It is called Csound because it is written in C, as opposed to some of its predecessors...

), though this expression is not accurate in that these are not machine-level instructions.

Unit generators form the building blocks for designing synthesis and signal processing
Signal processing
Signal processing is an area of systems engineering, electrical engineering and applied mathematics that deals with operations on or analysis of signals, in either discrete or continuous time...

 algorithm
Algorithm
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...

s in software. For example, 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
Class (computer science)
In object-oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior...

 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
Amplitude
Amplitude is the magnitude of change in the oscillating variable with each oscillation within an oscillating system. For example, sound waves in air are oscillations in atmospheric pressure and their amplitudes are proportional to the change in pressure during one oscillation...

 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 waveform
Waveform
Waveform means the shape and form of a signal such as a wave moving in a physical medium or an abstract representation.In many cases the medium in which the wave is being propagated does not permit a direct visual image of the form. In these cases, the term 'waveform' refers to the shape of a graph...

s or other shape
Shape
The shape of an object located in some space is a geometrical description of the part of that space occupied by the object, as determined by its external boundary – abstracting from location and orientation in space, size, and other properties such as colour, content, and material...

s by calling a specific generator function).

The unit generator theory of sound synthesis was first developed and implemented by Max Mathews
Max Mathews
Max Vernon Mathews was a pioneer in the world of computer music.-Biography:...

 and his colleagues at Bell Labs
Bell Labs
Bell Laboratories is the research and development subsidiary of the French-owned Alcatel-Lucent and previously of the American Telephone & Telegraph Company , half-owned through its Western Electric manufacturing subsidiary.Bell Laboratories operates its...

 in the 1950s.

Code Example

In the SuperCollider
Supercollider
A Supercollider is a high energy particle accelerator. The term may refer to:* Superconducting Super Collider, planned 80 km project in Texas, canceled in 1993...

 language, the .ar method
Method (computer science)
In object-oriented programming, a method is a subroutine associated with a class. Methods define the behavior to be exhibited by instances of the associated class at program run time...

 in the SinOsc class is a UGen that generates a sine wave
Sine wave
The sine wave or sinusoid is a mathematical function that describes a smooth repetitive oscillation. It occurs often in pure mathematics, as well as physics, signal processing, electrical engineering and many other fields...

. The example below makes a sine wave at frequency 440, phase 0, and amplitude 0.5.

SinOsc.ar(440, 0, 0.5);
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK