Things in WebMidi.js 2.52 that make me go huh?
I have been using the WebMidi.js library to:
Control parameters in p5.js sketches
Switch scenes and controls audio volume in OBS through Websockets.js
Change patch banks on a Roland D2
While writing the code I have come across several design decisions that made me go huh.
Parameter channel is the second or later argument in many methods.
I am used to thinking of MIDI functions as being action like Note On or Control Change followed by the channel then any values.
I see you buried the channel argument inside options in 3.0
parameter channel default is all
I can't see sending a Note On to all 16 MIDI channels.
PlayNote and StopNote have a default Velocity Range as a float from 0.0 to 1.0
I have to add a rawVelocity=true inside options to have it interpreted as 0-127
Why is the default a float?
value for a Control Change isn't a float.
The default value for Velocity is 0.5
Why 0.5? why not 127
You mention that Webmidi.js will append an RPN call to clear the parameters after an NRPN call in this forum post:
This is not documented publicly anywhere.
I look at NRPN as setting the Parameter Number once and then just sending the Value I want the NRPN to set to.
I could see doing the reset in an onunload event, but not for every single NRPN call.
I tested this with a Korg Electribe EA-1 which requires NRPN calls to change parameters even though no value ever goes above 127.
The setNonRegisteredParameter method and sending Control Changes 99, 98 and 6
sendControlChange Control Code numbers are restricted to 0-119.
That's great if you are working with a hardware device like a synth, but not when I am working with a device that I can freely assign CC numbers like a USB MIDI controller