Pitch Bend, manufacturer field and filtering MIDI devices has landed!
The new version of MIDIVal has been just released with many improvements! Here’s the summary.
Support for Pitch Bend
Pitch bend in an expression tool allowing you to shift up and down notes that you are playing, commonly used for bend or vibratto effect. MIDI standard provides a way to send pitch bend messages as 14-bit numbers, but because the whole protocol is 8-bit, a bit more extra work is needed to encode and decode such messages. The new MIDIVal version converts those messages to the range between -1.0 and 1.0 so you don’t have to worry about the implementation details anymore. It works seemlesly with both MIDIValInput and MIDIValOutput object.
input.onPitchBend((bend, midiMessage) => {
console.log("BEND:", bend); // value in range of <-1.0, 1.0>
});
output.sendPitchBend(0.5);
.sendPitchBend
throws an error when trying to send a value from outside the range.
Manufacturer field is now exposed
IMIDIInput
and IMIDIOutput
(as well as their implementations) now expose manufacturer property which can be helpful when filtering the devices you want to connect to.
Ability to listen to subset of devices
Sometimes you want to listen to a specific device being connected or a device from a specific manufacturer. Now you can do it using either exact string matching or regex in the following way:
MIDIVal.onInputDeviceWithConfigConnected({
manufacturer: /Korg/i,
name: /^minilogue/i
}, (device: MIDIValInput) => {
console.log(device);
});
Changes to .onLocalControlChange
The callback for onLocalControlChange
method now takes boolean as a first parameter.
New Methods
Added new methods for Control Change modes:
.onOmniModeOff
- .
onOmniModeOn
.onMonoModeOn
.onPolyModeOn
What’s next?
For the next version of the library I plan to add methods for handling MIDI Clock — this is an exciting milestone that will enable to synchronise your browser with your MIDI device beat or send the clock signal to the device.