removeUserMappingsForCC(status, data1) <-- Does this exist?

Post Reply New Topic
RELATED
PRODUCTS

Post

Hello,
I'm pretty sure this function does not exist on the api, but it was what ChatGPT told me I should use. It of course crashes the script I'm making with an "Unknown identifier" error.
The thing is ChatGPT insists so much that it does exist, even saying that the fact that it is not included in the api documentation is a mistake made by Bitwig developers, that I thought I should come here and ask.
I know many times ChatGPT uses deprecated stuff, or even makes stuff up, but usually when called out for doing it it apologizes and looks for an alternative, but this time it is not bending. This function does exist and all of you humans are wrong.

For some context:
I am making a script for a custom diy controller. The controller is going to send CCs 1-108 to be freely mappable, and CCs 119-127 for internal communication for the particular stuff this controller is going to do. These last CCs should not be mappable by the user, but they do get mapped, no matter how I filter them. This is the onMidi function:

Code: Select all

function onMidi0(status, data1, data2) {
   // TODO: Implement your MIDI input handling code here.
   //printMidi(status, data1, data2); //mostrar midi recibido en Script Command
   if (isChannelController(status)){
         if (data1 > HIGHEST_CC){ //HIGHEST_CC = 108
            //host.removeUserMappingsForCC(status, data1);  <--This is supposed to not let these CCs get mapped, according to ChatGPT
            return;
         }else{
            println(data1);
            var index = data1 - LOWEST_CC + ((HIGHEST_CC-LOWEST_CC+1) * MIDIChannel(status));
            var increment = data2 > 64 ? data2-128 : data2;
            userControls.getControl(index).inc(increment, 128); //AQUI INC EN VEZ DE SET
         }
   }
}
Edit: typo

Edit2: I'm thinking that maybe, since what I want to communicate from the controller is internal stuff, I should be using a different type of midi message. This would be my first time using messages other than notes and CCs.
I'm seeing here all the types of midi messages there are, do you guys know which would be the most up to standard way for the controller to say "I changed the midi channel" and "I changed the scene"?
https://www.midi.org/midi-articles/abou ... i-messages

Post

Hello again.
I ended up using Program Change 1-16 to tell the script the midi channel the controller is on, and Program Change 20-31 to tell the script the scene it is on, so this thread has been solved.

Post

Yeah, unfortunately pretty much all midi data that is sent while Remote Mapping is on gets absorbed by the UserControls. AFIK, there is no way to modify/add/remove UserControls from code.
----------------------------------------------------------------------
http://instagram.com/kirkwoodwest/
http://soundcloud.com/kirkwoodwest

Post

Thank you!
It's ok, I ended up using Program Change messages for that non CC stuff and it is working great like this :)

Post Reply

Return to “Controller Scripting”