Creates a new instance of an AudioWorklet-based synthesizer.
The audio context.
Optional configuration for the synthesizer.
ReadonlycontextSynthesizer's parent audio context instance.
ReadonlyconvolverThe AudioNode that processes the synthesizer's captured reverb tail through a Web Audio ConvolverNode.
ReadonlyeventThe synthesizer's event handler. It allows setting up custom event listeners for the synthesizer.
ReadonlyisA promise that gets resolved when the synthesizer gets fully initialized.
ReadonlymidiThe synthesizer's (virtual) MIDI channels.
The current preset list of the synthesizer, including all sound banks with their offsets set through the SoundBankManager.
ReadonlysoundThe synthesizer's sound bank manager. It allows managing the sound bank list.
The connected BaseAudioContext's time.
The GlobalMIDIParameters of the synthesizer. These are only editable via MIDI messages.
The GlobalSystemParameters of the synthesizer. These are only editable via the API.
The current amount of voices (notes) being synthesized. A real-time value.
Adds a new channel to the synthesizer.
The channel appears in BasicSynthesizer.midiChannels once the core confirms it with a
channelAdded event.
Apply pressure to the given channel. It usually controls the vibrato amount.
The MIDI channel to use. It usually ranges from 0 to 15, but it depends on the channel count.
The pressure to apply. Ranges from 0 to 127. 0 means no pressure, 127 means max.
Additional options for this command.
Connects the synthesizer to a given AudioNode.
The node to connect to.
The destination node.
Connects a given channel output to the given audio node. Note that this output is only meant for visualization and may be silent when an insertion effect for this channel is enabled.
The node to connect to.
The channel number to connect to, will be rolled over if value is greater than 15.
The target node.
Set a given MIDI controller to a given value.
The MIDI channel to use. It usually ranges from 0 to 15, but it depends on the channel count.
The MIDI CC number of the controller to change.
The value to set the given controller to. Ranges from 0 to 127.
Additional options for this command.
Properly disposes of the synthesizer along with its audio nodes and the core. All pending operations (such as loading a sound bank) are rejected.
Disconnects the synthesizer from a given AudioNode.
The node to disconnect from.
The destination node.
Disconnects a given channel output from the given audio node.
The node to disconnect from.
The channel number to disconnect, will be rolled over if value is greater than 15.
Returns a ChannelMergerNode with all 16 channel outputs merged into a single one, with multiple channels, layered as follows:
This is intended for offline audio rendering via OfflineAudioContext to allow extraction of separate channels.
Gets the current SynthesizerSnapshot of the synthesizer.
Locks or unlocks a given GlobalMIDIParameter. This prevents any changes to it until it's unlocked.
The Global MIDI Parameter to lock.
If the parameter should be locked.
Stops playing a note.
The MIDI channel to use. It usually ranges from 0 to 15, but it depends on the channel count.
The MIDI note number to stop. Ranges from 0 to 127.
Additional options for this command.
Starts playing a note.
The MIDI channel to use. It usually ranges from 0 to 15, but it depends on the channel count.
The MIDI note number to play. Ranges from 0 to 127.
Controls how loud the note is. Ranges from 0 to 127, where 127 is the loudest and 1 is the quietest.
Additional options for this command.
Change the channel's pitch, including the currently playing notes.
The MIDI channel to use. It usually ranges from 0 to 15, but it depends on the channel count.
The 14-bit pitch value. Ranges from 0 to 16383 where 8192 is no pitch change.
Additional options for this command.
Change the channel's pitch bend range in semitones. It uses Registered Parameter Number controllers internally.
The MIDI channel to use. It usually ranges from 0 to 15, but it depends on the channel count.
The bend range in semitones.
Additional options for this command.
Apply pressure to the given note on a given channel. It may be bound to specific parameters with system exclusive messages to allow for extra controls, such as per-note pitch wheel.
The MIDI channel to use. It usually ranges from 0 to 15, but it depends on the channel count.
The MIDI note number to apply pressure to. Ranges from 0 to 127.
The pressure to apply. Ranges from 0 to 127.
Additional options for this command.
Changes the program for the given channel.
The MIDI channel to use. It usually ranges from 0 to 15, but it depends on the channel count.
The MIDI program number to use. Ranges from 0 to 127.
Additional options for this command.
Fully resets the synthesizer to GS mode.
Yes please!
Cranks the reverb up to the max and returns a string that says: That's the spirit!
Sends a raw MIDI message to the synthesizer.
The MIDI message to process.
Adds to the channel number of the message. It defaults to 0.
Additional options for this command.
Sets spessasynth_core's log level in the processor.
Enable info (verbose)
Enable warnings (unrecognized messages)
Enable groups (to group a lot of logs)
Starts an offline audio render.
The configuration to use for rendering.
Stop all notes. Equivalent of MIDI "panic".
If the notes should immediately be stopped, defaults to false.
Sends a MIDI Sysex message to the synthesizer.
The message's data, excluding the F0 byte, but including the F7 at the end.
The channel offset for the message as they usually can only address the first 16 channels. For example, to send a system exclusive on channel 16 (0-based), send a system exclusive for channel 0 and specify the channel offset to be 16.
Additional options for this command.
// Send a GS DT1 Use Drums On Channel 10 (turn channel 10 into a drum channel)
synth.systemExclusive([
0x41, 0x10, 0x42, 0x12, 0x40, 0x1a, 0x15, 0x01, 0x10, 0xf7
]);
// Send the same message with a channel offset of 10 (turn channel 20 into a drum channel)
synth.systemExclusive(
[0x41, 0x10, 0x42, 0x12, 0x40, 0x1a, 0x15, 0x01, 0x10, 0xf7],
10
);
Tunes individual MIDI key numbers on a given program using the MIDI Tuning Standard. Think of it as a pitch wheel but for individual notes.
The MIDI program to tune. Ranges from 0 to 127.
An array of tunings, each containing two properties:
sourceKey - The MIDI note number to tune.targetPitch - The MIDI note number of the target pitch.
Fractional values are allowed, for example, 60.5 is C plus 50 cents.
A targetPitch of -1 restores the default tuning.
This synthesizer uses an AudioWorklet node to provide real-time playback.