in source JSDoc. (Object) — No description in source JSDoc. (Object) — No description in source JSDoc. Build a complete audio trigger config from substance + event params. Parameters: (string) — No description in source JSDoc. (string) — 'impact' 'ambient' 'collision' (Object) — { position, velocity, volume, pitch } Returns: Ready to trigger config for AudioEngine <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


tickWeatherAudio(bridge, worldTime, weather, currentTime)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: WeatherAudioBridge.js Weather/Time → Ambient Audio Crossfades ambient audio loops based on WorldTime day/night cycle, seasons, and weather conditions. Functions Create a weather audio bridge. Parameters: (Object) — No description in source JSDoc. (number) — Seconds to crossfade between ambients (default 3.0) Tick weather audio — check time of day and weather, crossfade ambients. Parameters: (Object) — No description in source JSDoc. (Object) — WorldTime state (from WorldTime.js) (string) — Current weather condition key (number) — Engine time Returns: Array of trigger configs (start/stop ambient sources) <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also:


user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/bridge/index.js
Re-exports
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/audio/bridge/index.js — Barrel export for audio bridges. Re exports , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: AudioAssetManager.js Audio Asset Loading & Caching Fetches, decodes, and caches AudioBuffers. Supports pooling and streaming for large files (music). Functions Create an audio asset manager. Parameters: (AudioContext) — No description in source JSDoc. Returns: Asset manager instance Load and decode an audio file. Returns cached buffer if already loaded. Parameters: (Object) — No description in source JSDoc. (string) — URL or relative path to audio file Preload multiple audio assets. Parameters: (Object) — No description in source JSDoc. (string[]) — No description in source JSDoc. Register a pre decoded AudioBuffer directly. Parameters: (Object) — No description in source JSDoc. (string) — Key for retrieval (AudioBuffer) — No description in source JSDoc. Get a cached buffer (synchronous). Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. Check if a buffer is cached. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. Remove a cached buffer. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. Clear all cached buffers. Parameters: (Object) — No description in source JSDoc. Set base URL for relative asset paths. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. Destroy the asset manager and clear all caches. Parameters: (Object) — No description in source JSDoc. Re exports <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) →


system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


