Optimizing Recalling Parameter Values

How can I optimize this script?

I think there is a function that might be a shortcut to the widget syncing, but if I recall, it has an issue that will be fixed in a future GP update:

RefreshWidgetsMappedToPlugin : Update widget values to match their mapped parameters - useful when change to plugin preset does not notify the host

  • Declaration: function RefreshWidgetsMappedToPlugin (p : Block)

Otherwise, you could put all of the widget names into a Widget Array variable, and then all of the parameter numbers into an Integer Array, and then create a For loop to cycle through the widgets and use a single SetWidgetValue call.

Although it’s probably not worth doing this until you needed to do another update of all of the widgets.

1 Like

That’s not going to work at all.

LoadGPPreset is asynchronous so some or all those calls to SetWidgetValue will run before the load even starts. Therefore they won’t have the correct parameter values.

This doesn’t answer you exact question, but why not using variations and switch the variations using you pads? This way you wouldn’t need a GPScript…

What is that script for?

Dealing with a plugin that doesn’t update the mapped widgets when you load a GP Preset.

can I put a delay then? I am trying to have my arturia plugin sync when i change GP Preset via pads. I posted another forum on what i was specifically doing earlier

to answer your question, I plan to use variations, but I would like the ability to be in said variation and be able to recall a specific synthesizer sound without changing any of my other keyboard sounds.

For example, if i have a Rhodes running through a phaser on my bottom keys, and a Sync Lead on my top keyboard, but I would like to use Touch OSC to click a button that recalls a different lead sound that I like in the middle of the song

I’ve gotten the script from another forum to get it to change GP Presets with buttons, but the values are not updating

However two problems,

I am bad at scripting, but I know there must be a way to tell the script to go: Any widget assigned to [pluginblock] get parameter value automatically then set it (after .1 seconds after LoadGPPreset)

because mentioned above, the values are asynchronous so I may need to put a .1 second delay in order to allow all the parameters values to change

to answer paul, who has graciously helped me before when i started GP about 7 months ago

I am building basically a mobile singular rackspace ordeal, where i use Touch OSC to control, bypass, select, mix, eq, reroute different midi channels, select presets, and route fx all within one rackspace allowing me to recall a variations and then live tweak them however I like. without having to make 60-100 combinations of different types of racks, that are going to slightly different over time due to tweaks to UI, for each synth, piano, organ, strings, and wind instrument models and vsts available

I am going to provide photos of my particular problem right now. As provided from the photos you can see that I am using touch osc to control widgets, the widgets sync to touch osc fine so anything that happens in GP happens on my ipad. I have about half the prophet 5 mapped to synchronize upon quick patch selection change.

I am not using variations because if I were to use my ipad to select let’s say, rhodes, and then put a phaser on it, and make my top keys a sync lead, but I would like to have another new lead sound in the middle of the song while keeping my bottom keys sound the same, recalling a variation would have to make all my other programs IDENTICAL to what i had, which means it’s impossible to make every type of combination in a live situation. Having a dynamic variation, inspired by the nord stage 3 and 4, allows me to take basically the “synth engine” and select a preset while keeping all my other engines in tact.




^ to clarify im pointing at page 2 bc thats where im putting some buttons to recall GPPresets

will try this when i get home.

The problem is you won’t know in advance how much of a delay is needed. It could be 0.1 second, but it could be 2 seconds or 5 seconds depending what else is going on and what the plugin itself needs to do.

thanks for the reply. the parameters seem to change fairly consistently without even a delay set in the code, but sometimes it doesn’t update a few widgets, the GPPreset loads very fast and almost nearly all widgets update without any delay coded.

I will have to play around with it

Yes, the problem is that it totally depends on the plugin. Some will notify the host, others won’t. And there’s no way to know how long to wait

gotcha. so something like keyscape is sample based and takes longer to load.

And loading a new synth in arturia lab will also probably take a while.

That’s exactly right - and the problem is that plugins may do stuff synchronously or asynchronously (in the background) which is why you don’t always know when it’s done

the refresh widget command does not seem to work

And I explained why that is the case earlier in this conversation!

You don’t have the right syntax:

RefreshWidgetsMappedToPlugin(prophet5)

But, I believe you will get another error as this function has an issue that was previously raised and will be fixed in a future version.