-
-
Notifications
You must be signed in to change notification settings - Fork 17
Key Modifier Manager
spessasus edited this page Mar 2, 2025
·
1 revision
This powerful tool allows modifying each key on each channel to your needs.
It is accessible via the synth.keyModifierManager
property.
Currently, it supports overriding:
- the velocity of that note
- the preset used on that note
This function modifies a single key.
synth.keyModifierManager.addModifier(channel, midiNote, options);
- channel - the MIDI channel to use. It usually ranges from 0 to 15, but it depends on the channel count.
- midiNote - the MIDI note to modify. Ranges from 0 to 127.
- options - the note's modifiers. An
Object
:- velocity -
number
- optional. Forces this key on this channel to be the given velocity. Unchanged if undefined. - patch -
Object
- optional. Forces this key on this channel to play with the given patch.- program -
number
- the program number of the desired patch. - bank -
number
- the bank number of the desired patch. - Note that both
program
andbank
must be provided if thepatch
option is used.
- program -
- velocity -
Clears the modifier from a note, making it behave normally.
synth.keyModifierManager.deleteModifier(channel, midiNote)
- channel - the MIDI channel to use. It usually ranges from 0 to 15, but it depends on the channel count.
- midiNote - the MIDI note to modify. Ranges from 0 to 127.
Get the key modifier for a given key on a given channel. Returns undefined
if there's none.
synth.keyModifierManager.getModifier(channel, midiNote)
- channel - the MIDI channel to use. It usually ranges from 0 to 15, but it depends on the channel count.
- midiNote - the MIDI note to modify. Ranges from 0 to 127.
The returned value is a KeyModifier
object.
Clears ALL modifiers in this synthesizer instance.
synth.keyModifierManager.clearModifiers();
Tip
If you encounter any errors in this documentation, please open an issue!
Warning
Make sure you always update worklet_processor.min.js
along with the npm package!