createAudioBus(context, destination, config = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: AudioBus.js Audio Category Bus A bus is a GainNode chain representing an audio category (sfx, music, ambient, voice, ui). Supports volume, mute, solo, and ducking (automatic volume reduction when another bus plays). Functions Create an audio bus. Parameters: (AudioContext) — No description in source JSDoc. (AudioNode) — Parent node to connect to (usually masterGain) (Object) — No description in source JSDoc. (number) — Initial volume 0 1 (default 1.0) Returns: Bus instance Set bus volume. Parameters: (Object) — No description in source JSDoc. (number) — 0 to 1 (number) — AudioContext.currentTime Mute/unmute the bus. Parameters: (Object) — No description in source JSDoc. (boolean) — No description in source JSDoc. Set duck amount (used for automatic ducking, e.g. voice ducks music). Parameters: (Object) — No description in source JSDoc. (number) — 0 (no duck) to 1 (fully ducked) Get the bus's output node (for sources to connect to). Parameters: (Object) — No description in source JSDoc. Destroy a bus and disconnect it. Parameters: (Object) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) →


system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: AudioConcurrency.js Voice Management & Stealing Manages the maximum number of concurrent voices. When the limit is reached, uses priority based voice stealing (quietest, oldest, or farthest). Functions Create a concurrency manager. Parameters: (Object) — No description in source JSDoc. (number) — Maximum concurrent voices (default 64) (string) — 'quietest' 'oldest' 'farthest' (default 'quietest') Tick concurrency — steal voices if over limit. Parameters: (Object) — No description in source JSDoc. (Map) — Map of id → AudioSource (number) — Current engine time Check if a new voice can be added, or which voice to steal. Parameters: (Object) — No description in source JSDoc. (Map) — No description in source JSDoc. (number) — Priority of the new voice Returns: true if the new voice can play Destroy concurrency manager. Parameters: (Object) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets


the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


tickDoppler(doppler, activeSources, listenerPos, listenerVel)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: AudioDoppler.js Doppler Effect Manually computes pitch shift from radial velocity between source and listener. Web Audio's built in Doppler was removed from the spec, so we implement it ourselves. Doppler ratio = (speedOfSound + listenerRadialVelocity) / (speedOfSound + sourceRadialVelocity) Functions Create a Doppler processor. Parameters: (Object) — No description in source JSDoc. (number) — Speed of sound in world units/sec (default 343) (number) — Max pitch multiplier shift (default 0.5, so range 0.5 1.5) (number) — Smoothing factor 0 1 (default 0.1) Tick Doppler — adjust pitch of all spatial sources based on relative velocity. Parameters: (Object) — No description in source JSDoc. (Map) — Map of id → AudioSource (number[]) — [x, y, z] (number[]) — [x, y, z] Destroy Doppler processor. Parameters: (Object) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio


Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


triggerAudioEvent(engine, eventId, options = {})

playSound(engine, eventId, options = {})

playBuffer(engine, buffer, options = {})

stopSource(engine, sourceId, fadeOut = 0.05)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: AudioEngine.js Core Audio Engine Central audio system for the engine. Manages AudioContext lifecycle, master gain, tick loop, and coordinates all audio subsystems. Usage: const engine = createAudioEngine({ maxVoices: 64 }); await initAudioEngine(engine); // In main loop: tickAudioEngine(engine, dt); // Cleanup: destroyAudioEngine(engine); Functions Create an audio engine instance. Parameters: (Object) — No description in source JSDoc. (number) — Master volume 0 1 (default 1.0) (number) — SFX bus volume (default 1.0) (number) — Music bus volume (default 0.7) (number) — Ambient bus volume (default 0.8) (number) — Voice bus volume (default 1.0) (number) — UI bus volume (default 0.8) (number) — Max concurrent voices (default 64) (boolean) — Enable 3D audio (default true) (string) — Audio quality: 'low' 'medium' 'high' (default 'high') (AudioContext) — Use this shared context instead of creating one (AudioNode) — Connect masterGain here instead of context.destination Returns: Audio engine instance Initialize the audio engine. Creates AudioContext and all subsystems. Must be called after a user gesture (click/tap) to comply with autoplay policy. Parameters: (Object) — Audio engine instance Returns: true if initialized successfully Ensure the AudioContext is resumed (call after user gesture). Parameters: (Object) — No description in source JSDoc. Tick the audio engine. Updates active sources, cleans up finished ones. Parameters: (Object) — No description in source JSDoc. (number) — Delta time in seconds Trigger an audio event by ID. Parameters: (Object) — No description in source JSDoc. (string) — Registered event ID or direct sound asset path (Object) — No description in source JSDoc.


ID. Parameters: (Object) — No description in source JSDoc. (string) — Registered event ID or direct sound asset path (Object) — No description in source JSDoc. (number[]) — [x, y, z] world position (number[]) — [x, y, z] source velocity (number) — Volume override (0 1) (number) — Pitch multiplier (default 1.0) (string) — Bus name: 'sfx' 'music' 'ambient' 'voice' 'ui' (number) — Priority for voice stealing (higher = keep) (boolean) — Loop the sound Returns: Source ID, or null if couldn't play Backward compatible alias used by older bridge code. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. (Object) — No description in source JSDoc. Play a buffer directly (bypasses event resolution). Parameters: (Object) — No description in source JSDoc. (AudioBuffer) — No description in source JSDoc. (Object) — Same as triggerAudioEvent options Stop a specific source by ID. Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. (number) — Fade out time in seconds (default 0.05) Stop all active sources. Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. Register an audio event descriptor. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. (Object) — See AudioEvent.js for format Unregister an audio event. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. Set master volume. Parameters: (Object) — No description in source JSDoc. (number) — 0 to 1 Set volume for a specific bus. Parameters: (Object) — No description in source JSDoc. (string) — 'sfx' 'music' 'ambient' 'voice' 'ui' (number) — 0 to 1 Destroy the audio engine and release all resources. Parameters:


description in source JSDoc. (string) — 'sfx' 'music' 'ambient' 'voice' 'ui' (number) — 0 to 1 Destroy the audio engine and release all resources. Parameters: (Object) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes co


resolveAudioEvent(event, eventId, options, time)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: AudioEvent.js Audio Event Descriptors Defines how audio events are resolved: one shots, random containers, sequences, and loops. An event maps an ID to concrete playback params. Event descriptor format: { type: 'oneshot' 'random' 'sequence' 'loop', sounds: ['path1.ogg', 'path2.ogg'], // Pool of sounds volume: [0.8, 1.0], // Random range or fixed value pitch: [0.9, 1.1], // Random range or fixed value bus: 'sfx', // Target bus priority: 0, // Voice stealing priority cooldown: 0, // Min seconds between triggers maxInstances: 0, // Max simultaneous (0 = unlimited) } Functions Resolve an audio event descriptor to concrete play parameters. Parameters: (Object null) — Registered event descriptor (or null for direct path) (string) — The event ID (used as sound path if no descriptor) (Object) — Trigger options (position, volume overrides, etc.) (number) — Current engine time Returns: { sound, volume, pitch, loop, priority, bus } Create an audio event descriptor. Parameters: (Object) — No description in source JSDoc. Returns: Event descriptor <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing


AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


updateAudioListener(listener, position, forward, up, dt)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: AudioListener.js 3D Audio Listener Wraps the Web Audio API AudioListener, syncing camera position, orientation, and velocity for accurate 3D spatialization. Functions Create an audio listener wrapper. Parameters: (AudioContext) — No description in source JSDoc. Returns: Listener instance Update listener position, orientation, and velocity. Call once per frame with camera data. Parameters: (Object) — No description in source JSDoc. (number[]) — [x, y, z] (number[]) — [x, y, z] normalized forward direction (number[]) — [x, y, z] normalized up direction (number) — Delta time for velocity calculation Get the listener's current position. Parameters: (Object) — No description in source JSDoc. Returns: [x, y, z] Get the listener's current velocity. Parameters: (Object) — No description in source JSDoc. Returns: [x, y, z] Destroy the listener wrapper. Parameters: (Object) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced:


All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


addOccluder(occlusion, min, max, transmission = 0.2)

tickOcclusion(occlusion, activeSources, listenerPos, context, dt)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: AudioOcclusion.js Sound Occlusion via Raycasting Casts a ray from each active source to the listener. If the ray intersects occluders (walls, objects), applies lowpass filter + volume attenuation to simulate sound being blocked/muffled. Uses simple AABB intersection for performance. Can be upgraded to use the engine's physics raycasts (PhysX/PBD) for higher fidelity. Functions Create an occlusion system. Parameters: (Object) — No description in source JSDoc. (number) — Max tracked occluders (default 64) (number) — Seconds between occlusion updates (default 0.1) (number) — Lowpass frequency when fully occluded (default 300 Hz) (number) — Lowpass frequency when not occluded (default 20000 Hz) (number) — Volume multiplier when fully occluded (default 0.3) Add an AABB occluder. Parameters: (Object) — No description in source JSDoc. (number[]) — [x, y, z] box min corner (number[]) — [x, y, z] box max corner (number) — 0 (fully blocks) to 1 (transparent). Default 0.2 Returns: Occluder index Remove an occluder by index. Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. Clear all occluders. Parameters: (Object) — No description in source JSDoc. Tick occlusion: check sources against occluders and apply filters. Parameters: (Object) — No description in source JSDoc. (Map) — Map of id → AudioSource (number[]) — [x, y, z] (AudioContext) — For creating filter nodes (number) — Delta time Destroy occlusion system. Parameters: (Object) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator,


& Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


connectSourceToReverb(system, source, sendLevel = 0.3)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Create a reverb zone system. Parameters: (AudioContext) — No description in source JSDoc. (AudioNode) — Node to connect reverb output to (usually masterGain) Add a reverb zone. Parameters: (Object) — No description in source JSDoc. (Object) — No description in source JSDoc. (string) — 'box' 'sphere' (default 'box') (number[]) — [x, y, z] (number[]) — [w, h, d] for box (number) — Radius for sphere (string) — Key from REVERB PRESETS (number) — Higher takes precedence in overlaps (default 0) Returns: Zone index Remove a reverb zone. Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. Tick reverb zones — blend based on listener position. Parameters: (Object) — No description in source JSDoc. (number[]) — [x, y, z] Connect a source to the reverb system's convolver (send). Parameters: (Object) — No description in source JSDoc. (Object) — AudioSource (number) — How much signal goes to reverb (0 1) Destroy reverb zone system. Parameters: (Object) — No description in source JSDoc. Constants <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains:


See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/core/AudioSource.js
Functions
createAudioSource(context, config = {})
tickAudioSource(source, dt)
setSourcePosition(source, position)
setSourceVolume(source, volume)
setSourcePitch(source, pitch)
stopAudioSource(source, fadeOut = 0.05)
isSourceDone(source)
getSourceEffectiveVolume(source)
destroyAudioSource(source)
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: AudioSource.js 3D Sound Emitter Wraps a BufferSourceNode + PannerNode (HRTF) + GainNode chain. Represents a single playing sound in 3D space. Functions Create and start an audio source. Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. (number) — Unique source ID (AudioBuffer) — Decoded audio buffer (Object) — AudioBus to connect to (number[]) — [x,y,z] or null for 2D (number[]) — [x,y,z] source velocity (number) — Volume 0 2 (default 1.0) (number) — Playback rate (default 1.0) (boolean) — Loop playback (default false) (number) — Priority for voice stealing (default 0) (boolean) — Use 3D panner (default false) (number) — PannerNode refDistance (default 1) (number) — PannerNode maxDistance (default 100) (number) — PannerNode rolloffFactor (default 1) (number) — Engine time at creation Returns: Source instance Tick a source (per frame update). Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. Update source 3D position explicitly. Parameters: (Object) — No description in source JSDoc. (number[]) — [x, y, z] Set source volume. Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. Set source pitch/playback rate. Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. Stop a source with optional fade out. Parameters: (Object) — No description in source JSDoc. (number) — Seconds to fade (default 0.05) Check if source is finished playing. Parameters: (Object) — No description in source JSDoc. Get effective volume (volume × occlusion). Parameters: (Object) — No description in source JSDoc. Destroy a


(Object) — No description in source JSDoc. Get effective volume (volume × occlusion). Parameters: (Object) — No description in source JSDoc. Destroy a source and disconnect all nodes. Parameters: (Object) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/core/FootstepEvents.js
Functions
registerFootstepEvents(audioEngine)
unregisterFootstepEvents(audioEngine)
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: FootstepEvents.js Footstep Audio Event Registration Registers all footstep and land audio events with the AudioEngine. Called during engine initialization. Functions Register all footstep audio events with the AudioEngine. Should be called once during engine initialization. Parameters: (Object) — AudioEngine instance Unregister all footstep events (for cleanup). Parameters: (Object) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/core/FootstepMaterials.js
Functions
resolveFootstepMaterial(material)
getFootstepConfig(materialKey)
getAllFootstepMaterials()
Constants
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: FootstepMaterials.js Footstep Material Taxonomy & Mapping Defines acoustic materials for footsteps (distinct from physics materials) and provides mapping from physics/voxel materials to footstep materials. Functions Resolve a physics material ID to a footstep material key. Parameters: (number string null) — Physics material ID or voxel material string Returns: Footstep material key (defaults to 'dirt') Get footstep material config. Parameters: (string) — Footstep material key Returns: { patch, variants } Get all footstep material keys. Constants — Footstep material configurations. Each defines the procedural patch to use and number of variants. — Map physics material IDs to footstep materials. Physics materials are from PhysicsAudioBridge.js MATERIAL TO SUBSTANCE. — Map voxel/terrain material strings to footstep materials. Used when querying terrain directly. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced:


thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/core/index.js
Re-exports
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/audio/core/index.js — Barrel export for core audio engine. Re exports , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/index.js

audio/index.js
Re-exports
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/audio/index.js — Top level barrel export for the complete audio system. Exports: Core engine, Spatial pipeline, Bridges, Synth kernel, Sound atoms, Physics models. Re exports , , , , , , , , , , , , , , , , , , , , <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/synth/BodyFoleyPatches.js
Functions
bodyjumpeffort(ctx, dest, p)
bodyslide(ctx, dest, p)
bodycloth(ctx, dest, p)
bodybreathlight(ctx, dest, p)
bodybreathheavy(ctx, dest, p)
Constants
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Jump effort sound — short vocal grunt (bandpassed noise + formant) Slide friction sound — continuous lowpass swept noise Cloth rustle — short high freq noise burst Light breathing — soft airy noise with bandpass Heavy breathing — louder breath with low end rumble Constants <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/synth/FootstepPatches.js
Functions
footstepdirt(ctx, dest, p)
footstepgrass(ctx, dest, p)
footstepsand(ctx, dest, p)
footstepgravel(ctx, dest, p)
footstepmud(ctx, dest, p)
footstepsnow(ctx, dest, p)
footstepstone(ctx, dest, p)
footstepconcrete(ctx, dest, p)
footstepmarble(ctx, dest, p)
footstepbrick(ctx, dest, p)
footstepwoodplank(ctx, dest, p)
footstepwoodcreak(ctx, dest, p)
footstepmetalsolid(ctx, dest, p)
footstepmetalgrate(ctx, dest, p)
footstepwatershallow(ctx, dest, p)
footstepwaterpuddle(ctx, dest, p)
footstepleaves(ctx, dest, p)
footstepglass(ctx, dest, p)
footstepice(ctx, dest, p)
landgeneric(ctx, dest, p)
getFootstepPatch(material)
Constants
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: FootstepPatches.js Procedural Footstep Sound Generators Generates material specific footstep sounds procedurally using Web Audio API. Each patch creates layered sounds (body impact + surface texture) with parameters for speed, weight, and pitch variation. Functions Dirt footstep — muffled thud + grain scatter Grass footstep — soft rustle + muffled thud Sand footstep — soft grain scatter + muffled impact Gravel footstep — sharp scatter + rattle Mud footstep — wet squelch + suction release Snow footstep — soft crunch + squeak Stone footstep — hard impact + high freq crack Concrete footstep — dull thud + mid freq resonance Marble footstep — bright click + ring Brick footstep — textured impact + dust scatter Wood plank footstep — resonant body + plank slap Wood creak footstep — creaking friction + resonance Metal solid footstep — clang + ring Metal grate footstep — rattle + metallic ring Water shallow footstep — splash + plop Water puddle footstep — small splash Leaves footstep — crunch + rustle Glass footstep — delicate clink + shimmer Ice footstep — crack + slide Generic land sound — reuses footstep patch but with heavier weight/volume Can be used as a wrapper for any footstep material Get footstep patch function by material key. Parameters: (string) — Material key (e.g., 'dirt', 'stone') Constants <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain


(speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/synth/NodeRegistry.js
Functions
getNodeFactory(type)
getRegisteredTypes()
getNodeCategory(type)
hasWorkletProcessor(type)
Constants
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: NodeRegistry.js — Unified Node Type Registry Single source of truth for mapping node type names to their Web Audio factory functions and worklet processor names. Usage: import { getNodeFactory, getRegisteredTypes } from './NodeRegistry.js'; const factory = getNodeFactory('Waveguide'); const node = factory(ctx, params, pitchRatio); Functions Get the Web Audio factory function for a node type. Returns a function: (ctx, nodeDefinition, pitchRatio) = { output, input, sources } Parameters: (string) — Node type name Get all registered type names. Get the category for a node type. Parameters: (string) — No description in source JSDoc. Check if a type has a worklet processor implementation. Parameters: (string) — No description in source JSDoc. Constants — Node category definitions for organization/UI. — All registered node type names (flat list). <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio


Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/synth/PatchCompiler.js
Functions
registerNodeType(type, def)
getNodeTypes()
compilePatch(patch)
validatePatch(patch)
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: PatchCompiler.js Compile Patch JSON → Execution Graph Parses a patch JSON descriptor, validates nodes and wires, performs topological sort, detects feedback loops, and outputs a compiled execution plan for PatchRunner.worklet.js. Functions Register a node type for the compiler. Parameters: (string) — Node type name (e.g. 'Oscillator', 'Filter') (Object) — { inputs: string[], outputs: string[], params: Object } Get all registered node types. Compile a patch JSON into an execution plan. Parameters: (Object) — Patch descriptor { id, name, nodes, wires, exposed } Returns: } Validate a patch without fully compiling. Parameters: (Object) — No description in source JSDoc. Returns: } <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when


and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/synth/PatchRunner.worklet.js
Exports
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: PatchRunner.worklet.js AudioWorkletProcessor Executes a compiled patch graph at sample rate (128 samples/block). Receives compiled plans via MessagePort, reads game params from SharedArrayBuffer, and outputs synthesized audio. Register with: audioContext.audioWorklet.addModule('PatchRunner.worklet.js') Exports No ES module exports detected in this file. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/synth/ProceduralPatches.js
Functions
impactfluid(ctx, dest, p)
impactmetal(ctx, dest, p)
impactglass(ctx, dest, p)
impactstone(ctx, dest, p)
impactwood(ctx, dest, p)
impactice(ctx, dest, p)
impactcombustion(ctx, dest, p)
impactsand(ctx, dest, p)
impactdrop(ctx, dest, p)
impacthiss(ctx, dest, p)
impactcrackle(ctx, dest, p)
impactelectric(ctx, dest, p)
ambientcombustion(ctx, dest, p)
ambientfluid(ctx, dest, p)
ambientelectric(ctx, dest, p)
ambientwind(ctx, dest, p)
getImpactPatch(key)
getAmbientPatch(key)
setPatchOverride(key, param, value)
setPatchOverrides(key, overrides)
getPatchOverride(key)
clearPatchOverrides()
getAllPatchKeys()
getAllMaterialAliases()
Constants
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ProceduralPatches.js Real time procedural sound patches for particle substances Each patch is a factory: (ctx, destination, params) = { stop(), update?(params) } ctx — AudioContext destination — AudioNode (pre spatialized via PannerNode) params — { volume, pitch, speed, temperature, ... } Impact patches are one shot (auto stop). Ambient patches loop until stop() is called, and support update() for real time modulation. Functions Water/fluid impact — velocity driven splat/drip/splash. Sound design based on real water acoustics: "Plop" body: fast sine pitch sweep downward (Helmholtz cavity resonance). A water droplet traps an air bubble on impact; the bubble oscillates at a frequency that sweeps down as it grows. Duration 15 40ms. "Spray" transient: ultra short highpass noise burst (<20ms) for the broadband crack of water hitting a surface. Only audible at higher speeds. Bubble resonances: at high speed, 1 3 random short sine pips simulate secondary bubbles breaking the surface. Speed mapping: slow (< 1) → gentle drip: mostly plop body, minimal spray medium (1 4) → splat: plop + moderate spray fast ( 4) → full splash: plop + loud spray + bubble pips Metal clang — multi partial ring + noise transient Glass clink — high FM harmonics, crystalline Stone/debris thud — low filtered noise + crack + sub thump Wood knock — multi mode resonant body + knock transient Ice crack — sharp noise + crystalline inharmonic pings Fire/lava impact burst — noise burst + low boom + rumble tail Sand soft impact — muffled body + grain scatter Viscous liquid drop/drip — thicker plop than water, low resonance, no spray Gas/vapor/granular hiss — soft broadband whoosh, not a hard impact Spark/debris crackle —


liquid drop/drip — thicker plop than water, low resonance, no spray Gas/vapor/granular hiss — soft broadband whoosh, not a hard impact Spark/debris crackle — scattered hard micro transients Plasma/spark electric snap Fire/lava crackling ambient — random noise bursts + low rumble Viscous/fluid flow ambient — subtle high freq trickle. Shared by water + viscous liquids through AMBIENT PATCHES aliases. Plasma/electric buzz ambient — FM buzz + noise crackle Smoke/steam/wind ambient — airy bandpass sweep Get the impact patch function for a substance key. If runtime overrides exist for this key, returns a wrapper that merges them. Parameters: (string) — Substance key or proceduralPatch name Get the ambient patch function for a substance key. If runtime overrides exist for this key, returns a wrapper that merges them. Parameters: (string) — Substance key or proceduralPatch name Set a param override for a material patch. These overrides are merged into patch params at call time. Parameters: (string) — Material key (e.g. 'water', 'metal', 'fire') (string) — Param name ('volume', 'pitch', 'speed', 'temperature', 'quality') (number) — No description in source JSDoc. Set all overrides for a material at once. Parameters: (string) — No description in source JSDoc. (Object) — { volume, pitch, speed, temperature, quality } Get current overrides for a material. Parameters: (string) — No description in source JSDoc. Clear all runtime overrides (reset to defaults). Get all unique canonical material keys (de duplicated patch function names). Returns objects with { key, type, patchFn } for both impact and ambient. Get a flat list of all material alias keys (including duplicates). Constants — Map of proceduralPatch strings → impact patch functions — Map of proceduralPatch strings → ambient


all material alias keys (including duplicates). Constants — Map of proceduralPatch strings → impact patch functions — Map of proceduralPatch strings → ambient patch functions <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing ch


renderAndPlay(ctx, params, options = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: SfxGenerator.js — Parametric Sound Effect Generator sfxr inspired procedural SFX system. Every sound is defined by a compact parameter object — no samples needed. Renders to AudioBuffer or plays directly via Web Audio. Parameters cover: waveform, envelope, frequency sweep, vibrato, arpeggiation, duty cycle, retrigger, flanger, LP/HP filter, gain. Preset categories with randomize/mutate for instant sound creation: Pickup, Laser, Explosion, Powerup, Hit, Jump, Blip, Click, Error, Coin Usage: import { createSfxParams, randomizePreset, mutateSfx, renderSfx, playSfx } from './SfxGenerator.js'; const params = randomizePreset('laser'); const buffer = renderSfx(audioCtx, params); playSfx(audioCtx, buffer); Functions Create a default SFX parameter set. All values normalized to sensible ranges. Generate a randomized SFX from a preset category. Parameters: (string) — One of: pickup, laser, explosion, powerup, hit, jump, blip, click, coin, error Returns: SFX params Fully random SFX (no preset bias). Mutate an existing SFX params slightly (small random nudge to each param). Parameters: (Object) — Source params (number) — Mutation strength 0 1 (default 0.05) Returns: New mutated params Get list of available preset names. Render an SFX to an AudioBuffer. This is a pure software synthesizer — runs offline, produces a buffer. Parameters: (AudioContext) — Web Audio context (for sample rate and buffer creation) (Object) — SFX params from createSfxParams/randomizePreset/mutateSfx Play a rendered SFX buffer. Parameters: (AudioContext) — No description in source JSDoc. (AudioBuffer) — No description in source JSDoc. (Object) — { volume, playbackRate, destination } Render and immediately play an SFX.


in source JSDoc. (AudioBuffer) — No description in source JSDoc. (Object) — { volume, playbackRate, destination } Render and immediately play an SFX. Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. (Object) — No description in source JSDoc. Returns: } Encode SFX params to a compact JSON string. Parameters: (Object) — No description in source JSDoc. Decode SFX params from a JSON string. Parameters: (string) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: SharedParamBuffer.js Game → AudioWorklet Parameter Streaming Allocates a SharedArrayBuffer for zero copy, zero latency parameter updates from the main game thread to the AudioWorklet synthesis thread. Layout: Float32Array where each slot maps to an exposed synth parameter. The main thread writes emitter aggregate stats each frame; the worklet reads them. Functions Create a shared parameter buffer. Returns: { sharedBuffer, mainView, workletBuffer } Write emitter aggregate stats to the shared buffer. Parameters: (Float32Array) — mainView from createSharedParamBuffer (number) — 0 to MAX EMITTERS 1 (Object) — No description in source JSDoc. (number) — No description in source JSDoc. (number) — No description in source JSDoc. (number) — No description in source JSDoc. (number) — No description in source JSDoc. (number) — No description in source JSDoc. (number) — No description in source JSDoc. (number) — No description in source JSDoc. (number) — No description in source JSDoc. Clear all emitter stats (e.g. when emitters stop). Parameters: (Float32Array) — No description in source JSDoc. Clear stats for a specific emitter. Parameters: (Float32Array) — No description in source JSDoc. (number) — No description in source JSDoc. Read a single param value from the shared buffer. Parameters: (Float32Array) — Float32Array wrapping SharedArrayBuffer (number) — No description in source JSDoc. (number) — PARAM LAYOUT value Constants — Standard parameter indices for emitter → synth streaming. Each active emitter gets one set of these slots. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing


slots. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


createBlendPreset(buffers = [], config = {})

addLayer(preset, buffer, layerConfig = {})

async generateVariations(ctx, preset, count = 10)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: SoundBlender.js — Multi Layer Sound Effect Mixer Blends 2 4 sound sources (AudioBuffers) with per layer controls: Volume, pitch shift, delay offset Crossfade curves (linear, equal power, cosine) Random variation ranges per parameter Trigger modes: simultaneous, sequential, random pick, round robin Produces infinite unique variations from a small set of source sounds. Usage: import { createBlendPreset, renderBlend, playBlend } from './SoundBlender.js'; const preset = createBlendPreset([buffer1, buffer2], { layers: [ { volume: 0.8, pitch: 1.0, delay: 0, volumeRandom: 0.1, pitchRandom: 0.05 }, { volume: 0.5, pitch: 1.2, delay: 0.05, volumeRandom: 0.2, pitchRandom: 0.1 } ], mode: 'simultaneous' }); playBlend(ctx, preset); Functions Create a blend preset from source buffers and layer config. Parameters: (AudioBuffer[]) — Source audio buffers (1 4) (Object) — No description in source JSDoc. (Object[]) — Per layer settings (string) — 'simultaneous' 'sequential' 'random' 'roundrobin' (string) — 'linear' 'equalpower' 'cosine' (number) — 0 1 Returns: Blend preset Add a layer to an existing preset. Parameters: (Object) — No description in source JSDoc. (AudioBuffer) — No description in source JSDoc. (Object) — No description in source JSDoc. Remove a layer by index. Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. Play a blend preset. Returns an object with stop() method. Parameters: (AudioContext) — No description in source JSDoc. (Object) — From createBlendPreset (Object) — { destination, onEnded } Returns: } Render a blend preset to a single AudioBuffer (offline). Parameters: (AudioContext) — No description in source JSDoc. (Object) — No


