-
Notifications
You must be signed in to change notification settings - Fork 5
Web MIDI API
SpessaSynth provides an easy way to connect physical MIDI Devices
to it and back using MIDIDeviceHandler.
Tip
If you encounter any errors in this documentation, please open an issue!
Tip
Using the npm package? Make sure you've read this
const MIDIHandler = new MIDIDeviceHandler();The MIDI inputs as MIDIInputMap.
The MIDI outputs as MIDIOutputMap.
Initializes the connection to physical MIDI Devices.
MIDIHandler.createMIDIDeviceHandler();The returned value is boolean, true if succeeded, false if failed.
Important
This function is asynchronous.
Connects a Sequencer instance to a MIDI Output, playing back the sequence to it.
MIDIHandler.connectMIDIOutputToSeq(output, seq);- output - a
MIDIOutputto connect to. - seq - a
Sequencerinstance to connect.
Disconnects all MIDI devices from the sequencer.
MIDIHandler.connectMIDIOutputToSeq(seq);- seq - a
Sequencerinstance to disconnect.
Connects a MIDI Input to a Synthetizer instance, responding to all received messages.
MIDIHandler.connectDeviceToSynth(input, synth);- input - a
MIDIInputto connect. - synth - a
Synthetizerinstance to connect to.
Disconnects all MIDI Inputs from the Synthetizer instance.
MIDIHandler.disconnectAllDevicesFromSynth();No arguments as this simply removes the onmidimessage property from the inputs.