ChucK Class Library Reference

Advanced Unit Generators

LiSa

LiSa10

GenX

Gen5

Gen7

Gen9

Gen10

Gen17

CurveTable

WarpTable

CNoise

Dyno

LiSa

: UGen : Object

LiSa provides basic live sampling functionality. 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)

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 loop(int voice, int val)

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

int loop(int voice)

Turn on/off looping (voice 0).

int loop(int val)

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

int loop()

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 (200 is the current hardwired internal limit).

int maxVoices()

Get the maximum number of voices allowable; 10 by default (200 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)

Set panning value [0.0, number of channels - 1.0].

float pan()

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.


LiSa10

: LiSa : UGen : Object

No description available


GenX

: UGen : Object

Ported from rtcmix. See http://www.music.columbia.edu/cmix/makegens.html 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.

member functions

float[] coefs(float[] v)

Set lookup table coefficients. Meaning is dependent on subclass.

float lookup(float which)

Returns lookup table value at index i [ -1, 1 ]. Absolute value is used in the range [ -1, 0 ).


Gen5

: 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.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


Gen7

: 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.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


Gen9

: 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.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


Gen10

: 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.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


Gen17

: 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.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


CurveTable

: 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.

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


WarpTable

: GenX : UGen : Object

No description available

member functions

float[] coefs(float[] v)

Set lookup table coefficients.


CNoise

: UGen : Object

Noise generator with multiple noise synthesis modes.

member functions

float fprob(float fprob)

Probability [0-1] used for calculating XOR noise.

string mode(string mode)

Noise synthesis mode. Supported modes are "white", "pink", "flip", and "xor".


Dyno

: UGen : Object

Dynamics processor. Includes limiter, compressor, expander, noise gate, and ducker presets.

examples

member functions

dur attackTime(dur aTime)

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

dur attackTime()

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.

void duck()

Set parameters ot default ducker values.

void expand()

Set parameters to default expander values.

int externalSideInput(int externalSideInput)

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

int externalSideInput()

Set to true to cue the amplitude envelope off of 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.

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)

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

float ratio()

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

dur releaseTime(dur rTime)

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()

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, replaces 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)

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

float slopeAbove()

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

float slopeBelow(float slopeBelow)

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

float slopeBelow()

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

float thresh(float thresh)

Threshold above which to stop using slopeBelow and start using slopeAbove to determine output gain vs input gain.

float thresh()

Threshold above which to stop using slopeBelow and start using slopeAbove to determine output gain vs input gain.