Files
2026-06-09 21:06:27 +01:00
..
2026-06-09 21:06:27 +01:00

@suaveplan/audio-fx-plugin-base - Foundation for the @suaveplan/audio-fx-plugin-family. Exports the AudioFxPlugin contract, PluginChain primitive, ChainContext, AmbientState, BusRegistry, PluginRegistry, ChainSnapshot, ChainEventBus, ParameterSchedule, PresetSnapshot, and the shared AUDIO_FX. error-code registry. Runs identically in browser, server, offline, and worklet contexts.

Foundation for the @suaveplan/audio-fx-plugin-* family. Universal (browser / server / offline / worklet identical). Zero @suaveplan/audio-fx-plugin-* deps — concrete plugins depend on this package, never the other way around.

Documentation tree

  • plugin-internals — The plugin-internals module owns the boundary guards + parameter validation helpers consumed by `AbstractAudioFxP…
    • plugin-internals — The plugin-internals module owns the boundary guards + parameter validation helpers consumed by `AbstractAudioFxP…
  • audio-fx-plugin — This module defines the universal AudioFxPlugin contract every plugin in the audio family implements, plu…
  • capabilities — PluginCapabilities is the explicit feature-flag declaration every AudioFxPlugin carries. Engines route audio th…
  • parameter-schedule — ParameterSchedule is the per-parameter automation evaluator every plugin uses. One instance per `(plugin, paramet…
  • plugin-io — The plugin-io module declares the channel-topology contract every AudioFxPlugin carries (PluginIo, `ChannelSp…
  • preset — The preset module owns the plugin preset envelope — PresetSnapshot — and the three boundary guards every plugin…
  • biquad — The eq.biquad module owns the RBJ Audio EQ Cookbook coefficient maths and the per-band biquad state shapes consum…
    • biquad — The eq.biquad module owns the RBJ Audio EQ Cookbook coefficient maths and the per-band biquad state shapes consum…
  • chain — PluginChain is the universal insert-list primitive that engines and headless callers use to compose, host, and re…
    • context — ChainContextFactory builds one ChainContext per plugin slot for the PluginChain class. The handed-out reference i…
      • context — ChainContextFactory builds one ChainContext per plugin slot for the PluginChain class. The handed-out reference i…
    • event-bus — The chain-event-bus module owns the typed pub/sub plumbing consumed by PluginChain. Splitting it out of the cha…
      • event-bus — The chain-event-bus module owns the typed pub/sub plumbing consumed by PluginChain. Splitting it out of the cha…
    • insert — The chain-insert module owns the structural validation + slot-index resolution + scratch-buffer allocation helper…
      • insert — The chain-insert module owns the structural validation + slot-index resolution + scratch-buffer allocation helper…
    • lifecycle — The lifecycle module owns the per-block / per-setup helpers that PluginChain calls during setup, process, `…
      • lifecycle — The lifecycle module owns the per-block / per-setup helpers that PluginChain calls during setup, process, `…
    • snapshot — The chain-snapshot module owns the PluginChain serialisation envelope and the boundary helpers that round-trip…
      • snapshot — The chain-snapshot module owns the PluginChain serialisation envelope and the boundary helpers that round-trip…
    • ambient-state — This module owns the engine-pushed ambient state every PluginChain carries and forwards to every plugin via `Chai…
    • bus-registry — The BusRegistry is the project-level sidechain routing surface that every chain hosted by an engine adapter consu…
    • chain — PluginChain is the universal insert-list primitive that engines and headless callers use to compose, host, and re…
  • error-codes — The error-codes module declares the complete error code surface for @suaveplan/audio-fx-plugin-base via `defineCode…
    • error-codes — The error-codes module declares the complete error code surface for @suaveplan/audio-fx-plugin-base via `defineCode…
  • registry — The PluginRegistry is the session-restore lookup table that maps a serialised pluginType string (a plugin's `me…
    • registry — The PluginRegistry is the session-restore lookup table that maps a serialised pluginType string (a plugin's `me…

What's in here

  • ./base — the AudioFxPlugin contract, AbstractAudioFxPlugin helper, PluginCapabilities / PluginIo / PluginMetadata / PluginParameter types, ParameterSchedule, PresetSnapshot Zod schema, and channel-layout utilities.
  • ./chain — PluginChain primitive, ChainContext, AmbientState propagation, DefaultBusRegistry, ChainSnapshot (parse + serialise), ChainEventBus, insertion / lifecycle helpers.
  • ./registry — PluginRegistry for factory-driven plugin instantiation.
  • ./error-codes — the shared AUDIO_FX.* error-code registry via defineCodes, AudioFxError carrier, AUDIO_FX_ERROR_METADATA table, and registerAudioFxErrorCodes() for early-registration callers.

Composition

Every concrete @suaveplan/audio-fx-plugin-<name> package depends on this one and imports the contract:

import { AbstractAudioFxPlugin } from "@suaveplan/audio-fx-plugin-base/base";
import { PluginChain, DefaultBusRegistry } from "@suaveplan/audio-fx-plugin-base/chain";
import { PluginRegistry } from "@suaveplan/audio-fx-plugin-base/registry";
import { AUDIO_FX_CODES, AudioFxError } from "@suaveplan/audio-fx-plugin-base/error-codes";

Consumers compose a chain from per-plugin packages:

import { EqPlugin } from "@suaveplan/audio-fx-plugin-eq";
import { CompressorPlugin } from "@suaveplan/audio-fx-plugin-compressor";
import { ReverbPlugin } from "@suaveplan/audio-fx-plugin-reverb";
import { PluginChain, DefaultBusRegistry } from "@suaveplan/audio-fx-plugin-base/chain";

const chain = new PluginChain({
 buses: new DefaultBusRegistry(),
 plugins: [new EqPlugin(), new CompressorPlugin(), new ReverbPlugin()],
});

The chain accepts any AudioFxPlugin without per-plugin glue — the contract is the single point of agreement.

Subpath exports

Subpath Surface
. Re-exports every public symbol from the four feature folders below
./base AudioFxPlugin, AbstractAudioFxPlugin, capabilities, IO, parameter, preset
./chain PluginChain, ChainContext, AmbientState, BusRegistry, ChainSnapshot, event-bus, insert, lifecycle
./registry PluginRegistry, PluginFactory
./error-codes AUDIO_FX_CODES, AudioFxError, AUDIO_FX_ERROR_METADATA, registerAudioFxErrorCodes

Status

Replaces the foundation surface previously bundled inside @suaveplan/audio-plugins-fx.