Some time ago, I thought I’d had the brilliant idea of using short Jump Bar commands to run scripts that toggle various VST plug-ins on Dorico’s main output channel, depending on whether I’m working with speakers or one of several pairs of headphones.
For example, one of the scripts contained the following:
local app=DoApp.DoApp()
app:doCommand([[Play.EnableInsert?Channel=37929&SlotID=3&Value=1]])
The snag appeared when I opened another project, in which the output channel number was 0 rather than 37929. Unsurprisingly, the script then toggled precisely nothing.
It is very convenient to type spkr into the Jump Bar when I’m using speakers, bedy when I’m using my Beyerdynamic headphones, and so on. Does this output channel really get assigned an arbitrary ID in each project, or is there a more reliable way to address it?
There is a misconception on your side. Object ids in a Dorico project start with 1 and with each element added will increase consecutively by 1. However, that ids reach a rather high number like 37929 is not unusual at all and may happen if you reapply playback templates frequently.
By the way, you can inspect the mixer state of a Dorico project yourself. See, a Dorico project is a zip file. You can rename it from *.dorico to *.zip and then run it through your favourite zip tool to unzip it. After unpacking you will find some files and folders, one of them called supplementary_data and in there the vstaudioengine folder, which again holds the file enginedata. That one you can load into a text editor and at least the beginning is plain, human readable XML text. The links section is rather difficult to read and comprehend because it is basically the patch bay for the routing inside of a channel and between channels.
Agreed. My mistake. The ID was 190 and not 0. Nevertheless it seems that the main output channel ID changes from project to project so it is impossible to make a general script.
Well, the system is deterministic in a way, that when you set up 2 projects the same way (e.g. create 2 new piano solo projects), then the resulting ids will be the same. But already a solo guitar project will look slightly different to the solo piano.