Skip to content

Randomizer

Stl.Randomize — LIBRARY

Import

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

Node: Stl.Randomize

Uses: Init, Reload

Overview

Stl.Randomize — LIBRARY

Randomizer component with option-selection UI and dispatched run support.

  • Options menu for toggling which randomizable options participate in a pass
  • Run button to execute all active options in one action
  • Options and active state persist across instrument loads via instpers
  • Options registered via STL.RANDOMS literate macro; each must expose a .run() function

API

Nodes

Name Description
node Stl.Randomize Randomizer node providing option-selection UI and run dispatch.

Const Blocks

Name Description
const option Enumeration of all registered randomizable option identifiers.

Macros

Name Description
randoms.RunActiveOption(#option#) Run the named random option if it is currently marked active.

Functions

Name Description
randoms.run() Executes all active random options and reports the result to the display.
randoms.update_text() Updates the display text for every item in the Options menu.

Nodes

node Stl.Randomize

Callbacks: Init, Reload

Randomizer node providing option-selection UI and run dispatch.


Const Blocks

const option

Enumeration of all registered randomizable option identifiers.


Macros

randoms.RunActiveOption(#option#)

Run the named random option if it is currently marked active.

Sets any_ran to TRUE and invokes randoms.#option#.run() when the corresponding options_active flag is set, otherwise does nothing.

Parameter Description
#option# Name token of the random option (matches a constant in randoms.option)

Functions

randoms.run()

Executes all active random options and reports the result to the display.

Side effects: | Name | Type | Purpose | | ---- | ---- | ------- | | any_ran | integer | Flag indicating whether at least one option ran |


randoms.update_text()

Updates the display text for every item in the Options menu.

Side effects:

Name Type Purpose
i integer Loop counter over option indices
@name string Temporary buffer holding the display name for each option

Example

// TODO: Add usage example

See Also