Can I script a rotary knob to change plugin preset?

Yes. So I would save a GP preset and then I could use a rotary (or my randomization script) to select those?

In principle yes, but the script function needs the correct name to load the preset.
So without knowing the nameā€¦
This is the function
LoadGPPreset( ā€œPlugInBlockNamā€, ā€œPresetNameā€)

So when you save your Presets with generic names, for example ā€œPR1ā€, ā€œPR2ā€ā€¦ then with a generic script you could switch through your presets.

I didnā€™t even think to search the function list for Preset functions, thanks for that tip.

Iā€™m going to have to think about this. The envelope presets apply only to the mod envelopes, not the other parameters (which I am randomizing with my script). So saving a GP preset kind of defeats the purpose.

But I will play around with it, try to think if there is a way to randomize the preset selection. I really wish I could just map the randomize button(s) in the gui but thatā€™s not possible unfortunately.

Are there any other possible solutions to consider? If not, no worries, appreciate your help!

I am not aware of other solutions for that plugin.

No worries, thank you!

Itā€™s a bit old, but I looked for this feature, too.

In Edit mode, select the widget that will be used to choose the preset, click on Advanced tab, and enter an OSC/GPScript Name, e.g. myWidget.
In Wiring mode, right-click on the plugin, choose OSC/GPScript Handle, enter a name, e.g. myPlugin, and check Use in GPScript.
In Window menu, select Show Current Rackspace Script Editor, paste the script below (adapting both previous names if needed) and click Compile (bottom right).
Return to Panels mode and enjoy (the selected preset name is displayed under the widget)ā€¦

Hope it helps.

ā€”

Var
myWidget : widget
myPlugin : PluginBlock

On WidgetValueChanged(new : double) from myWidget
Var presetNum : integer
presetNum = Ceiling(new*IntToFloat(GetPresetCount(myPlugin)))-1
presetNum = If presetNum < 0 Then 0 Else presetNum End
SelectPreset(myPlugin, presetNum)
SetWidgetLabel(myWidget, GetPresetName(myPlugin,GetActivePreset(myPlugin)))
End

2 Likes

Just be aware

@MattJazz
Thanks very much for the short tutorial.
Tried it with IK Multimedia Hammond B3 and with u-he Triple Cheese, using a knob widget.
Unfortunately it did not work in both cases. For the Triple Cheese, the name of the preset is shown correctly below the knob, but preset is not changed when knob is rotated. In the B3 case even the preset name is not shown.
I strictly followed your steps as described above. Any idea what could be wrong?

Not without your actually telling us what you did!

Hmm - I followed the steps as described by @MattJazz above. I did not edit the script, just took it as it is.
Win 11, GP4.1.5, Plugins as described above.
Not sure what is missing to explain what I didā€¦

For this technique to work (as in @MattJazzā€™s script), the plugin needs to correctly report all its presets to the host.

I had a quick look at Triple Cheese (VST) and it was only reporting the currently selected preset. This would be why you couldnā€™t select a different one.

The only option in this case is to save your presets using GPā€™s method: ā€˜Save GP User Presetā€™.
It would be a slightly different script, as different functions are used to select these presets.

1 Like

Ah, that helps a lot - thanks very much! I got the impression that MattJazzā€™ script was kind of ā€˜universalā€™ for all plugins.
I guess that your approach would mean that all the presets I would want to browse via GP knob first have to be stored byā€™Save GP User Scriptā€™, correct?
Is there a starting point script for your proposed method available?

Yes you would need to save all presets you want as a GP preset.
I did a script a while back for Helix Native. I changed it to use Triple Cheese and rackspace is below.

Select Preset via Widget.rackspace (26.8 KB)

I have an intentional delay before loading the preset. It means you can scroll the presets using the widget to find the one you want, and it wonā€™t try and load every single preset as you scroll past it.

GP4 Select Preset via Widget

2 Likes

@rank13 : Great, thanks very much, I will dig into that the next days!
@MattJazz : can you share for which plugins you have successfully applied your approach?

Meh - see page 8 of the documentation for Triple Cheese.

  1. Put the presets you want into the MIDI Programs folder

  2. Connect a MIDI In block to Triple Cheese
    screenshot_5874

  3. Create a widget and map it to the PC parameter of the MIDI In block

Youā€™re done. No scripting needed!

2 Likes

@dhj : that is even better, thanks for that hint.
I already browsed through the Triple Cheese Parameter Mapping list in GP, must have overseen the 155 - PC. Thanks again!

That is not a Triple Cheese parameter, it is a MIDI In block parameter

@MojoBass I can no longer check which plugins I used, but it worked with ampLion Free VST, and probably Full Bucket Phaser (FBPhaser) VST as well.
As explained by @rank13, the script should work with any pluginā€¦ as long as it reports its presets.
I thought of adapting it to alternatively use GP presets, but couldnā€™t find all the corresponding functions I used, and also noticed some was/were tagged as highly experimental. A delay before applying the preset looks like a clever idea on all perspective.
I did understand that this preset switching method is not in the spirit of GP (@dhj), although valuable to choose your presets when not playing live (@Hermon).
Unfortunately, I can no longer experiment any further nor check @rank13ā€™s script (although Iā€™d be interested to read it) since I decided not to stick to GP (Iā€™m not playing live but rather look for sound design for myself) and my trial license just expired.
I just wanted to share what I found which could be useful as I liked the software with its scripting environment, and its community.

1 Like

Did you play with the probabilistic sound designer tool in Gig Performer?

Very shortly.
Iā€™m rather looking for control than random (although I already had good surprise and source of inspiration out of it).
I dream of a universal undo/redo feature in host or wrapper (lacking in many great sounding plugins), and preset management solution.
It seems hard to universally implement, depending on how plugins report automation (for example, Soniccouture Canterbury Suitecase under Kontakt does not report all changes), and a bulk state save/load is more time consuming.