Skip to content

Class AudityNodeDef

The single source of truth for one node kind: pin specs, channel behavior, param-blob defaults and validation, finiteness contribution, and the Burst exec function. Registered once via [AudityNode] reflection (see AudityNodeRegistry); the program builder, compiler, editor schema and realtime dispatch all read the registry rather than switching on a fixed kind enum.

Declaration
public abstract class AudityNodeDef

Registry-assigned identity (see DarkEffekt.Audity.AudityNodeRegistry.KindOf%60%601).

Declaration
public AudityNodeKindId Kind { get; }

Pin count expands with a per-node count (Mixer, Split, Random Route, …).

Declaration
public virtual bool IsVariadic { get; }

Audio output adopts the channel count of connected audio inputs (all must agree - exact match, no auto up/downmix).

Declaration
public virtual bool PropagatesChannels { get; }

Channel-construction kind: every audio pin carries a FIXED declared channel count from the pin spec (Split’s input is Audio(N), its outputs Audio(1), …).

Declaration
public virtual bool HasFixedChannelPins { get; }

Fixed-pin exception (Take Channel): the audio input adopts any incoming width even though the outputs stay fixed.

Declaration
public virtual bool AdoptsAnyInputWidth { get; }

This kind’s DYNAMIC Float pins (spec width 0) adopt the incoming wire’s full width instead of truncating it to 4. Opt in only when the exec reads and writes through the span API (DarkEffekt.Audity.AudityExecContext.ReadValues(DarkEffekt.Audity.AudityNodeDesc%40%2cSystem.Int32%2cSystem.Span%7bSystem.Single%7d) / DarkEffekt.Audity.AudityExecContext.ValueOut(DarkEffekt.Audity.AudityNodeDesc%40%2cSystem.Int32)) - a float4-based exec resolved to width 8 would index past lane w. See DarkEffekt.Audity.AudityNodeSpec.ResolveDynamicWidth(System.Int32%2cSystem.Int32).

Declaration
public virtual bool AdoptsAnyValueWidth { get; }

Draws from the per-player voice pool (WavePlayer, and custom voice-players).

Declaration
public virtual bool IsVoicePlayer { get; }

Pool requirements for a custom voice-player (ignored unless DarkEffekt.Audity.AudityNodeDef.IsVoicePlayer). The node’s exec drives voices through DarkEffekt.Audity.AudityExecContext’s SpawnVoice / LiveVoices / VoiceState surface. Default max-voices falls back to the engine pool size.

Declaration
public virtual AudityVoiceConfig VoiceConfig { get; }

This kind’s DarkEffekt.Audity.AudityNodeDef.KeepsInstanceAlive(DarkEffekt.Audity.AudityNodeLiveness%40) claim exists only because its trigger outputs could conjure sound from silence (an external entry, a threshold crossing, a running clock). The builder refines such a claim by reachability: when no path from this node’s triggers reaches a voice-starting pin, the claim is waived and a one-shot can retire. Endless audio sources (Oscillator, Noise, a looping player) keep the default false - they ARE the sound, no conjuring needed.

Declaration
public virtual bool LivenessFollowsVoiceStartReachability { get; }

Bytes of per-node DSP state this kind needs (phase accumulators, filter memories, envelope stages). Allocated per node in one arena at Configure, zero-initialized at instance start, reached in exec as a struct via DarkEffekt.Audity.AudityExecContext.State%60%601(DarkEffekt.Audity.AudityNodeDesc%40) (or as floats via DarkEffekt.Audity.AudityExecContext.UserState(DarkEffekt.Audity.AudityNodeDesc%40)). The default keeps the classic 16-float UserState scratch; stateless kinds should declare 0.

Declaration
public virtual int StateBytes { get; }

The kind’s exec function, compiled to a Burst function pointer at registration. Null for kinds the executor runs specially (the Output sink).

Declaration
public virtual AudityNodeExec Exec { get; }

Appends the kind’s input pins in executor pin order.

Declaration
public abstract void GetInputPins(int variadicCount, List<AudityPinSpec> pins)
Type Name
System.Int32 variadicCount
System.Collections.Generic.List<DarkEffekt.Audity.AudityPinSpec> pins

Appends the kind’s output pins in executor pin order.

Declaration
public abstract void GetOutputPins(int variadicCount, List<AudityPinSpec> pins)
Type Name
System.Int32 variadicCount
System.Collections.Generic.List<DarkEffekt.Audity.AudityPinSpec> pins

Minimum float-param blob, so the executor never reads out of range.

Declaration
public virtual float[] CreateDefaultParams()

System.Single[]

Build-time param validation (report via DarkEffekt.Audity.AudityNodeValidation.Error(System.String)).

Declaration
public virtual void Validate(in AudityNodeValidation validation)
Type Name
DarkEffekt.Audity.AudityNodeValidation validation

True when this node can keep the instance alive indefinitely (an endless source, an external trigger entry, a looping sample) - the program is then non-finite and only stops on request.

Declaration
public virtual bool KeepsInstanceAlive(in AudityNodeLiveness liveness)

System.Boolean

Type Name
DarkEffekt.Audity.AudityNodeLiveness liveness

The user-facing fact behind a true DarkEffekt.Audity.AudityNodeDef.KeepsInstanceAlive(DarkEffekt.Audity.AudityNodeLiveness%40) - one sentence, shown in the graph editor’s lifetime list so “why doesn’t my one-shot finish?” is answerable without reading engine code.

Declaration
public virtual string LivenessReason(in AudityNodeLiveness liveness)

System.String

Type Name
DarkEffekt.Audity.AudityNodeLiveness liveness

A trigger arriving on input pinId can start a voice from silence. Drives the Trigger In liveness refinement: an external trigger entry only holds the instance open if some reachable pin can actually conjure sound - a stop-only entry is reactive and lets one-shots retire.

Declaration
public virtual bool TriggerInputStartsVoice(string pinId)

System.Boolean

Type Name
System.String pinId

A trigger arriving on input pinId can cause this node’s outputs to fire (now or later) - the reachability walk continues through it. Stop-like pins that only end or suppress return false. Default is the conservative true.

Declaration
public virtual bool TriggerInputPropagates(string pinId)

System.Boolean

Type Name
System.String pinId

True when this node eventually goes quiet inside a trigger feedback cycle (a Stop-ending Sequence Step), letting an otherwise-cyclic patch count as finite.

Declaration
public virtual bool BreaksTriggerCycles(float[] nodeParams)

System.Boolean

Type Name
System.Single[] nodeParams

Seconds of per-channel DSP-pool memory this node needs (delay lines, reverb tanks). 0 = none. The pool is sized at Configure time (seconds × sample rate × the node’s resolved channel count) and reached in exec via the engine’s DspRegion; per-node layout inside the region is the exec’s own business.

Declaration
public virtual float DspSecondsPerChannel(float[] nodeParams)

System.Single

Type Name
System.Single[] nodeParams