/  Advanced Unit Generators

LiSa

LiSa2

LiSa6

LiSa8

LiSa10

LiSa16

GenX

Gen5

Gen7

Gen9

Gen10

Gen17

CurveTable

WarpTable

Dyno

Advanced and specialty unit generators

LiSa

inherits : UGen : Object

LiSa provides basic live sampling functionality, and is also often used for granular synthesis. An internal buffer stores samples chucked to LiSa's input. Segments of this buffer can be played back, with ramping and speed/direction control. Multiple voice facility is built in, allowing for a single LiSa object to serve as a source for sample layering and granular textures. by Dan Trueman (2007) See also: a slowly growing tutorial | LiSa examples in the ChucK distribution | video tutorial by Clint Hoagland.

examples

constructors

LiSa()

Default constructor for LiSa.

member functions

int bi(int voice, int val)

For particular voice (arg 1), turn on/off bidirectional playback.

int bi(int val)

For particular voice (arg 1), get bidirectional playback status.

int bi()

Get birectional playback status.

void clear()

Clear recording buffer.

dur duration(dur val)

Set buffer size; required to allocate memory, also resets all parameter values to default.

dur duration()

Get buffer size.

float feedback(float val)

Set feedback amount when overdubbing (loop recording; how much to retain).

float feedback()

Get feedback amount when overdubbing (loop recording; how much to retain).

int getVoice()

Return an available voice (one that is not currently playing). Return -1 if no voice is available.

int getbi(int voice)

Turn on/off bidirectional playback (voice 0).

int loop0(int val)

Turn on/off looping (voice 0).

int loop0()

Get looping status (voice 0).

int loop(int voice, int val)

For particular voice (arg 1), turn on/off looping.

int loop(int voice)

For particular voice (arg 1), get looping status.

dur loopEnd(int voice, dur val)

For particular voice (arg 1), set loop ending point for playback. only applicable when .loop(voice, 1).

dur loopEnd(int voice)

For particular voice (arg 1), get loop ending point for playback. only applicable when .loop(voice, 1).

dur loopEnd(dur val)

Set loop ending point for playback (voice 0). only applicable when 1 => loop.

dur loopEnd()

Get loop ending point for playback (voice 0). only applicable when 1 => loop.

dur loopEndRec(dur val)

Set end point in buffer for loop recording.

dur loopEndRec()

Get end point in buffer for loop recording.

int loopRec(int val)

Turn on/off loop recording.

int loopRec()

Get loop recording status.

dur loopStart(int voice, dur val)

For particular voice (arg 1), set loop starting point for playback. only applicable when .loop(voice, 1).

dur loopStart(int voice)

For particular voice (arg 1), get loop starting point for playback. only applicable when .loop(voice, 1).

dur loopStart(dur val)

Set loop starting point for playback (voice 0). only applicable when 1 => loop.

dur loopStart()

Get loop starting point for playback (voice 0). only applicable when 1 => loop.

int maxVoices(int val)

Set the maximum number of voices allowable; 10 by default (256 is the current hardwired internal limit).

int maxVoices()

Get the maximum number of voices allowable; 10 by default (256 is the current hardwired internal limit).

float pan(int voice, float val)

For particular voice (arg 1), set panning value [0.0, number of channels - 1.0].

float pan(int voice)

For particular voice (arg 1), get panning value.

float pan(float val)

For voice 0, set panning value [0.0, number of channels - 1.0].

float pan()

For voice 0, get panning value.

int play(int voice, int toggle)

For particular voice (arg 1), turn on/off sample playback.

int play(int toggle)

Turn on/off sample playback (voice 0)

dur playPos(int voice, dur val)

For particular voice (arg 1), set playback position.

dur playPos(int voice)

For particular voice (arg 1), get playback position.

dur playPos(dur val)

Set playback position (voice 0).

dur playPos()

Get playback position (voice 0).

int playing(int val)

Get playing status.

void rampDown(int voice, dur val)

For particular voice (arg 1), turn off sample playback, with ramp.

void rampDown(dur val)

Turn off sample playback, with ramp (voice 0).

void rampUp(int voice, dur val)

For particular voice (arg 1), turn on sample playback, with ramp.

void rampUp(dur val)

Turn on sample playback, with ramp (voice 0).

float rate(int voice, float val)

For particular voice (arg 1), set playback rate.

float rate(int voice)

For particular voice (arg 1), get playback rate.

float rate(float val)

Set playback rate (voice 0). Note that the int/float type for this method will determine whether the rate is being set (float, for voice 0) or read (int, for voice number).

float rate()

Get playback rate (voice 0).

