I am attempting to write my own scripts for Cubase’s MIDI Remote feature. Unfortunately, the available instructions seem to omit essential information or assume a level of common knowledge that I don’t possess.
I have experience building my own hardware controllers and writing the C++ code for them, which I’ve successfully used with Cubase’s Generic Remote feature so far. Now, I’m keen to explore the new possibilities offered by MIDI Remote scripting.
I’ve managed to get the simple device example set up using VS Code, and it correctly appears within Cubase. However, beyond this point, the MIDI Remote API documentation seems to jump almost directly into the API reference details, offering little guidance on the necessary script structure.
For example, my goal is to send the RGB color values of the currently selected track as three separate MIDI controller values. I found the following function in the API documentation:
mOnColorChange : function (activeDevice : ActiveDevice, r : number, g : number, b : number, a : number, isActive : boolean)
My confusion lies in understanding when this function is triggered. Does it need to be explicitly called, perhaps within an if
statement? Or does the script operate in a loop, constantly checking the state? Is it event-driven?
I’ve consulted general JavaScript tutorials, but they haven’t clarified these specific aspects of the MIDI Remote environment.
I would be very grateful if someone could point me towards resources (like tutorials, examples, or clearer explanations) that could help bridge this knowledge gap, specifically regarding script structure and event handling within the MIDI Remote API.