## List of UGens

Sound Generators

- Noise
- Oscil
- LiveInput
- FilePlayer
- Sampler
- Vocoder

Effects

- Delay
- Pan
- Balance
- Gain
- MoogFilter
- BitCrush
- WaveShaper
- Flanger

Envelopes

- Line
- ADSR
- Damp
- GranulateRandom
- GranulateSteady

Math

- Abs
- Constant
- Midi2Hz
- Multiplier
- Reciprocal
- Summer

Utility

- Bypass
- EnvelopeFollower
- TickRate
- Sink

AudioOutput can also be treated as a UGen for the purposes of patching, but it stands alone, different from the rest.

Instantiating a UGen

Whenever you want to use a UGen, you'll need to instantiate it first. The code to instantiate and Oscil UGen can look like this:

`Oscil osc = new Oscil( 349.23, 0.8 );`

This line tells Processing to create a new reference to an Oscil object and call that reference "osc". This line also says to "instantiate" an Oscil object using one of its constructors, specifically, the constructor which takes two float values. This line also tells Processing to make the new object ref "osc" and make it point to the newly instantiated Oscil object. In summary, this line makes "osc" refer to a new Oscil object. Every UGen will need to be instantiated in a fashion similar to this, although sometimes the creation of the reference and the creation of the object may need to be put in different locations.

Inputs

Almost all UGens have inputs. An input is a way to control what the UGen does while it's generating sound. For instance, an Oscil UGen has an amplitude, frequency, and phase input. The frequency input allows the frequency to be changed as the Oscil is sound. Many of the UGens, like the following effects UGens, have an audio input. This is what brings in the sampleframes from the previous UGens. Often when directly patching to a UGen, you are actually patching to its audio input.

Sound Generators

An Oscil UGen is an oscillator. It creates an output waveform which repeats at the specified frequency and at the specified amplitude. In the case of Oscil, if a constructor with two floats is called, the first is read as the frequency and the second is read as the amplitude. It is possible to include a waveshape as well, as a third argument.

The Noise UGen generates noise of different "tints": white, pink, and red/brown. Wikipedia has some excellent articles on audio noise.

LiveInput transmits incoming audio through the synthesis chain. The incoming audio is selected by the operating system.

FilePlayer will play a file (even from the web!) into the synthesis stream. It can be looped and paused as desired.

Sampler is typically used to load a short audio file into memory and then "trigger" it to play the sound. Before triggering the sound you can set the inputs to control the section of the sample to play, the amplitude, the duration of the fade in of the sound (attack), and the playback rate.

Vocoder is a very simple vocoding effect (http://en.wikipedia.org/wiki/Vocoder) that provides an audio and a modulator input.

Effects

The Delay UGen repeats a delayed version of the incoming signal.

The Pan UGen takes a mono signal and specifies a stereo position for that signal.

The Balance UGen attenuates the left or right channel of stereo signal.

The Gain attenuates or amplifies the incoming signal. Gain is expressed in dB.

BitCrush reduces the bit resolution of the incoming signal.

WaveShaper uses the incoming signal as the index to another wave. This is a standard form of waveform synthesis and Wikipedia has a good article about it.

MoogFilter is a digital model of the analog filter found on Moog synthesizers. It can be configured to be either low pass, band pass, or high pass.

Flanger is a special kind of tight delay that has modulation of the delay time built into the algorithm.

Envelopes

Envelopes are generally used to control the amplitude or another aspect of the sound during the playback of a note. A more detailed discussion of the usage of envelopes will follow in the Instruments section.

The Line Ugen outputs a value which changes from a specified beginning value to an ending value over a specified time.

The ADSR UGen produces an attack-decay-sustain-release envelope.

The Damp UGen produces an attack-decay envelope.

The GranulateSteady UGen produces steady length granular-synthesis grains from the input signal.

The GranulateRandom UGen produces random length granular-synthesis grains from the input signal. At this time, the grains for both GranulateSteady and GranulateRandom have a linear fade in and out.

The Oscil UGen can also be used as an envelope if the frequency is set so the period of the wave is about the duration of the note.

Math

Due to our decision to use the patching mechanism to connect synthesis chains, it's unfortunately not simple to do math with the sample frames being passed along the synthesis chains. We had to implement math directly as UGens.

The Constant UGen generates a constant value as a signal.

The Summer UGen adds (sums) all incoming inputs.

The Multiplier UGen multiplies an incoming signal by an amplitude.

The Reciprocal UGen generates the reciprocal of the incoming signal. This can be useful when, for example, building a physical modeling instrument which is based on the length of a tube.

The Midi2Hz UGen generates the equivalent frequency in Hertz for an incoming signal given as a MIDI note number. The MIDI note number does not need to be an integer. This permits changes in pitch which are musical in nature.

The Abs UGen outputs the absolute value of the incoming signal.

Utility

The Bypass UGen can be used to "wrap" another UGen, enabling you to route audio around it without having to unpatch anything.

The EnvelopeFollower UGen will analyze the incoming signal and output a value that represents the strength of that signal.

The TickRate UGen can be used to slow down or speed up the rate at which a UGen generates.

The Sink UGen is similar to a Summer in that it can have many UGens patched to it, but it will not produce any sound, instead simply ticking everything that is patched to it and discarding the audio.

@libname Minim UGens @indexname index_ugens