Skip to content

Cluster

Documentation for std-library/nodes/components/cluster.ksp

Import

import "_IVLS/std-library/nodes/components/cluster.ksp"

Node: Stl.Cluster

Uses: Init, UIOpen, UIClose, LCB, KRCB

API

Nodes

Name Description
node Stl.Cluster Generic cluster dispatcher node for all registered cluster types.

Const Blocks

Name Description
const cluster.nature Enumeration of cluster synchrony modes: SYNC and ASYNC. (2 entries)
const cluster.tasks Enumeration of all registered cluster task types, generated from the CLUSTER_TAB...

Macros

Name Description
cluster.Create(#cluster#, #id#) Declares all persistent state for a cluster type and initializes its task queue.
cluster.Dump(#cluster#, #ref#) Dumps all field values of a cluster instance to the message log.
cluster.DumpSelf(#cluster#) Dumps the field values of the current cluster instance (self) to the message log.
cluster.Exit Deletes the current cluster instance and exits the callback immediately.
cluster.id_case_select(#cluster#) Generates a select-case branch for a cluster type that pops and processes the ne...
cluster.SubFunctions(#cluster#) Generates all runtime functions for a cluster type, including queue operations a...
cluster.Validate(#cluster#, #member#) Validates a single member field of a cluster instance and sets self_invalid if t...

Functions

Name Description
#cluster#.push(ref) Pushes a cluster instance reference onto the cluster type's dispatch queue.

Task Functions

Name Description
cluster.tick() Dispatches one blip note per pending task across all registered cluster task typ...

Stl.Cluster

node Stl.Cluster

Callbacks: Init, UIOpen, UIClose, LCB, KRCB

Generic cluster dispatcher node for all registered cluster types.


const cluster.nature

Enumeration of cluster synchrony modes: SYNC and ASYNC.

Index Name
0 SYNC
1 ASYNC

const cluster.tasks

Enumeration of all registered cluster task types, generated from the CLUSTER_TABLE.


cluster.tick()

Dispatches one blip note per pending task across all registered cluster task types.


cluster.id_case_select(#cluster#)

Generates a select-case branch for a cluster type that pops and processes the next queued task.

Parameter Description
#cluster# The cluster type name used to access its queue and task slot

cluster.Create(#cluster#, #id#)

Declares all persistent state for a cluster type and initializes its task queue.

Parameter Description
#cluster# The cluster type name to create state for
#id# The numeric identifier assigned to this cluster type

Side effects:

Name Type Purpose
cluster.#cluster#.poly integer Polyphonic slot for per-voice cluster reference
cluster.#cluster# integer Polyphonic storage for the cluster instance reference
#cluster#.running integer Flag indicating whether a task of this type is currently running
#cluster#.i integer General-purpose iteration variable for this cluster type
@#cluster#.dump string String buffer used for diagnostic dump output
#cluster#.run_count integer Counter tracking how many times this cluster type has run

cluster.SubFunctions(#cluster#)

Generates all runtime functions for a cluster type, including queue operations and the task dispatcher.

Parameter Description
#cluster# The cluster type name to generate sub-functions for

Side effects:

Name Type Purpose
self integer Reference to the cluster instance being processed (set from the dispatched ref)
self_invalid integer Flag set to TRUE if any member validation fails for the current instance
self_auto_delete integer Flag controlling whether the instance is deleted after the callback returns

#cluster#.push(ref)

Pushes a cluster instance reference onto the cluster type's dispatch queue.

Parameter Description
ref The cluster instance reference to enqueue for processing

cluster.Validate(#cluster#, #member#)

Validates a single member field of a cluster instance and sets self_invalid if the value fails validation.

Parameter Description
#cluster# The cluster type name whose validator function is called
#member# The field name on the cluster instance to validate

cluster.Exit

Deletes the current cluster instance and exits the callback immediately. Only valid inside a cluster CB.


cluster.DumpSelf(#cluster#)

Dumps the field values of the current cluster instance (self) to the message log. Only valid inside a cluster CB.

Parameter Description
#cluster# The cluster type name whose self instance fields are dumped

cluster.Dump(#cluster#, #ref#)

Dumps all field values of a cluster instance to the message log.

Parameter Description
#cluster# The cluster type name whose field metadata is used
#ref# The cluster instance reference whose field values are printed

Example

// TODO: Add usage example

See Also