I've made the rather controversial decision to use WebMIDI.constants.COMMAND 0xA0 to mean CUSTOMCONTROL_CHANGE rather than AFTERTOUCH (as in standard MIDI).
The MIDI standard was conceived before the advent of software synthesizers, so it has a few shortcomings...
This decision means
that custom controls can be defined freely by software synthesizers, without conflicting with the normal, standard controls (defined under WebMIDI.constants.COMMAND.CONTROL_CHANGE).
software synthesizers that implement aftertouch (such as the cwMIDISynth) can do so as follows:
define the following two custom controls in the synth's controls[] attribute: { name: "aftertouchKey", index: 126, defaultValue:0 } { name: "aftertouchPressure", index: 127, defaultValue:0 }
set aftertouch by sending these two control messages in sequence. (This is rather like the standard MIDI approach to sending hi- and lo-byte values for a control.)
Host software that needs to send messages to both hard- and software synthesizers can set aftertouch by calling the setAftertouch(...) function defined in WebMIDI/utilities.js.
I've made the rather controversial decision to use WebMIDI.constants.COMMAND 0xA0 to mean CUSTOMCONTROL_CHANGE rather than AFTERTOUCH (as in standard MIDI).
The MIDI standard was conceived before the advent of software synthesizers, so it has a few shortcomings...
This decision means
{ name: "aftertouchKey", index: 126, defaultValue:0 }
{ name: "aftertouchPressure", index: 127, defaultValue:0 }
Host software that needs to send messages to both hard- and software synthesizers can set aftertouch by calling the setAftertouch(...) function defined in WebMIDI/utilities.js.