onEnded } Returns: } Render a blend preset to a single AudioBuffer (offline). Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. Generate N unique variations of a blend preset. Each variation resolves random ranges differently. Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. (number) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


variationRangesFromSchema(schema, proportion = 0.1)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: SoundSchema.js — JSON Schema Definitions for All Sound Types Each schema defines every parameter with: type, min, max, step, default, label, description, unit, group Used by: AudioNodeInspector: auto generate UI controls from schema VariationGenerator: derive ranges/limits automatically Validation: validateParams() catches bad data on import/paste Sound Palette: self describing serialized entries Schema field types: 'float' → slider (min/max/step) 'int' → integer slider or number input 'enum' → dropdown (options array) 'bool' → toggle 'string' → text input 'array' → special handling per context Functions Get a schema by type name. Parameters: (string) — 'sfx', 'fm', 'karplus', 'granular', 'formant', 'blend', 'blendLayer' Get all schema names. Validate a params object against a schema. Returns { valid, errors, sanitized }. sanitized: a clean copy with missing keys filled from defaults and out of range values clamped. errors: array of { key, message } for any issues found. Parameters: (Object) — The parameter object to validate (Object) — The schema to validate against Returns: , sanitized: Object }} Create default params from a schema. Parameters: (Object) — No description in source JSDoc. Extract variation ranges from a schema (for VariationGenerator). Returns { ranges, limits } where: ranges[key] = (max min) proportion limits[key] = [min, max] Parameters: (Object) — No description in source JSDoc. (number) — What fraction of the full range to vary (default 0.1 = 10%) Returns: } Get parameter groups from a schema (for UI grouping). Parameters: (Object) — No description in source JSDoc. Returns: group name → array of param keys Constants <! HUMAN NOTES Notes & Examples Audio Graph


