So, my situtation is, that i am trying to create NoteInput for my controller and i want to use as a name the same name which is visible for input/output chooser in the control panel for controllers in bitwig configuration for controllers, as i would connect two of the controllers to bitwig, and i want them to use separatly as note inputs.
It seems for me that only way to get the real name of the controllers is to use
host.hardwareDevice(0) and then get the name from returned HardwareDevice object.
assuming that i have this chunk of code:
host.defineMidiPorts(1, 1);
host.addDeviceNameBasedDiscoveryPair(['my device'],['my device']);
function init() {
const midiIn = host.getMidiInPort(0); //works fine
const hw = host.hardwareDevice(0); // throws error that such index does not exists in the list
const ni = midiIn.createNoteInput('my device'); //i want to use real name of the midi device here instead of hardcoding it
}
What am i doing wrong? Or how to get the real name of the controller ?
For now i am using workaround that the script is configured for two controllers, and passing their "index" nnumber to method for creating the NoteInput with different names. But sometimes it might happen that i have connected only one of those controllers.
how to use host.hardwareDevice or get real name of the controller as seen by bitwig ? (javascript)
- KVRist
- 393 posts since 12 Apr, 2020
you can double click the name of the control surface in the Controllers Section. Change it to something unique. Then that name will be used as a prefix to your note input.
----------------------------------------------------------------------
/CTRL → http://slashctrl.io
Music & mixes → http://soundcloud.com/kirkwoodwest
/CTRL → http://slashctrl.io
Music & mixes → http://soundcloud.com/kirkwoodwest
