Optional cacophony: CacophonyPrivate Optional cacophonyPrivate eventPrivate globalReturns a boolean indicating whether the object is currently playing. an object is playing if any of its playbacks are currently playing.
True if the object is playing, false otherwise.
Retrieves the current 3D spatial position of the sound in the audio context. The position is returned as an array of three values[x, y, z].
The current position of the sound.
Sets the 3D spatial position of the sound in the audio context. The position is an array of three values[x, y, z]. This method updates the position of all active playbacks of the sound.
The new position of the sound.
Adds a BiquadFilterNode to the container's filter chain. Filters are cloned when creating new playbacks - existing playbacks are not affected. Each playback gets independent filter instances for isolated processing.
The filter to add to the chain.
Clones the current Synth instance, creating a deep copy with the option to override specific properties.
This method allows for the creation of a new, independent Synth instance based on the current one, with the
flexibility to modify certain attributes through the overrides parameter. This is particularly useful for
creating variations of a synth without affecting the original instance. The cloned instance includes all properties,
playback settings, and filters of the original, unless explicitly overridden.
An object specifying properties to override in the cloned instance. This can include audio settings like volume, playback rate, and spatial positioning, as well as more complex configurations like 3D audio options and filter adjustments.
A new Synth instance that is a clone of the current synth.
Private createProtected emitProtected emitFades in all playbacks from silence to their current volume.
The fade duration in milliseconds.
Optional type: FadeTypeThe fade curve type. Defaults to "linear".
Resolves when all fades complete.
Fades out all playbacks from their current volume to silence.
The fade duration in milliseconds.
Optional type: FadeTypeThe fade curve type. Defaults to "linear".
Resolves when all fades complete.
Fades the volume of all playbacks to a target value over a duration.
The target volume (0 to 1).
The fade duration in milliseconds.
Optional type: FadeTypeThe fade curve type. Defaults to "linear".
Resolves when all fades complete.
Remove event listener.
Register event listener.
Cleanup function
Generates a Playback instance for the synth without starting playback. This allows for pre-configuration of playback properties such as volume and position before the synth is actually played.
An array of SynthPlayback instances that are ready to be played.
Removes a BiquadFilterNode from the container's filter chain. Only affects future playbacks - existing playbacks retain their cloned filters.
The filter to remove from the chain.
If the filter was never added to this container.
Fades out all playbacks then stops them.
The fade-out duration in milliseconds.
Optional type: FadeTypeThe fade curve type. Defaults to "linear".
Resolves when the fade completes and all playbacks are stopped.
The base interface for any sound-producing entity, including individual sounds, groups, and playbacks. BaseSound