AlgaPattern:
Filter:
AlgaLib/Classes (extension) | Alga

AlgaPattern
ExtensionExtension

Alga module representing multiple instances of sonic processes

Description

An AlgaPattern is the polyphonic counterpart of an AlgaNode. All the basic concepts that define AlgaNodes also apply to AlgaPatterns. However, AlgaPatterns also support Patterns as modifiers for their parameters.

It is highly suggested to look into the Examples folder for more advanced usage of AlgaPatterns.

Class Methods

.new

Create a new AlgaPattern.

Arguments:

def

Mandatory argument. It accepts either a UGen function, a symbol to lookup a defined AlgaSynthDef or an Event describing the pattern.

interpTime

Specify the interpolation time it takes whenever making a new connection to any parameter of this AlgaPattern.

interpShape

Specify the interpolation shape that is to be used to perform new connections. This must be defined with an Env that always starts at 0 and ends at 1. If not specified, a single ramp Env([0, 1], 1) is used by default.

playTime

Specify the fading in / fading out time that it takes for this AlgaPattern to play through speakers. These values are applied when calling the play or stop functions.

playSafety

Specify a different safety method to use to scale the output of a node when using the play method. Accepted values are: 'clip', 'tanh', 'softclip', 'limiter', 'none'.

sched

Just like any other AlgaPattern method, the current function can be scheduled at specific times in the future, according to the clock that the Alga instance booted on the server is using.

start

Start the AlgaPattern when created. This will be started at the specified sched.

schedInSeconds

Specify if all sched actions should be scheduled in seconds, opposing to beats. Default is false.

tempoScaling

Specify if all timed actions should be scaled by the clock's tempo. Default is false.

sampleAccurateFuncs

Set if the Functions used in the 'def' parameter should be sample accurate or not. Defaults to true.

player

Set an instance of a AlgaPatternPlayer that will be used to trigger the pattern.

server

Specify a Server to instantiated the AlgaPattern on. This Server must have had Alga booted on it. It defaults to Server.default.

Instance Methods

.advance

Advance the AlgaPattern manually.

Arguments:

sched

Schedule the triggering at a specific time.

.step

Alias for advance.

.value

Alias for advance.

.stopPattern

Stop the AlgaPattern.

Arguments:

sched

Schedule at a specific time.

.stopP

Alias for stopPattern.

.playPattern

Play the AlgaPattern.

Arguments:

sched

Schedule at a specific time.

.playP

Alias for playPattern.

.restartPattern

Restart the AlgaPattern, resetting the entries.

Arguments:

sched

Schedule at a specific time.

.restartP

Alias for restartPattern.

.restartPattern

Reset the entries of the AlgaPattern.

Arguments:

sched

Schedule at a specific time.

.resetP

Alias for restartPattern.

.interpolateDur

Manually trigger the interpolation of the 'dur' parameter. This can also be achieved with the standard from method, but interpolateDur also accepts a different set of arguments that are specific to this kind of interpolation.

Arguments:

value

The new value to use.

time

The time that it takes for the interpolation to complete.

shape

An Env that optionally allows you to define a specific shape for the interpolation.

resync

Specify if the pattern should be re-synced to the clock after the interpolation is completed. This option can also be permanently turned on with the durInterpResync method.

reset

Specify if the pattern entry should be reset (restart) from the first value. This option can also be permanently turned on with the durInterpReset method.

sched

Specify when the interpolation process should start. This can also be set with the schedResync method.

Discussion:

.interpDur

Alias for interpolateDur.

.interpolateDelta

Alias for interpolateDur.

.interpDelta

Alias for interpolateDur.

.interpolateStretch

Like interpolateDur, but setting the 'stretch' parameter.

.interpStretch

Alias for interpolateStretch.

.interpolateSustain

Like interpolateDur, but setting the 'sustain' parameter.

.interpSus

Alias for interpolateSustain.

.interpolateLegato

Like interpolateDur, but setting the 'legato' parameter.

.interpLegato

Alias for interpolateLegato.

.resync

Resync the pattern to its clock.

.useMultiChannelExpansion

Set if the AlgaPattern should treat multi channel expansion like an AlgaNode or not.

.multiChannelExpansion

Alias for useMultiChannelExpansion.

.mc

Alias for useMultiChannelExpansion.

.replaceDur

Set if replace should be executed when changing the 'dur' parameter.

.stopPatternBeforeReplace

Set the mode for how replace should be executed. If true (default), the pattern will be stopped before the replace happens. If false, the pattern will only be stopped after the entire replace has happened. This case allows to perform both the fade in and fade out stages of the replace.

.schedSustainInSeconds

Set if the 'sustain' parameter should be scheduled in seconds. If false (default), it will be scheduled using the AlgaPattern's clock, whose tempo could be scaled.

.sustainToDur

Set if the 'dur' parameter should be added to the 'sustain' one. Basically, this permits to scale the 'sustain' according to 'dur'.

.sampleAccurateFuncs

Set if the Functions used in the 'def' parameter should be sample accurate or not. Defaults to true.

.schedResync

Set the default sched value for interpolateDur (and accompanying functions).

.durInterpResync

Set if interpolateDur (and accompanying functions) should resync by default.

.durResync

Alias for durInterpResync.

.durInterpReset

Set if interpolateDur (and accompanying functions) should reset by default.

.durReset

Alias for durInterpReset.

Examples