Midi Remote API: Remote Control Editor not following active plugin across tracks

Hi everyone,

I’m developing a MIDI Remote API script for Cubase Pro 15 (v15.0.21) and I’m having trouble getting followPluginWindowInFocus() to work as expected when the focused plugin belongs to a different track than the currently selected one.

Expected behaviour (how it worked in Cubase 14)

In Cubase 14, I had a JSON-based MIDI Remote mapping that used HostInsertEffectFilterExcludeEmptySlots and HostInsertEffectFilterFollowPluginWindowInFocus together on an InsertEffectViewer anchored to SelectedTrackChannel. The 32 knobs mapped to the Remote Control Editor would always follow whichever plugin window had focus, regardless of which track was selected.

Current behaviour in Cubase 15

With the equivalent JS script using the same architecture:

var viewer = selectedTrack.mInsertAndStripEffects
    .makeInsertEffectViewer('RCEFocusViewer')

viewer.excludeEmptySlots()
viewer.followPluginWindowInFocus()

The knobs follow the focused plugin correctly as long as the focused plugin belongs to the selected track. But if I bring a plugin from a different track to the front, the knobs stay locked to the selected track’s plugin.

Steps to reproduce

  1. Select track A, open plugin A → knobs control plugin A ✓

  2. Select track B, open plugin B → knobs control plugin B ✓

  3. With track B still selected, bring plugin A’s window to the front

  4. Expected: knobs switch to plugin A

  5. Actual: knobs stay on plugin B (the selected track)

Test script

I’ve written a minimal standalone script that isolates the issue. You can drop it into your MIDI Remote scripts folder and use any IAC virtual port (change the port name at the top):

var midiremote_api = require('midiremote_api_v1')

var deviceDriver = midiremote_api.makeDeviceDriver('Test', 'RCE Focus Test', 'jordikt')

var midiInput  = deviceDriver.mPorts.makeMidiInput()
var midiOutput = deviceDriver.mPorts.makeMidiOutput()

deviceDriver.makeDetectionUnit().detectPortPair(midiInput, midiOutput)
    .expectInputNameEquals('IAC Driver Bus 1')
    .expectOutputNameEquals('IAC Driver Bus 1')

var surface = deviceDriver.mSurface
var page    = deviceDriver.mMapping.makePage('Default')

var knobs = []
for (var i = 0; i < 32; i++) {
    var knob = surface.makeKnob(i % 8, Math.floor(i / 8), 1, 1)
    knob.mSurfaceValue.mMidiBinding
        .setInputPort(midiInput)
        .setOutputPort(midiOutput)
        .bindToControlChange(0, i + 1)
    knobs.push(knob)
}

var selectedTrack = page.mHostAccess.mTrackSelection.mMixerChannel

var viewer = selectedTrack.mInsertAndStripEffects
    .makeInsertEffectViewer('RCEFocusViewer')

viewer.excludeEmptySlots()
viewer.followPluginWindowInFocus()

var paramBank = viewer.mParameterBankZone
paramBank.setWrapAround(false)

var params = []
for (var i = 0; i < 32; i++) {
    params.push(paramBank.makeParameterValue())
}

for (var i = 0; i < 32; i++) {
    page.makeValueBinding(knobs[i].mSurfaceValue, params[i])
}

What I’ve tried

I also tried anchoring the viewer to a dedicated MixerBankChannel from a separate MixerBankZone instead of SelectedTrackChannel, but the behaviour was identical.

Question

Is followPluginWindowInFocus() intentionally scoped to the selected track’s inserts in Cubase 15? If so, is there any way to make the 32 knobs follow the focused plugin window globally — across any track — without changing the track selection?

Thank you.


Calling @m.c as always…:slightly_smiling_face:

I don’t recall this behaviour altered from 14 to 15, i.e. it should be the same in 14 and is the one you noticed in 15.
Here’s a thread with a snippet for (ab)using the Focused Quick Controls concept, in order to have more than 8 parameters. However, it does need to automatically set the involved track to be selected, so it won’t work in your case, since you need the selection to be preserved.

Hi @m.c,

Just wanted to say thank you — your FQC Extender thread was the key to solving my issue.

I ended up adapting your DirectAccess approach: when the focused plugin belongs to a different track than the selected one, the script now automatically selects that track, which makes the Remote Control Editor viewer follow correctly. Works perfectly.

Really appreciate both the detailed write-up and the quick reply on my thread. Your contributions to this community are invaluable.

Thanks again!