Parameters: (Object) — No description in source JSDoc. Returns: group name → array of param keys Constants <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


createPatchInstance(manager, patchId, options = {})

setInstanceParam(manager, instanceId, paramName, value)

destroyPatchInstance(manager, instanceId, fadeOut = 0.05)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: SynthManager.js Main Thread Synthesis Orchestrator Manages AudioWorklet registration, patch instance lifecycle, parameter updates via MessagePort and SharedArrayBuffer. Functions Create a synth manager. Parameters: (AudioContext) — No description in source JSDoc. (AudioNode) — Node to connect synth output to Initialize the synth manager — register the AudioWorklet. Parameters: (Object) — No description in source JSDoc. (string) — URL to PatchRunner.worklet.js Register a patch in the library (compile and cache). Parameters: (Object) — No description in source JSDoc. (Object) — Raw patch JSON Returns: true if compiled successfully Get a compiled patch plan. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. Create and start a patch instance (a playing synth voice). Parameters: (Object) — No description in source JSDoc. (string) — ID of registered patch (Object) — No description in source JSDoc. (number) — Output volume (default 1.0) (AudioNode) — Override destination node Returns: Instance ID Set an exposed parameter on a running instance. Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. (string) — Exposed parameter name (number) — No description in source JSDoc. Set volume on a running instance. Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. (number) — No description in source JSDoc. Stop and destroy a patch instance. Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. (number) — Seconds (default 0.05) Stop all instances. Parameters: (Object) — No description in source JSDoc. Destroy the


