SplineGen:
Filter:
splines/Classes (extension) | Splines | UGens > Generators

SplineGen
ExtensionExtension

Like EnvGen but for Splines

Description

Plays a spline along one dimension for use in automation and control rate modulation. This is the equivalent of EnvGen

This technique interpolates the spline along one dimension (usually X) producing values for Y that are then passed to a LocalBuf and embeded in the SynthDef and played with a BufRd.

A SplineInterpolator class is planned that will allow live updating from the gui to a buffer on the server. At present I am using SplineFr (frame rate device) and playing the spline in the language, messaging control changes to the server. This allows relocating and live editing and patching. The cost is more communication with the server. I run it at 24/fps.

Class Methods

.new

Arguments:

spline

any Spline subclass.

dimension

The dimension that represents time. Usually 0

loop

boolean: can loop the control back to the beginning

Returns:

(returnvalue)

Instance Methods

.spline

get/set spline

Returns:

(returnvalue)

.dimension

get/set the dimension that represents time. Usually 0. The value dimension is then considered to be 1.

Returns:

Integer

.loop

get/set loop

Returns:

Boolean

.storeArgs

(describe method here)

Returns:

(returnvalue)

.duration

Total time length of the spline. Using the default values for the play methods kr etc. then time will be in seconds.

Returns:

float

.asLocalBuf

Returns a LocalBuf with the spline as an interpolated lookup table. Must be called from within a SynthDef

Arguments:

divisions

Number of interpolated values in the Buffer.

Returns:

a LocalBuf

.kr

Like EnvGen.kr(env), this plays the spline.

Arguments:

timeScale

If timeScale is tempo then the x values are beats. eg. Tempo.tempo

doneAction

Like EnvGen etc.

divisions

Total number of points in the interpolation

Returns:

control rate (a BufRd.kr)

.readKr

Plays the spline with a modulatable position input.

Arguments:

position

kr modulator in X units (seconds)

timeScale

Default 1.0 means that x units are seconds. If timeScale is tempo (bps) then the x values are beats. eg. Tempo.tempo

divisions

Total number of points in the interpolation

Returns:

control rate (a BufRd.kr)

.xyKr

Returns an array of kr following each dimension. Returns as many dimensions as your spline have, not just xy as the name implies.

Time is the path along the spine of the spline. The total tangent length along spline could be summed to figure out the length of time needed for one oscillation, but that would only be calculatable if it is 2 dimensions. So just crank the speed up until you like it.

Arguments:

speed

float. how fast. range ? that depends

divisions

Total number of points in the interpolation

rate

'kr' or 'ar' see also SplineOsc

Returns:

control or audio rate BufRd

Examples