Skip to content

Runtimes

Runtime / Ivls.Runtimes

Import

import "_IVLS/source/nodes/Runtimes.ksp"

Node: Ivls.Runtimes

Uses: Init

Overview

Runtime / Ivls.Runtimes

LIBRARY MODULE

Voice runtime management for IVLS.

  • Runtime ADT: FIFO-backed container for grouping voices independently of the parent-child hierarchy
  • Lifecycle: ivls.create_runtime, ivls.release_runtime, ivls.runtime.destruct
  • Voice assignment: ivls.add_voice_to_runtime, ivls.remove_voice_from_runtime (sync and ICB variants)

API

Nodes

Name Description
node Ivls.Runtimes Node that manages the lifecycle of Runtime objects.

Defines

Name Description
define MAX_RUNTIMES Maximum number of concurrent Runtime objects supported by the pool.
define Runtime.MEMBERS List of member field names that define the Runtime struct layout.

Macros

Name Description
Runtime.Constructor(ref) Constructs a new Runtime instance.
Runtime.def Defines the Runtime ADT member layout and default initializer values.
Runtime.Destructor(ref) Destroys a Runtime instance.

Functions

Name Description
ivls.add_voice_to_runtime(r, vo) Assigns a voice to a Runtime (synchronous call context).
ivls.add_voice_to_runtime.ICB(r, vo) Assigns a voice to a Runtime (ICB-safe variant).
ivls.add_voice_to_runtime.internal() Adds the staged voice to the staged runtime's FIFO and disables auto-release on ...
ivls.create_runtime() -> result Allocates a new Runtime object and returns its reference.
ivls.release_runtime(r) Releases a Runtime object, invoking its destructor and freeing its slot.
ivls.remove_voice_from_runtime(vo) Removes a voice from its current Runtime (synchronous call context).
ivls.remove_voice_from_runtime.ICB(vo) Removes a voice from its current Runtime (ICB-safe variant).
ivls.remove_voice_from_runtime.internal() Removes the staged voice's entry from its runtime's FIFO.
ivls.runtime.destruct(r) Releases all voices in a Runtime and frees its internal FIFO.
ivls.runtime.release_voices(r) Iterates through every voice in the runtime's FIFO list and releases each one vi...

Nodes

node Ivls.Runtimes

Callbacks: Init

Node that manages the lifecycle of Runtime objects.


Defines

define MAX_RUNTIMES

Maximum number of concurrent Runtime objects supported by the pool.


define Runtime.MEMBERS

List of member field names that define the Runtime struct layout.


Macros

Runtime.Constructor(ref)

Constructs a new Runtime instance.

Parameter Description
ref Runtime reference slot being initialised

Runtime.def

Defines the Runtime ADT member layout and default initializer values.


Runtime.Destructor(ref)

Destroys a Runtime instance.

Parameter Description
ref Runtime reference to destroy

Functions

ivls.add_voice_to_runtime(r, vo)

Assigns a voice to a Runtime (synchronous call context).

Parameter Type Description
r integer Runtime reference to add the voice to
vo integer Voice reference to assign

Side effects:

Name Type Purpose
ivls.add_voice_to_runtime.r integer Global staging variable for the Runtime reference
ivls.add_voice_to_runtime.vo integer Global staging variable for the Voice reference

ivls.add_voice_to_runtime.ICB(r, vo)

Assigns a voice to a Runtime (ICB-safe variant).

Parameter Type Description
r integer Runtime reference to add the voice to
vo integer Voice reference to assign

Side effects:

Name Type Purpose
ivls.add_voice_to_runtime.r integer Global staging variable for the Runtime reference
ivls.add_voice_to_runtime.vo integer Global staging variable for the Voice reference

ivls.add_voice_to_runtime.internal()

Adds the staged voice to the staged runtime's FIFO and disables auto-release on the voice.

Side effects:

Name Type Purpose
ivls.add_voice_to_runtime.r integer Staged Runtime reference (input)
ivls.add_voice_to_runtime.vo integer Staged Voice reference (input)

ivls.create_runtime() -> result

Allocates a new Runtime object and returns its reference.

Returns: result — Reference to the newly created Runtime


ivls.release_runtime(r)

Releases a Runtime object, invoking its destructor and freeing its slot.

Parameter Type Description
r integer Runtime reference to release

ivls.remove_voice_from_runtime(vo)

Removes a voice from its current Runtime (synchronous call context).

Parameter Type Description
vo integer Voice reference to remove from its runtime

Side effects: | Name | Type | Purpose | |------|------|---------| | ivls.remove_voice_from_runtime.vo | integer | Global staging variable for the Voice reference |


ivls.remove_voice_from_runtime.ICB(vo)

Removes a voice from its current Runtime (ICB-safe variant).

Parameter Type Description
vo integer Voice reference to remove from its runtime

Side effects: | Name | Type | Purpose | |------|------|---------| | ivls.remove_voice_from_runtime.vo | integer | Global staging variable for the Voice reference |


ivls.remove_voice_from_runtime.internal()

Removes the staged voice's entry from its runtime's FIFO.

Side effects:

Name Type Purpose
ivls.remove_voice_from_runtime.vo integer Global staging variable for the Voice reference
runtime integer Runtime reference read from the voice
ivls.remove_voice_from_runtime.voiceList integer FIFO list reference for the runtime
ivls.remove_voice_from_runtime.voiceEntry integer Entry reference for the voice within the FIFO

ivls.runtime.destruct(r)

Releases all voices in a Runtime and frees its internal FIFO.

Parameter Type Description
r integer Runtime reference to destruct

ivls.runtime.release_voices(r)

Iterates through every voice in the runtime's FIFO list and releases each one via ivls.release_voice.

Parameter Type Description
r integer Runtime reference whose voices should be released

Side effects:

Name Type Purpose
voiceList integer FIFO list reference read from the Runtime
vo integer Scratch variable reserved for iteration
peek integer Current Entry reference while walking the FIFO

Example

// TODO: Add usage example

See Also