— No description in source JSDoc. (number) — Seconds (default 0.05) Stop all instances. Parameters: (Object) — No description in source JSDoc. Destroy the synth manager. Parameters: (Object) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


createVariationConfig(baseParams, ranges = {}, options = {})

createVariationConfigFromSchema(baseParams, schema, proportion = 0.1, options = {})

async renderVariationBatchAsync(ctx, paramsList, renderFn, onProgress = null)

writeSoundPaletteRecord(palette, storage = globalThis.localStorage)

savePalette(palette, storage = globalThis.localStorage)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: VariationGenerator.js — Automatic Sound Variation System Takes any parametric sound definition and generates N unique variations by randomizing parameters within user defined ranges. Works with: SfxGenerator params FM synthesis configs Karplus Strong configs Any flat parameter object Also provides batch rendering to AudioBuffer arrays and a sound palette system for saving/loading favorites. Usage: import { createVariationConfig, generateVariations, renderVariationBatch } from './VariationGenerator.js'; const vc = createVariationConfig(baseParams, { startFrequency: 0.1, decayTime: 0.05 }); const variations = generateVariations(vc, 20); const buffers = await renderVariationBatch(ctx, variations, renderFn); Functions Create a variation configuration. Parameters: (Object) — Base parameter object (e.g., from createSfxParams) (Object) — Per key random range amounts (absolute ±). Keys must match baseParams. (Object) — No description in source JSDoc. (boolean) — If true, variations stay within [base range, base+range]. Otherwise unclamped. (Object) — Per key [min, max] clamp limits Returns: Variation config Create a variation config from a SoundSchema. Auto derives ranges and limits from the schema definition. Parameters: (Object) — Base parameter object (Object) — Schema from SoundSchema.js (e.g., SFX SCHEMA) (number) — Fraction of full range to vary (default 0.1 = 10%) (Object) — { lockedKeys } Returns: Variation config Lock a parameter so it won't be varied. Parameters: (Object) — Variation config (string) — No description in source JSDoc. Unlock a parameter for variation. Parameters: (Object) — Variation config (string) — No description in source JSDoc. Set the random range for a


