OAVp5.devices#
variableoav-p5OAVp5.devices
The names of the MIDI controllers plugged in, as the browser reports them: an array of text, empty when there is none.
Use it for a line like "playing: Arturia MiniLab3", or to tell whether a real controller is there. The names are whatever the operating system calls the port, so match them loosely (name.toLowerCase().includes('minilab')). The 🎹 panel uses them to follow the controller that is plugged in.
- Type
Array<String>
One entry per connected input port. Replaced whenever a device is plugged in or out. Empty until Web MIDI has been allowed (OAVp5.hardware), and it never lists the on-screen controller or the phone.
Notes
midi.devicesis the same array, replaced as a whole, not changed in place: read it again after a change.
Examples
function setup() {
createCanvas(400, 300);
}
function draw() {
background(20);
fill(255);
text(OAVp5.devices.length ? 'playing: ' + OAVp5.devices.join(', ') : 'no MIDI controller plugged in', 20, 30);
}Related
OAVp5.hardwareWhere Web MIDI stands:'off','asking','connected','waiting','denied'or'unavailable'.OAVp5.connectHardware()Asks the browser for Web MIDI now, and returns a promise that says whether a real controller can be heard.profileWhich controller the on-screen 🎹 shows, by profile id such asakai-lpd8; by default it follows the one that is plugged in.hardwareWhen oav-p5 asks the browser for Web MIDI, which a real controller needs:autoat load,clickwhen the 🎹 panel opens, oroff.