Build with this node

Start with a prompt in Studio, or copy it into your own coding agent.

Ask Studio

@maruaudio/dsp/control/param-macros defines the table layout and value law that let a Processor's macro knobs drive its own parameters. A macro is a 0..1 position; what it moves is an f32 table the host stages into a data slot: a header row [version, rowCount, 0, 0, 0, 0] and up to 32 target rows [macroIndex, targetParamIndex, min, max, curveCode, 0]. Each row's value is min + (max − min) × curve(position), in the target's physical units, over the CcCurve vocabulary of @maruaudio/audio-contracts: linear, exp (v²), log (√v) and s-curve (smoothstep v²(3 − 2v)).

Functions

NameInputsOutputDomain as coded
paramMacroCurveposition, curveCodecurve value in 0..1Position clamped to 0..1; NaN and −Infinity read as 0; an unknown code is linear
paramMacroValueposition, min, max, curveCodemin + (max − min) × curvemin > max inverts the sweep; no clamp on min or max
PARAM_MACRO_ROW_COLUMNS, PARAM_MACRO_MAX_ROWS, PARAM_MACRO_SLOT_ELEMENTSconstants6, 32, 198(1 + 32) × 6 elements
PARAM_MACRO_COL_*constantsmacro 0, target 1, min 2, max 3, curve 4Column 5 is reserved and must be 0
PARAM_MACRO_CURVE_*constantslinear 0, exp 1, log 2, s-curve 3CcCurve order
PARAM_MACRO_VERSIONconstant1Header column 0

Lifecycle

The DSP node holds no state. The owning Processor validates and copies the table when it loads the resource, and evaluates the rows when a macro changes. Resolving targetParamIndex to a parameter is the owner's dispatch, not this DSP node's.

When to use it

Let a few macro knobs sweep many parameters of one instrument at once, each with its own range and curve. The Sampler module uses it for its macro resources.

Limits

  • The law is in physical units: the Processor has no descriptor tapers, so a host that wants a tapered sweep authors min, max and curve to suit.
  • The log curve costs one Math.sqrt; the rest is scalar arithmetic with no allocation.

Algorithm properties and proofs

No Lean 4 proof is mapped to this node.

Explore proofs alongside performance

Dependencies

None: this node imports no other node.

Dependents

No other node imports this one.

Used by