Skip to main content

Module mutate

Module mutate 

Source
Expand description

User-driven structural edits: create, delete, replace, and rewire nodes in a patch tree — the “reconnect anything” surface of the workbench.

Because the genome is a typed tree, rewiring is expressed as a small vocabulary of operations that are type-safe by construction (an LFO can never end up in an audio slot; a filter always has exactly one audio input): replace a node, insert a node into a wire, delete/splice a node, change a modulation source, swap a mixer’s inputs. These are the same moves evolution’s structural proposals make — hand edits and MH walk the same lattice.

Nodes are addressed by their trace key (node, node/0, node/0/1, node/0/m for mod slots — see crate::genome).

Enums§

ModKind
A modulation choice for StructOp::SetMod.
NodeKind
The buildable node palette (everything the grammar can express).
StructError
Why a structural edit was rejected.
StructOp
One structural edit.

Constants§

MAX_DEPTH
Maximum tree depth for hand-built patches.
MAX_MOD_DEPTH
Maximum nesting depth of a hand-built modulation term.
MAX_SIZE
Hard ceilings on hand-built patches (protects the realtime voice and the feature pipeline; evolution’s own prior rarely exceeds these).

Functions§

apply_struct_op
Apply a structural edit, returning the new tree.
validate_tree
Every ceiling a hand-built patch has to respect, in one callable place.