Table of Contents

Class Nodes

Namespace
Ofs
Assembly
Ofs.Api.dll

Registration of custom processing nodes. A node declares a NodeShape (N named input pins, M named output pins) and one eval delegate; the signal kind (functional vs discrete) is chosen by the delegate shape.

public sealed class Nodes
Inheritance
object
Nodes

Remarks

Node callbacks may run on worker threads: they receive only their inputs and parameters and must not touch Host, the player, or axes.

Methods

AddNode(string, string, NodeShape, EvalDiscrete, string?, NodeIcon, string?)

Registers a stateless discrete node: its eval reads the input action lists and writes the output action lists, once per region.

public void AddNode(string id, string name, NodeShape shape, EvalDiscrete eval, string? group = null, NodeIcon icon = NodeIcon.Default, string? description = null)

Parameters

id string

Stable id, unique within the plugin; combined with the plugin name as "<plugin>.<id>".

name string

Display name shown in the add-node menu, rendered verbatim.

shape NodeShape

The node's input/output pin names and counts.

eval EvalDiscrete

Worker-thread compute. A stateless node has no TState.

group string

Optional add-node menu group header; defaults to the plugin name.

icon NodeIcon

Optional palette/title-bar glyph; defaults to the node's arity icon.

description string

Optional add-node menu hover tooltip describing the node; omit for none.

AddNode(string, string, NodeShape, EvalFunctional, string?, NodeIcon, string?)

Registers a stateless functional node — one with no parameters or persisted state and no body UI. Its eval reads the input values at each sampled time and writes the output values, 0..100.

public void AddNode(string id, string name, NodeShape shape, EvalFunctional eval, string? group = null, NodeIcon icon = NodeIcon.Default, string? description = null)

Parameters

id string

Stable id, unique within the plugin; combined with the plugin name as "<plugin>.<id>".

name string

Display name shown in the add-node menu, rendered verbatim.

shape NodeShape

The node's input/output pin names and counts.

eval EvalFunctional

Worker-thread compute. A stateless node has no TState.

group string

Optional add-node menu group header; defaults to the plugin name.

icon NodeIcon

Optional palette/title-bar glyph; defaults to the node's arity icon.

description string

Optional add-node menu hover tooltip describing the node; omit for none.

AddNode(string, string, NodeShape, PrepareFunctional, string?, NodeIcon, string?)

Registers a stateless functional node whose prepare factory runs once per region eval and returns the per-sample closure — build a LUT or other artifact there rather than rebuilding it every sample.

public void AddNode(string id, string name, NodeShape shape, PrepareFunctional prepare, string? group = null, NodeIcon icon = NodeIcon.Default, string? description = null)

Parameters

id string

Stable id, unique within the plugin; combined with the plugin name as "<plugin>.<id>".

name string

Display name shown in the add-node menu, rendered verbatim.

shape NodeShape

The node's input/output pin names and counts.

prepare PrepareFunctional
group string

Optional add-node menu group header; defaults to the plugin name.

icon NodeIcon

Optional palette/title-bar glyph; defaults to the node's arity icon.

description string

Optional add-node menu hover tooltip describing the node; omit for none.

AddNode<TState>(string, string, NodeShape, EvalDiscrete<TState>, NodeUi<TState>?, string?, NodeIcon, string?)

Registers a discrete node: its eval reads the input action lists and writes the output action lists, once per region.

public void AddNode<TState>(string id, string name, NodeShape shape, EvalDiscrete<TState> eval, NodeUi<TState>? ui = null, string? group = null, NodeIcon icon = NodeIcon.Default, string? description = null) where TState : struct

Parameters

id string

Stable id, unique within the plugin; combined with the plugin name as "<plugin>.<id>".

name string

Display name shown in the add-node menu, rendered verbatim.

shape NodeShape

The node's input/output pin names and counts.

eval EvalDiscrete<TState>

Worker-thread compute. Reads a private copy of the state by in.

ui NodeUi<TState>

Optional body UI drawn on the main thread; omit for a headless node.

group string

Optional add-node menu group header; defaults to the plugin name. Pass the same string from several nodes (or plugins) to collect them under one heading.

icon NodeIcon

Optional palette/title-bar glyph; defaults to the node's arity icon.

description string

Optional add-node menu hover tooltip describing the node; omit for none.

Type Parameters

TState

A struct whose fields are the node's state and parameters.

AddNode<TState>(string, string, NodeShape, EvalFunctional<TState>, NodeUi<TState>?, string?, NodeIcon, string?)

Registers a functional node: its eval reads the input values at each sampled time and writes the output values, 0..100.

public void AddNode<TState>(string id, string name, NodeShape shape, EvalFunctional<TState> eval, NodeUi<TState>? ui = null, string? group = null, NodeIcon icon = NodeIcon.Default, string? description = null) where TState : struct

Parameters

id string

Stable id, unique within the plugin; combined with the plugin name as "<plugin>.<id>".

name string

Display name shown in the add-node menu, rendered verbatim.

shape NodeShape

The node's input/output pin names and counts.

eval EvalFunctional<TState>

Worker-thread compute. Reads a private copy of the state by in.

ui NodeUi<TState>

Optional body UI drawn on the main thread; omit for a headless node.

group string

Optional add-node menu group header; defaults to the plugin name. Pass the same string from several nodes (or plugins) to collect them under one heading.

icon NodeIcon

Optional palette/title-bar glyph; defaults to the node's arity icon.

description string

Optional add-node menu hover tooltip describing the node; omit for none.

Type Parameters

TState

A struct whose fields are the node's state and parameters.

AddNode<TState>(string, string, NodeShape, PrepareFunctional<TState>, NodeUi<TState>?, string?, NodeIcon, string?)

Registers a functional node whose prepare factory runs once per region eval and returns the per-sample closure — build a LUT or other artifact there rather than rebuilding it every sample.

public void AddNode<TState>(string id, string name, NodeShape shape, PrepareFunctional<TState> prepare, NodeUi<TState>? ui = null, string? group = null, NodeIcon icon = NodeIcon.Default, string? description = null) where TState : struct

Parameters

id string

Stable id, unique within the plugin; combined with the plugin name as "<plugin>.<id>".

name string

Display name shown in the add-node menu, rendered verbatim.

shape NodeShape

The node's input/output pin names and counts.

prepare PrepareFunctional<TState>
ui NodeUi<TState>

Optional body UI drawn on the main thread; omit for a headless node.

group string

Optional add-node menu group header; defaults to the plugin name. Pass the same string from several nodes (or plugins) to collect them under one heading.

icon NodeIcon

Optional palette/title-bar glyph; defaults to the node's arity icon.

description string

Optional add-node menu hover tooltip describing the node; omit for none.

Type Parameters

TState

A struct whose fields are the node's state and parameters.