NamNode
Defined in: packages/chain/src/nodes/nam-node.ts:49
A NAM (Neural Amp Modeler) capture as a chain node.
The node applies no loudness gain of its own, deliberately. nam_process already implements
NAM’s Normalized output mode internally — 10^((-18 - modelLoudness)/20), smoothed against
clicks — which is the policy the workbench validated by listening. Applying it again here would
double it. getInfo().loudness reports what the engine did so a host can show it.
The engine instance is created at prepare, not in the constructor, because instantiation is
asynchronous and belongs to the caller. Until then the node passes audio through.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new NamNode(
id?,name?,config):NamNode
Defined in: packages/chain/src/nodes/nam-node.ts:74
Parameters
Section titled “Parameters”string = "nam-amp"
string = "NAM Amp"
config
Section titled “config”Returns
Section titled “Returns”NamNode
Properties
Section titled “Properties”bypassed
Section titled “bypassed”bypassed:
boolean=false
Defined in: packages/chain/src/nodes/nam-node.ts:55
Implementation of
Section titled “Implementation of”
readonlyid:string
Defined in: packages/chain/src/nodes/nam-node.ts:50
Implementation of
Section titled “Implementation of”
readonlykind:"nam"="nam"
Defined in: packages/chain/src/nodes/nam-node.ts:52
Implementation of
Section titled “Implementation of”latencySamples
Section titled “latencySamples”
readonlylatencySamples:0=0
Defined in: packages/chain/src/nodes/nam-node.ts:54
The engine adds no algorithmic delay; the buffer is in-place and sample-aligned.
mix:
number=1.0
Defined in: packages/chain/src/nodes/nam-node.ts:56
Implementation of
Section titled “Implementation of”
readonlyname:string
Defined in: packages/chain/src/nodes/nam-node.ts:51
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”dispose()
Section titled “dispose()”dispose():
void
Defined in: packages/chain/src/nodes/nam-node.ts:195
Release resources the node holds outside the chain — a WASM instance, a file handle.
Called on the node a chain drops: removeNode, clearNodes, and the replace-by-id path
in addNode. Optional because most nodes hold nothing that outlives them.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”getInfo()
Section titled “getInfo()”getInfo():
NamNodeInfo
Defined in: packages/chain/src/nodes/nam-node.ts:139
Returns
Section titled “Returns”getParam()
Section titled “getParam()”getParam(
id):number|undefined
Defined in: packages/chain/src/nodes/nam-node.ts:96
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”number | undefined
Implementation of
Section titled “Implementation of”getParams()
Section titled “getParams()”getParams():
Record<string,number>
Defined in: packages/chain/src/nodes/nam-node.ts:130
Returns
Section titled “Returns”Record<string, number>
Implementation of
Section titled “Implementation of”prepare()
Section titled “prepare()”prepare(
sampleRate):void
Defined in: packages/chain/src/nodes/nam-node.ts:84
Parameters
Section titled “Parameters”sampleRate
Section titled “sampleRate”number
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”process()
Section titled “process()”process(
input):Float64Array
Defined in: packages/chain/src/nodes/nam-node.ts:161
Parameters
Section titled “Parameters”Float32Array<ArrayBufferLike> | Float64Array<ArrayBufferLike>
Returns
Section titled “Returns”Float64Array
Implementation of
Section titled “Implementation of”reset()
Section titled “reset()”reset():
void
Defined in: packages/chain/src/nodes/nam-node.ts:90
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”setModel()
Section titled “setModel()”setModel(
modelJson):void
Defined in: packages/chain/src/nodes/nam-node.ts:153
Swap the model. The replacement is loaded into a new instance; the current one keeps running until the new one is ready, and is released only then. A refused model therefore never interrupts playback — the engine’s own reason is thrown and the old model stays.
Parameters
Section titled “Parameters”modelJson
Section titled “modelJson”string
Returns
Section titled “Returns”void
setParam()
Section titled “setParam()”setParam(
id,value):void
Defined in: packages/chain/src/nodes/nam-node.ts:111
Parameters
Section titled “Parameters”string
number
Returns
Section titled “Returns”void