NamedControl:
Filter:
Classes | UGens > Synth control

NamedControl : Object

Named reference to a control

Description

A NamedControl directly combines a ControlName and a Control UGen conveniently. Also this makes it safe even if several identical controls exist (see example below).

There are syntax shortcuts that generate NamedControls from the name:

Class Methods

NamedControl.ar(name, values, lags, spec)

add a new instance of AudioControl with given name and default values. If lags are given, apply a Lag UGen to it.

Discussion:

\symbol.ar(values, lags, spec) is a synonym.

NamedControl.kr(name, values, lags, fixedLag: false, spec)

add a new instance of Control (kr) with given name and default values. If lags are given, apply a Lag UGen to it. If fixedLag is set to true, create a LagControl(lags cannot be modulated then, but fewer UGens are required).

Discussion:

\symbol.kr(values, lags, fixedLag, spec) is a synonym.

NamedControl.ir(name, values, lags, spec)

add a new instance of Control (ir) with given name and default values. If lags are given, apply a Lag UGen to it.

Discussion:

\symbol.ir(values, lags, spec) is a synonym.

NamedControl.tr(name, values, lags, spec)

add a new instance of TrigControl with given name and default values. If lags are given, apply a Lag UGen to it.

Discussion:

\symbol.tr(values, lags, spec) is a synonym.

NamedControl.new(name, values, rate, lags, fixedLag: false, spec)

add a new instance with the given rate, name and default values. If lags are given, apply a Lag UGen to it. If fixedLag is set to true, create a LagControl(lags cannot be modulated then, but fewer UGens are required).

Inherited class methods

Undocumented class methods

NamedControl.initDict

Instance Methods

Inherited instance methods

Undocumented instance methods

.control

.fixedLag

.lags

.name

.rate

.spec

.spec = spec

.values

Examples

Comparison with direct use of Controls

In the situation when functions are used to combine UGens to more complex SynthDefs, it may not be known which ControlNames are already taken by others. NamedControl allows to reuse existing control names.

Using dictionary with functions to build SynthDefs

Here is a basic example using a dictionary with functions that can be combined to build SynthDefs.