Skip to main content

New in MIDI Remote v1.1

Version 1.1 of the MIDI Remote API introduces two new features.

1. Support for Touch Sensitive Controls

Compatibility note
For your script to remain compatible with Cubase 12 (MIDI Remote API 1.0), the touch state feature has to be tested for existence (wrapped inside an if-statement) before being used.

A touch sensitive fader can be implemented like this:

...

var fader = driver.mSurface.makeFader(0, 0, 1, 6)
fader.mSurfaceValue.mMidiBinding.setInputPort(midiInput).setOutputPort(midiOutput).bindToPitchBend(0)

// !!! Important !!!
// Test for the existing TouchState feature
// to make the script compatible with Cubase 12 as well
if(fader.mSurfaceValue.mTouchState) {
// create a custom value variable to bind agains the touch state midi message
var faderTouchValue = driver.mSurface.makeCustomValueVariable('faderTouch1')
faderTouchValue.mMidiBinding.setInputPort(midiIn).bindToNote(0, 104)

// bind the custom value variable to the TouchState member. (new in API 1.1)
fader.mSurfaceValue.mTouchState.bindTo(faderTouchValue)
}

...

2. Options to register Idle Callbacks

Compatibility note
As the Idle Callback feature is only a member value that can be assigned a function, no further compatibility coding is necessary. Just be aware that in Cubase 12, those callbacks do not work. So it is up to you to use them in a way that the script is still useful in Cubase 12 without those callbacks being called.

Idle Callback on active mapping page

var driver = midiremote_api.makeDeviceDriver("Test", "Test", "Test")
var midiInput = driver.mPorts.makeMidiInput('midiInput')
var midiOutput = driver.mPorts.makeMidiOutput('midiOutput')

var page = driver.mMapping.makePage('Default')

page.mOnIdle = function(activeDevice, activeMapping) {
console.log('Default PAGE ON IDLE')
}

Idle Callback on activated device driver

This callback cannot access functions related to the current mapping page. In most cases you will want to use the Idle Callback on a mapping page instead.
var driver = midiremote_api.makeDeviceDriver("Test", "Test", "Test")
var midiInput = driver.mPorts.makeMidiInput('midiInput')
var midiOutput = driver.mPorts.makeMidiOutput('midiOutput')

driver.mOnIdle = function(activeDevice) {
console.log('DRIVER ON IDLE')
}