CtkSynthDef:
Filter:
Classes (extension) | Libraries > CTK

CtkSynthDef : CtkNoteObject : Object
ExtensionExtension

A note prototyping system using a CtkNoteObject created from a SynthDef
Source: CTK.sc
 

Description

Part of the Composer's Tool Kit (CTK) system. See CTK for more details.

CtkSynthDef and CtkProtoNotes are the two prototyping classes for creating instances of CtkNote. CtkSynthDef wraps a SynthDef inside a CtkNoteObject.

With CtkSynthDef one creates separate objects for individual SynthDefs, while with CtkProtoNotes one creates a single object storing a group of SynthDefs, accessed by their name.

CtkSynthDef is created similarly to a regular SynthDef, but you don't need to call .load or .send on it.

Class Methods

CtkSynthDef.new(name, ugenGraphFunc, rates, prependArgs, variants)

Create a new instance of a CtkSyntDef.

Arguments:

name

A String or Symbol (i.e. "name" or \name). This name should be unique.

ugenGraphFunc

An instance of Function specifying how the def's UGens are interconnected. See SynthDef for more information.

rates

An optional Array of specifications for the ugenGraphFunc's arguments. The order corresponds to the order of arguments. See the examples below to see how these are used.

A specification can be:

nil/zero
A standard control rate Control is created.
\ar
An audio rate AudioControl is created.
a float
the Control will have a lag of the specified time. This can be used to create smooth transitions between different values. t_ and i_ args cannot be lagged.
\ir
The Control can be set only at creation ('initial rate'). See discussion above.
\tr
The Control is used as a trigger. See discussion above.
prependArgs

An optional Array of objects which will be passed as the first arguments to the ugenGraphFunc when it is evaluated. Arguments which receive values in this way will not be converted to instances of Control. See the wrap example below for an example of how this can be used.

variants

An optional Event containing default argument settings. These can override the defaults specified in the ugenGraphFunc. When creating a Synth a variant can be requested by appending the defName argument in the form 'name.variant' or "name.variant". See example below.

Discussion:

Intended use:

Inherited class methods

Instance Methods

.note(starttime: 0.0, duration, addAction: 0, target: 1, server)

From superclass: CtkNoteObject

This is the default usage. Create a new instance of CtkNote based on the SynthDef contained in this instances of CtkNoteObject. See the CtkNote helpfile for more information and examples.

Arguments:

starttime

In non-real-time or CtkScore rendering mode, the starttime of an CtkNote event. In real-time mode, this parameter will schedule the event for starttime seconds in the future.

duration

If not nil, schedules the release of an CtkNote (works in both real-time and non-real-time)

addAction

A symbol (\head, \tail, \before, \after or \replace) or an addAction id (see Server Command Reference: /s_new for a more in-depth description)

target

A node ID (synth or group) or an instance of CtkGroup or CtkNote

server

the server to execute the node on. Defaults to Server.default for real-time performance

Returns:

.args(post: true)

From superclass: CtkNoteObject

get a list of controls and defaults

Arguments:

post

if 'post' is true, post a list of controls and defaults to the post window.

Returns:

The Dictionary containing the argument names as keys and default values.

Inherited instance methods

Examples