dur recPos(dur val)

Set record position.

dur recPos()

Get record position.

dur recRamp(dur val)

Set ramping when recording (from 0 to loopEndRec).

int record(int toggle)

Turn recording on and off.

int sync(int val)

Set input mode; (0) input is recorded to internal buffer, (1) input sets playback position [0,1] (phase value between loopStart and loopEnd for all active voices), (2) input sets playback position, interpreted as a time value in samples (only works with voice 0)

int sync()

Get input mode; (0) input is recorded to internal buffer, (1) input sets playback position [0,1] (phase value between loopStart and loopEnd for all active voices), (2) input sets playback position, interpreted as a time value in samples (only works with voice 0)

int track(int val)

Identical to sync.

int track()

Identical to sync.

dur value(int voice, dur val)

For particular voice (arg 1), get value from the voice.

dur value(dur val)

Get value from voice 0.

float valueAt(float val, dur index)

Set value directly in record buffer.

float valueAt(dur index)

Get value directly from record buffer.

float voiceGain(int voice, float val)

For particular voice (arg 1), set gain.

float voiceGain(int voice)

Set playback gain (voice 0).

float voicePan(int voice, float val)

For particular voice (arg 1), set panning value [0.0, number of channels - 1.0].

float voicePan(int voice)

For particular voice (arg 1), get panning value.


LiSa2

inherits : LiSa : UGen : Object

A (li)ve (sa)mpling unit generator (stereo edition); also popularly used for granular synthesis.

examples

constructors

LiSa2()

Default constructor for LiSa2.


LiSa6

inherits : LiSa : UGen : Object

A (li)ve (sa)mpling unit generator (6-channel edition); also popularly used for granular synthesis.

constructors

LiSa6()

Default constructor for LiSa6.


LiSa8

inherits : LiSa : UGen : Object

A (li)ve (sa)mpling unit generator (8-channel edition); also popularly used for granular synthesis.

constructors

LiSa8()

Default constructor for LiSa8.


LiSa10

inherits : LiSa : UGen : Object

A (li)ve (sa)mpling unit generator (10-channel edition); also popularly used for granular synthesis.

constructors

LiSa10()

Default constructor for LiSa10.


LiSa16

inherits : LiSa : UGen : Object

A (li)ve (sa)mpling unit generator (16-channel edition); also popularly used for granular synthesis.

constructors

LiSa16()

Default constructor for LiSa16.


GenX

inherits : UGen : Object

Ported from rtcmix. See makegens documentation for more information on the GenX family of UGens. Currently coefficients past the 100th are ignored. Lookup can either be done using the lookup() function, or by driving the table with an input UGen, typically a Phasor. For an input signal between [ -1, 1 ], using the absolute value for [ -1, 0 ), GenX will output the table value indexed by the current input.

examples

constructors

GenX()

Default constructor for GenX.

member functions

float[] coefs(float[] v)

Set lookup table coefficients; meaning is dependent on subclass.

float lookup(float which)

Get lookup table value at index i [ -1, 1 ]; absolute value is used in the range [ -1, 0 )


Gen5

inherits : GenX : UGen : Object

Constructs a lookup table composed of sequential exponential curves. For a table with N curves, starting value of y', and value yn for lookup index xn, set the coefficients to [ y', y0, x0, ..., yN-1, xN-1 ]. Note that there must be an odd number of coefficients. If an even number of coefficients is specified, behavior is undefined. The sum of xn for 0 ≤ n < N must be 1. yn = 0 is approximated as 0.000001 to avoid strange results arising from the nature of exponential curves.

examples

constructors

Gen5()

Default constructor for Gen5.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


Gen7

inherits : GenX : UGen : Object

Constructs a lookup table composed of sequential line segments. For a table with N lines, starting value of y', and value yn for lookupindex xn, set the coefficients to [ y', y0, x0, ..., yN-1, xN-1 ]. Note that there must be an odd number of coefficients. If an even number of coefficients is specified, behavior is undefined. The sum of xn for 0 ≤ n < N must be 1.

examples

constructors

Gen7()

Default constructor for Gen7.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


Gen9

inherits : GenX : UGen : Object

Constructs a lookup table of partials with specified amplitudes, phases, and harmonic ratios to the fundamental. Coefficients are specified in triplets of [ ratio, amplitude, phase ] arranged in a single linear array.

examples

constructors

Gen9()

Default constructor for Gen9.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


Gen10

inherits : GenX : UGen : Object

Constructs a lookup table of harmonic partials with specified amplitudes. The amplitude of partial n is specified by the nth element of the coefficients. For example, setting coefs to [ 1 ] will produce a sine wave.

