Reference to Global Rackspace

Hi,

I’m new here and still using the trial version. I have tried the code to change presets when changing the variant in a rackspace, works perfectly!

I want to make a small change, and change the preset of a plugin that is located in the global rackspace. However, in the current rackspace the link to the handle of a plugin in the global rackspace is not recognised.

In another article of this site it is mentioned that you can reference to the global rackspace:
https://gigperformer.com/docs/GPScript40/content/language-manual/20-language-changes-in-gpscript-v4.html

Referencing the global rackspace

Some GPScript functions, such as [BindExternalWidget]can explicitly refer to other rackspaces by name. If you need to refer to the Global rackspace in such a function, the name of the Global rackspace is “Global Rackspace”.

I tried this, but I dont know how to do it exactly:
LoadPreset(“Global Rackspace”.Organ, “Jimmy”) doesnt work for example. Do I have to use the dot? Do I have to use the quotes? Is it actually possible to refer to the Organ on GlobalRackspace?

I hope somebody can help me here.

Welcome @Nasko !

Want do you want to be the trigger for this change?

2 Likes

Just like in the example, when you select a new variant in the rackspace. So I made the code in the rack space script inside the on variation event.

Why don’t you put a widget on the global rackspace that you associate with the plugin on the global rackspace and then map a local widget on your active rackspace to the global rackspace, no GP Script required

2 Likes

That seems to be a good idea if I understand it correctly…

In the Global Rackspace I put a slider in that selects the preset of the plugin in the global rackspace itself.
In the current rackspace, for each variant I set another slider to a different value for each variant
I bind the two sliders so the global rackspace slider follows the setting of the local rackspace.

I will give it a try later and let you know if I managed to get it working.

Ok, I just put a slider on the local rackspace and one on the global rackspace which I mapped to eachother using a global variable. When changing the slider on the local rackspace, the one on the global rackspace is moving too.

Now I need to change the plugin (on global rackspace) preset when the slider (also on global rackspace) is changing. Is there an event I can use for that so I can use the same code as in the example to change the plugin preset? If I name handle of the slider “PresetSelector” is there something like ?

On PresetSelector (oldValue: Integer, newValue: Integer)

Or is there another way too change the preset of the plugin using this slider, as you mentioned GP script was not needed anymore?

I found this in another topic, so later on I will give it a try:

I assume I have to give the slider in the global rackspace a handle, the plugin too as before and then I would be able to use the On WidgetValueChanged event to change the preset of the pluging using the handle I gave the plugin…

To be continued…

Var
METRO : Widget
DOWN : Widget
UP : Widget
//$

// Called when a single widget value has changed
On WidgetValueChanged(newValue : double) from UP
if newValue == 1.0 then
METRO.SetWidgetValue(Round((METRO.GetWidgetValue()+0.1)*10)/10.0)
end
End

Hi,

After following the advice above I managed to get almost there… I wrote some code that I thought should be working but no Preset is actually changed. I uploaded the gig file. Compliation is succesfull, but no Preset is changed.

Any (last) help would be appreciated. I have the idea that I’m almost there…

ChangePresetOnGlobalRackSpace.gig (38.8 KB)

var PresetSelectorOrgan : Widget
var Organ : PluginBlock

On WidgetValueChanged(newValue : double) from PresetSelectorOrgan
if newValue <= 0.01 then
LoadGPPreset(Organ, “Preset1”)

elsif newValue <= 0.02 then
    LoadGPPreset(Organ, "Preset2")

elsif  newValue <= 0.03 then
    LoadGPPreset(Organ, "Preset3")

end

End

Have you previously saved some GP-User presets?
The function LoadGPPreset() is just calling those GP-User-presets!
…if there aren’t any available (means “previously saved by yourself”) there’ll be nothing to load!
You can check the list of available GP-User presets in the same menu (see arrow marker).
2022-01-20 18_45_51-ChangePresetOnGlobalRackSpace

Make sure you chose exactly the same preset names for your files and in the script!

3 Likes

Thanks for helping out!!

Yes, I created the presets myself. I just tested Moving the slider on the global Rackspace directly from there and then things work (you even get an error message when a preset does not exits). After that I changed the slider on the loca Rackspace which also works!! What doesn’t work is when the slider is moved due to different settings on different rack spaces and changing the rack spaces …

Apparently the event WidgetValuesChanges is not called when it is changed ‘externally’.

I just tried your gig file and the widget movement worked perfectly well when i stepped through the diffrent rackspaces, which do have diffrent slider-settings. The slider in the global rackspace followed exactly the settings of the local ones… what did you expect to happen?
Or asked in another way: How do you want the widgets to behave?

1 Like

You are right, I dont know what happened before, maybe I messed up with the decimals, but now I got it working too.

Thanks all for your help!

1 Like

Here’s some help from the manual: How to control widgets from the Global rackspace in a regular rackspace?