New in MIDI Remote v1.2
Version 1.2 of the MIDI Remote API introduced the first full DirectAccess feature set and additional host/runtime helpers.
Supported host versions: Cubase / Nuendo 13.
Deep dive:
1. DirectAccess Core API
API 1.2 introduced makeDirectAccess(...) on page.mHostAccess, including lifecycle, traversal, object metadata, and parameter access methods.
var driver = midiremote_api.makeDeviceDriver('ExampleCompany', 'DA Device', 'Example Author')
var page = driver.mMapping.makePage('DA Core')
var hostObject = page.mHostAccess.mTrackSelection.mMixerChannel
if (page.mHostAccess.makeDirectAccess) {
var da = page.mHostAccess.makeDirectAccess(hostObject)
page.mOnActivate = function (activeDevice, activeMapping) {
da.activate(activeMapping)
var rootObjectID = da.getBaseObjectID(activeMapping)
var childCount = da.getNumberOfChildObjects(activeMapping, rootObjectID)
console.log('DA root child count = ' + childCount)
}
page.mOnDeactivate = function (activeDevice, activeMapping) {
da.deactivate(activeMapping)
}
}
Compatibility note
When supporting API 1.1 hosts, guard `makeDirectAccess(...)` with a feature check before using it.
When supporting API 1.1 hosts, guard `makeDirectAccess(...)` with a feature check before using it.
2. Host App Version String
API 1.2 added mDefaults.mAppVersion.getVersionString().
if (midiremote_api.mDefaults && midiremote_api.mDefaults.mAppVersion && midiremote_api.mDefaults.mAppVersion.getVersionString) {
var hostVersion = midiremote_api.mDefaults.mAppVersion.getVersionString()
console.log('Host version: ' + hostVersion)
}
3. Mixer Visibility/Index/Zone Helpers in DirectAccess
API 1.2 added mixer helper methods on DirectAccess:
isMixerChannelVisible(...)getMixerChannelIndex(...)getMixerChannelZone(...)
var objectID = da.getBaseObjectID(activeMapping)
var isVisible = da.isMixerChannelVisible(activeMapping, objectID)
var channelIndex = da.getMixerChannelIndex(activeMapping, objectID)
var channelZone = da.getMixerChannelZone(activeMapping, objectID)
console.log('visible=' + isVisible + ', index=' + channelIndex + ', zone=' + channelZone)
4. Runtime IDs on Host Objects
API 1.2 made runtime-ID based lookups broadly available on host objects.
var selectedChannel = page.mHostAccess.mTrackSelection.mMixerChannel
page.mOnActivate = function (activeDevice, activeMapping) {
var runtimeID = selectedChannel.getRuntimeID(activeMapping)
console.log('Selected channel runtime ID: ' + runtimeID)
}