examples

constructors

Gen10()

Default constructor for Gen10.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


Gen17

inherits : GenX : UGen : Object

Constructs a Chebyshev polynomial wavetable with harmonic partials of specified weights. The weight of partial n is specified by the nth element of the coefficients. Primarily used for waveshaping, driven by a SinOsc instead of a Phasor. See http://crca.ucsd.edu/~msp/techniques/v0.08/book-html/node74.html and http://en.wikipedia.org/wiki/Distortion_synthesis for more information.

examples

constructors

Gen17()

Default constructor for Gen17.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


CurveTable

inherits : GenX : UGen : Object

Constructs a wavetable composed of segments of variable times, values, and curvatures. Coefficients are specified as a single linear array of triplets of [ time, value, curvature ] followed by a final duple of [ time, value ] to specify the final value of the table. time values are expressed in unitless, ascending values. For curvature equal to 0, the segment is a line; for curvature less than 0, the segment is a convex curve; for curvature greater than 0, the segment is a concave curve.

examples

constructors

CurveTable()

Default constructor for CurveTable.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


WarpTable

inherits : GenX : UGen : Object

An end-constrained mapping table, mostly useful for conditioning control signals.

examples

constructors

WarpTable()

Default constructor for WarpTable.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


Dyno

inherits : UGen : Object

A dynamics processor. Includes presets for limiter, compressor, expander, noise gate, and ducker.

examples

constructors

Dyno()

Default constructor for Dyno.

member functions

dur attackTime(dur aTime)

Set duration for the envelope to move linearly from current value to the absolute value of the signal's amplitude.

dur attackTime()

Get duration for the envelope to move linearly from current value to the absolute value of the signal's amplitude.

void compress()

Set parameters to default compressor values: slopeAbove = 0.5, slopeBelow = 1.0, thresh = 0.5, attackTime = 5 ms, releaseTime = 500 ms, externalSideInput = 0 (false)

void duck()

Set parameters to default ducker values: slopeAbove = 0.5, slopeBelow = 1.0, thresh = 0.5, attackTime = 10 ms, releaseTime = 1000 ms, externalSideInput = 1 (true)

void expand()

Set parameters to default expander values: slopeAbove = 2.0, slopeBelow = 1.0, thresh = 0.5, attackTime = 20 ms, releaseTime = 400 ms, externalSideInput = 0 (false)

int externalSideInput(int externalSideInput)

Set to true to cue the amplitude envelope off sideInput instead of the input signal. Note that this means you will need to manually set sideInput every so often.

int externalSideInput()

Get externalSideInput state. If set to true, the amplitude envelope will be cued off sideInput instead of the input signal. Note that this means you will need to manually set sideInput every so often.

void gate()

Set parameters to default noise gate values: slopeAbove = 1.0, slopeBelow = 1.0E08, thresh = 0.1, attackTime = 11 ms, releaseTime = 100 ms, externalSideInput = 0 (false)

void limit()

Set parameters to default limiter values: slopeAbove = 0.1, slopeBelow = 1.0, thresh = 0.5, attackTime = 5 ms, releaseTime = 300 ms, externalSideInput = 0 (false)

float ratio(float ratio)

An alternate way of setting slopeAbove and slopeBelow; sets slopeBelow to 1.0 and slopeAbove to 1.0 / ratio.

float ratio()

Get the ratio set by .ratio(float); slopeBelow to 1.0 and slopeAbove to 1.0 / ratio.

dur releaseTime(dur rTime)

Set duration for the envelope to decay down to around 1/10 of its current amplitude, if not brought back up by the signal.

dur releaseTime()

Get duration for the envelope to decay down to around 1/10 of its current amplitude, if not brought back up by the signal.

float sideInput(float sideInput)

If externalSideInput is set to true, replace the signal being processed as the input to the amplitude envelope.

float sideInput()

If externalSideInput is set to true, replaces the signal being processed as the input to the amplitude envelope.

float slopeAbove(float slopeAbove)

Set the slope of the output gain vs the input envelope's level when the envelope is above thresh.

float slopeAbove()

Get the slope of the output gain vs the input envelope's level when the envelope is above thresh.

float slopeBelow(float slopeBelow)

Set the slope of the output gain vs the input envelope's level when the envelope is below thresh.

float slopeBelow()

Get the slope of the output gain vs the input envelope's level when the envelope is below thresh.

float thresh(float thresh)

Set threshold, above which to stop using slopeBelow and start using slopeAbove to determine output gain vs input gain.

float thresh()

Get threshold, above which to stop using slopeBelow and start using slopeAbove to determine output gain vs input gain.