source JSDoc. Unlock a parameter for variation. Parameters: (Object) — Variation config (string) — No description in source JSDoc. Set the random range for a specific parameter. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. (number) — Absolute ± range Set per key min/max limits. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. (number) — No description in source JSDoc. (number) — No description in source JSDoc. Generate N parameter variations from a variation config. Parameters: (Object) — Variation config from createVariationConfig (number) — Number of variations to generate Returns: Array of parameter objects Generate a single variation. Parameters: (Object) — No description in source JSDoc. Render an array of parameter variations to AudioBuffers. Parameters: (AudioContext) — No description in source JSDoc. (Object[]) — Array of parameter objects (Function) — Render function: (ctx, params) = AudioBuffer Render variations async (yields between each to avoid blocking). Parameters: (AudioContext) — No description in source JSDoc. (Object[]) — No description in source JSDoc. (Function) — No description in source JSDoc. (Function) — (index, total) callback Create a sound palette for organizing favorite sounds. Add a sound to the palette. Parameters: (Object) — No description in source JSDoc. (Object) — No description in source JSDoc. (string) — No description in source JSDoc. (string) — e.g., 'sfx', 'fm', 'karplus', 'blend' (Object) — The parameter object (string[]) — Optional tags Returns: Entry ID Remove a sound from the palette. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. Find sounds in the palette by category or tag.


