Class ParameterWriter

Send parameter changes, lock free, no gc, between a UI thread (browser main thread or worker) and a real-time thread (in an AudioWorkletProcessor). Write and Reader cannot change roles after setup, unless externally synchronized.

GC can happen during the initial construction of this object when hopefully no audio is being output. This depends on the implementation.

Parameter changes are like in the VST framework: an index and a float value (no restriction on the value).

This class supports up to 256 parameters, but this is easy to extend if needed.

An element is an index, that is an unsigned byte, and a float32, which is 4 bytes.

Constructors

Methods

  • Enqueue a parameter change for parameter of index index, with a new value of value.

    Parameters

    • index: number

      The index of the parameter.

    • value: number

      The value of the parameter.

    Returns boolean

    True if enqueuing succeeded, false otherwise.

  • Enqueue a parameter change for parameter of index index, with a new value of value.

    Parameters

    • index: number

      The index of the parameter.

    • value: number

      The value of the parameter.

    Returns boolean

    True if enqueuing succeeded, false otherwise.

MMNEPVFCICPMFPCPTTAAATR