Controlling blocks in Global Rackspace from individual Rackspace script

I’m looking to a scripting solution to adjust a selection of midi blocks from a Rackspace script. I have a few commonly used plugins in my global Rackspace that I can control via local Rackspace widgets that are connected to the Gobal Parameter Assignments, but I’m running into an issue where I have to add widgets to each Rackspace to turn on/off the midi blocks in the global Rackspace and it means adding them and assigning them for each new Rackspace I create.

I would like to add some code to each Rackspace script that will turn off all midi blocks in the global Rackspace and if possible, have a widget that will turn on the ones I’m using in the local Rackspace. If the script cannot be fired before the widgets are assigned, I could edit each script to turn on/off the sounds needed, which will be quicker than doing the midi block initialization via widgets for each Rackspace.

For example. Lets say I have 6 instruments in my global Rackspace, I have to have 6 widgets that turn the BlockNoteOn parameter for each intrument in every Rackspace, otherwise I will have those sounds playing when not needed. If I could have a small script that turns all 6 off before the widgets are initialized, then I can have just 1 or 2 widgets set to on for the instruments I need. If this isn’t doable, I can manually type in the instruments I want on and off in the script, saving panel space and time setting up sounds.

If there’s a way to preserve the plugin parameters for widgets in other backspaces, I can just copy and paste them, but that does not seem to be possible.

Thanks for any help. I’m somewhat familiar with GPScript, but still learning the syntax.

1 Like

Maybe a partly solution: If you have script code you want to add rather easy to (a selection of) your rackscripts, you could consider using the include statement.

1 Like

That could be useful. At least I can put the code to disable all the blocks during initialization of the Rackspace, then I can turn on only the ones I need for that Rackspace if any.

Is there a way to reference and control Global Rackspace blocks from individual Rackspaces? I seem to be able to get some info from a MidiInBlock that’s in the local Rackspace, but when I try to reference one in the global Rackspace, it gives an error that it was not found in the Local Rackspace

You can control widgets in the global rackspace via a widget in the local rackspace and vice versa.
What do you want control from what?

1 Like

I have it working via widgets, but it’s a good amount of work to add them to all the rackspaces. Also, if I add more instruments to the global Rackspace, I will have to add that widget to every local Rackspace. Trying to find a single script that will turn off all the instruments on Rackspace change and if needed, I can then enable the ones I need for that particular Rackspace.

It would be best to just edit a global function that handles this vs dealing with linking widgets to the global Rackspace for every new Rackspace I create.

With scripting you can use the concept of “External Widgets”

1 Like

That’s what I’ve been looking for. Thanks! Figured there had to be a way to reference them outside of the local Rackspace

Yeah, be careful with those - I really consider External WIdgets to be a bit of a hack although they’ll probably work for your needs.

Also, have you considered just using the Rackspace Changed callback in the global rackspace?

screenshot_6341

3 Likes

I saw the experimental tag after. I can get the job done using the Rackspace Changed callback in the Global Rackspace. Just need to set up a widget array, so I can keep the code to a minimum and only have to edit the array code whenever I add/change instruments in the Global Rackspace.

1 Like

I was able to get this working with @dhj suggestion. I now have the Global Rackspace Script turning off all the Global Instruments when a rackspace is changed.

Then, in my rackspace scripts, I have similar code turning on the required global instruments for that rackspace. Currently those are hardcoded in a widget array, but I’d love to be able to check the panel for a certain widget, like a label that can be used to tell the code what widgets to add to the array.

For example, if I have 2 text labels named “Sax” and “Piano” on the panel, then I could have a function that puts the names of all the labels on the panel into the widget array. This way instead of hardcoding the names in each rackspace script, I can just put text labels on the panel. I think I know what I need, but if anyone has some similar code or ideas, please let me know. Thanks!

Hello amosdef,
Would you be so kind to share a gig file or script of your solution?
I have a similar situation in which I’m trying to control the global widgets from a selected rackspace.
This would help me get a good start…thanks!

1 Like

I ran into some issues, but I’ll put what I have together as a starting point. I ended up not using the script for now, but will probably revisit it at some point

I’ll try to post a gig in the next few days

1 Like