the palette. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. Find sounds in the palette by category or tag. Parameters: (Object) — No description in source JSDoc. (Object) — { category?, tag?, name? } Save palette to localStorage. Parameters: (Object) — No description in source JSDoc. Load palette from localStorage. Export palette as JSON string (for sharing/backup). Parameters: (Object) — No description in source JSDoc. Import palette from JSON string. Parameters: (string) — No description in source JSDoc. Constants <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form proces


buildVoice(ctx, patch, pitchRatio = 1.0)

createWebAudioNode(ctx, node, pitchRatio = 1.0)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: WebAudioNodeFactory.js — Unified Web Audio Node Factory Central factory for creating main thread Web Audio nodes from patch graph node definitions. Delegates to modular node files where possible. Used by AudioEditorPanel.js for preview playback. Usage: import { createWebAudioNode, buildVoice } from './WebAudioNodeFactory.js'; const node = createWebAudioNode(ctx, { type: 'Waveguide', params: {...} }, pitchRatio); const voice = buildVoice(ctx, patchJSON, pitchRatio); Functions Normalize oscillator wave shape names to Web Audio API values. Build a complete voice from a patch graph, scaling frequencies by pitchRatio. Parameters: (AudioContext) — No description in source JSDoc. (Object) — { nodes: [...], wires: [...] } (number) — No description in source JSDoc. Returns: null} Create a Web Audio node (or subgraph) for a given patch graph node definition. Returns { output, input, inputMap?, sources } or null. Parameters: (AudioContext) — No description in source JSDoc. (Object) — { id, type, params } (number) — Frequency scaling factor <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens


AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/synth/index.js
Re-exports
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: engine/audio/synth/index.js — Barrel export for procedural synthesis engine. Re exports , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


playFM(ctx, config = {}, destination = null)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: FMOperatorNode.js — FM Synthesis Engine Frequency Modulation synthesis: one oscillator (modulator) modulates the frequency of another (carrier), producing complex harmonic and inharmonic timbres from simple parameters. Supports up to 4 operators in series/parallel configurations. Each operator has: frequency ratio, detune, envelope, feedback. Usage: import { renderFM, playFM, createFMPatch } from './FMOperatorNode.js'; const buffer = renderFM(audioCtx, { carrierFreq: 440, modRatio: 2, modDepth: 200 }); Functions Render 2 operator FM synthesis to an AudioBuffer. Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. Render a 4 operator FM stack. Operators are chained: op4 → op3 → op2 → op1 (carrier). Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. (Object[]) — Array of 4 operator configs Play FM synthesis directly. Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. (AudioNode) — No description in source JSDoc. Get list of FM preset names. Constants <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects


Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


setFormantFrequencies(instance, frequencies, bandwidths, gains)

morphFormants(instance, vowelA, vowelB, blend)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: FormantFilterNode.js — Formant Filter for Vocal/Creature Sounds Parallel bank of bandpass filters tuned to vocal formant frequencies. Shapes any input signal into vowel like resonances. Useful for: Creature vocalizations Vocal pads and textures Talking/singing synthesis Resonant environmental effects Includes presets for standard vowels (A, E, I, O, U) and creature sounds. Usage: import { createFormantFilter, setFormantVowel, destroyFormantFilter } from './FormantFilterNode.js'; const filter = createFormantFilter(audioCtx); sourceNode.connect(filter.input); filter.output.connect(audioCtx.destination); setFormantVowel(filter, 'A'); Functions Create a formant filter bank. Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. (string) — Initial vowel preset name (default 'A') (number) — Number of formants to use 1 5 (default 5) (number) — Time to morph between vowels in seconds (default 0.1) Returns: Formant filter instance Set the formant filter to a vowel preset. Parameters: (Object) — No description in source JSDoc. (string) — Key from FORMANT PRESETS Set formant frequencies directly (bypass presets). Parameters: (Object) — No description in source JSDoc. (number[]) — Array of formant frequencies (number[]) — Array of bandwidths (number[]) — Array of gain values Morph between two vowel presets. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. (string) — No description in source JSDoc. (number) — 0 = fully A, 1 = fully B Set morph time (transition speed). Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. Destroy the formant filter and


