trySetSlotPlugin — How to load a plugin into an insert slot via MIDI Remote API 1.3?

Hello m.c,
I’ve continued working on my WPF/C# MIDI Remote Controller (Sherlock 2) and I’m trying to load a plugin into an empty insert slot from my touchscreen interface.

What I’ve explored:

da.mPluginManager exists on the DirectAccess of the selected track and exposes getNumberOfPluginCollections, getPluginCollectionByIndex, getIndexOfDefaultPluginCollection, getIndexOfActivePluginCollection — but these methods return undefined regardless of the signature called (with or without activeMapping).

insertViewer (via makeInsertEffectViewer) exposes: includeEmptySlotsOnly, excludeEmptySlots, followPluginWindowInFocus, accessSlotAtIndex, getRuntimeID — no trySetSlotPlugin.

Question: Is it possible to load a plugin into an empty insert slot using API 1.3? If so, what is the correct way to use mPluginManager and/or trySetSlotPlugin?

Thanks!

The insert window is correctly created

which itself is inserted via a button in the console.

Well, we’ve made some progress; the insert window now opens correctly with the plugins on the track and the list of all existing plugins. However, we’re missing the trySetSlotPlugin function on the JavaScript side, which is blocked by the limitation of the incoming MIDI port.

We have the UIDs and the object IDs of the slots. We want to call trySetSlotPlugin from C#. How do we trigger this from outside the system?

Okay, we’re making slow progress. I can now load a plugin from my insert window after carefully analyzing m.c.'s messages and code. And I thank him again, but I’m having a few lag issues, but we’ll get there.

AnimationSherlock2

A small animation of the insert window with some bugs at the moment, but in any case, communication is well established between Sherlock2 and Cubase.

Here’s another short animation with all the created windows: Keyswitches, CCs, and Microphones.

AnimationSherlock2

Hi Freudon,

I came across your thread about loading a plugin into an insert slot via MIDI Remote API 1.3 (trySetSlotPlugin) while researching the same problem for my own project — an external SysEx-based bridge between Cubase 15 and a Python backend, conceptually similar to Sherlock2 (external controller talking to Cubase over MIDI, not just a driver script UI).

We’ve been trying to read/insert devices on a track and hit the same wall from a few different angles:

  1. InsertEffectViewer (via makeInsertEffectViewer/accessSlotAtIndex, reading mOn/mBypass with getProcessValue) — silent hang, no error at all, just a timeout.
  2. DirectAccess child-object traversal on the selected channel (getNumberOfChildObjects/getChildObjectID/getObjectTitle — the same calls that work fine for us at the mixer level) — hung exactly the same way when applied one level down to a channel’s children.
  3. da.mPluginManager (getNumberOfPluginCollections, getPluginCollectionByIndex, etc.) — same as what you originally reported: returns undefined regardless of call signature.

Three different approaches, three identical dead ends — so at this point I’m fairly convinced this isn’t a mistake on our end, it’s a genuine rough edge in this part of API 1.3.

Your last update said you got it working “after carefully analyzing m.c.'s messages and code,” but the actual method isn’t visible in the thread (only images). Would you be open to comparing notes and figuring this out together? Even a rough description of the working approach — how you called trySetSlotPlugin from outside the script given the incoming MIDI port limitation you mentioned — would save us a lot of guessing, and I’m happy to share our test results/code in return if that’s useful for Sherlock2.

No worries at all if you’d rather not — just figured it’s worth asking since we’re clearly solving the same problem from two different directions.

Thanks!

Check this thread, it may help:

Hi m.c.,

I genuinely don’t know how to thank you enough for this. Sharing a full, heavily-commented, working production script — not just a hint or a fragment — is an incredibly generous thing to do. Much appreciate!

We’d spent an entire evening on three separate failed attempts at reading insert devices via DirectAccess, each one hanging silently with zero errors, and we genuinely couldn’t figure out why. Your code showed us exactly what we were missing — the intermediate insert-slots container at child index 3, and the instrument slot at index 9 — details that just aren’t documented anywhere we could find. That one insight (plus your consistent use of getObjectTypeName before touching anything, which we hadn’t been doing) fixed what three separate architectural guesses couldn’t.

On top of that, the trySetSlotPlugin + plugin collections approach opens up a whole path we thought was closed to us. We’re going to build on that next.

This kind of thing is exactly what makes a community part of something great. Thank you — really.

If it’s useful to you, I’m happy to report back once we’ve verified everything live and share what we build on top of it.

Sure, it’s always nice to see sharing implementation in the forum :+1:

Hi both,

@m.c — thank you for sharing that, it’s incredibly generous. Even though we’d already found a working (if messier) path to trySetSlotPlugin on our side, the details you gave — the intermediate insert-slot container at child index 3, the instrument slot at index 9, and using getObjectTypeName before touching anything — explain some of the silent hangs we hit early on too. That’s exactly the kind of undocumented structure that costs a whole evening of guessing otherwise.

@howlcinder4 — glad you got a clean answer, and a much better one than what I was about to type up here! Sounds like we converged on the same general mechanism (SysEx bridge + cached DirectAccess/mapping references) from two different directions, which is reassuring in itself. Would be great to keep each other posted on how our projects evolve from here — always nice to know someone else is wrestling with the same API on the other side of the world.

Hi m.c.,

Quick follow-up as promised. We built insert_device on top of your trySetSlotPlugin + collections approach, and it worked on the very first try — no debugging round needed at all, which honestly surprised us given everything else we’d built that evening needed at least one live fix.

We set up a “Orchestrator” collection in the Plugin Manager, queried for a plugin by name within it, and trySetSlotPlugin dropped it straight into the second insert slot on the track — confirmed visually in Cubase right after the API call returned. Full loop working end to end.

We also used the same channelType/getObjectTypeName + child-index navigation pattern from your script to fix a track_devices command we’d been stuck on for three separate attempts — that alone saved us the rest of the evening.

Much appreciate, again. Genuinely.

Hi Freudom!

That’s a really good point, and honestly kind of reassuring. We’re building an external SysEx bridge (Python backend talking to Cubase over a MIDI Remote script) as part of a bigger multi-DAW automation project, and converging on the same general shape — cached DirectAccess/mapping references, the same trySetSlotPlugin mechanism — from a completely independent direction says something good about the approach, not just luck.

Would genuinely love to keep in touch as things evolve. This corner of the API is clearly still being figured out in real time by a small handful of people, so knowing there are others actively poking at the same edges — and generous enough to share what they find — makes the whole thing a lot less lonely. Happy to compare notes whenever something new turns up on either side.

Thanks again, both of you — this thread ended up being way more valuable than we expected when we first posted.