morph time (transition speed). Parameters: (Object) — No description in source JSDoc. (number) — No description in source JSDoc. Destroy the formant filter and release resources. Parameters: (Object) — No description in source JSDoc. Get list of available formant preset names. Constants <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


createGranularEngine(ctx, buffer, config = {})

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Create a granular synthesis engine. Parameters: (AudioContext) — No description in source JSDoc. (AudioBuffer) — Source sample to granulate (Object) — No description in source JSDoc. Returns: Granular engine instance Start the granular engine — begins spawning grains. Parameters: (Object) — No description in source JSDoc. Stop the granular engine. Parameters: (Object) — No description in source JSDoc. (number) — Fade out in seconds Set a granular parameter. Parameters: (Object) — No description in source JSDoc. (string) — No description in source JSDoc. ( ) — No description in source JSDoc. Replace the source buffer. Parameters: (Object) — No description in source JSDoc. (AudioBuffer) — No description in source JSDoc. Connect granular output to a destination. Parameters: (Object) — No description in source JSDoc. (AudioNode) — No description in source JSDoc. Destroy and clean up. Parameters: (Object) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All


graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/synth/nodes/ImpulseNode.js
Functions
createImpulseEngine(ctx, config = {})
generateImpulseBuffer(ctx, config = {})
isValidImpulseShape(shape)
Constants
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Create a real time impulse generator engine. Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. Returns: Engine instance Generate a single impulse as an AudioBuffer. Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. Constants <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


playKarplusStrong(ctx, config = {}, destination = null)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: No file level description found in source. Add one as a leading JSDoc comment, or document it below. Functions Render a Karplus Strong plucked string to an AudioBuffer. Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. (number) — Pitch in Hz (default 220) (number) — Decay time in seconds (default 2.0) (number) — LP filter amount 0 1 (1=bright, 0=dark) (default 0.5) (string) — 'noise' 'impulse' 'sine' (default 'noise') (number) — Allpass stretch factor 0 1 (default 0) (number) — Output volume 0 1 (default 0.8) (number) — Max render duration in seconds (default decay 1.5) Play a Karplus Strong sound directly. Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. (AudioNode) — No description in source JSDoc. <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas:


conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


audio/synth/nodes/MidiInputNode.js
Functions
async requestMidiAccess()
getMidiInputs()
createMidiInput(config = {})
createMidiCCMap(config = {})
Constants
Notes & Examples
Audio Graph Architecture
Audio Graph Architecture

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: MidiInputNode.js — MIDI Input Integration Receives MIDI input from external controllers or DAW via Web MIDI API. Outputs gate, note, velocity, and CC signals for driving synth nodes. Usage: import { createMidiInput, requestMidiAccess } from './MidiInputNode.js'; await requestMidiAccess(); const midi = createMidiInput({ channel: 0 }); midi.onNoteOn = (note, velocity) = synth.noteOn(note, velocity); Functions Request MIDI access from the browser. Returns: True if access granted Get list of available MIDI inputs. Returns: } Create a MIDI input node that processes incoming MIDI messages. Parameters: (Object) — No description in source JSDoc. (number) — MIDI channel (0 15, or 1 for omni) (number) — CC number to track (number) — Note transpose amount (string) — Velocity response curve Returns: MIDI input instance Create a CC mapper that scales CC values to a target range. Parameters: (Object) — No description in source JSDoc. Constants <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain See also: Audio · Engine Overview Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay, reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a


reverb) → destination (speakers). All processing happens on the audio thread via the Web Audio API with automatic sample rate conversion. Example: Creating a sound effect chain Advanced: Loading and playing audio assets Advanced: 3D spatial audio Advanced: Mixing and buses Gotchas: AudioContext state : Browsers block audio until user interaction. Call after a click. Memory : holds raw PCM — unload large files when not needed. Scheduling : Use for precise rhythm; drifts vs . See also: Audio · Engine Overview


calculateModeFrequencies(formula, f0, modeCount, inharmonicity = 0)

calculateModeAmplitudes(modeCount, strikePosition, brightness = 0.5)

calculateModeDecays(frequencies, baseDamping, highDamp, f0)

<! AUTOGENERATED by tools/extract api.py — content above HUMAN NOTES is overwritten Source: ModalBankNode.js — Modal Synthesis Engine Physical modeling using parallel resonant filters (modes). Each mode has frequency, amplitude, and decay characteristics. Material presets auto calculate modes based on: Stiff string formula (metal, piano strings) Beam formula (wood, glass bars) Circular membrane formula (drums) Rectangular plate formula (bells, gongs) Usage: import { createModalBank, MODAL MATERIALS } from './ModalBankNode.js'; const bank = createModalBank(audioCtx, { material: 'metal', frequency: 440 }); bank.excite(impulseBuffer); Functions Calculate modal frequencies based on material formula. Parameters: (string) — 'stiffString', 'beam', 'circularMembrane', 'plate' (number) — Fundamental frequency (number) — Number of modes to generate (number) — Stretch factor B Returns: Array of mode frequencies Calculate mode amplitudes based on strike position. Parameters: (number) — Number of modes (number) — 0 1 position along resonator (number) — Spectral tilt 0 1 Returns: Array of mode amplitudes Calculate mode decay times based on frequency and damping. Parameters: (number[]) — Mode frequencies (number) — Base decay time (0 1, higher = longer) (number) — High frequency damping (0 1, higher = more damping) (number) — Reference frequency for scaling Returns: Array of decay times in seconds Create a modal bank synthesis engine. Parameters: (AudioContext) — No description in source JSDoc. (Object) — No description in source JSDoc. Returns: Modal bank instance Constants <! HUMAN NOTES Notes & Examples Audio Graph Architecture The audio system uses a node based graph architecture. AudioNodes connect to form processing chains: sources (oscillator, buffer) → effects (filter, delay,