[Rackspace] GP-Preset Roll-Selector (with GP-Script)

Topic closed because there is a new version available!

Please visit this thread:

and download the new version - it should work better!
Thanks for your understanding!

######################################################################

Hi everyone,
since there were quite some questions and discussionsabout how to switch presets with widgets, scriptig, variations… i thought i could try to builld yet another rackspace to achieve these tasks.
The rackspace looks like this:


In the wiring view i used some free plugins (a step sequencer and a synth):
https://www.fullbucket.de/music/sequencair.html
and

I also saved a bunch of GP-Presets, so you’ll have something to play with.
Unzip this packkage into you Documents\Gig Performer\Presets folder
Presets.zip (383.2 KB)

So this is how it works:
You can step through the list of available GP-Presets by either using the +1 or -1 buttons or by turning the knob on the left. When you press the “Select” button on the right, the preset in the highlighted (middle) field will be activated/loaded. The actually active preset name will be shown in the text field on top. That’s pretty it…
You can of course save more presets (i think up to 128) or delete some from the preset-folder - the script should “catch” the changes as soon as you press a button or turn the knob.
Since the knob is in sync with the active preset, it will also be able to store/recall the active preset in a rackspace variation.

Have fun with it:
GP-Preset-Roll-Selector.gig (328.1 KB)

And just for the curious ones, this is the script behind the curtain (maybe some things might be not very elegant or even redundant, but i got somehow lost at a certain point). Well it works… that’s what counts! :nerd_face:

const
centerIndex :integer = 2
indexRange : integer = 2

var
plugin1 : PluginBlock
txtField10, txtField11, txtField12, txtField13, txtField14 : widget
txtField1Active : widget
btnPlus1, btnMinus1, knbDial1, btnSelect1, btnOpen1 : widget
presetRoll1 : widget array = [txtField10, txtField11, txtField12, txtField13, txtField14]
presetListPlugin1 : string array
dontDial : boolean = false
actualListIndex:integer 


//####################### function to set the knob according to the actual preset index ################################
function setKnob()
var
knbValue : double 
presetListPlugin1 = GetGPPresetList(plugin1, 0)
    if actualListIndex >= Size(GetGPPresetList(plugin1, 0)) then
        knbValue = 1.0
    else
        knbValue = (actualListIndex+0.5)/Size(GetGPPresetList(plugin1, 0))
    end

    dontDial = true
    Sleep(50)
    SetWidgetValue(knbDial1, knbValue)
    dontDial = false
End


//####################### function to get the index-value of a given preset name ################################
function GetPresetListIndex (presetName : string, presetList : string array) returns integer
var
index : integer
presetListPlugin1 = GetGPPresetList(plugin1, 0)
    for index = 0; index < Size(presetList); index=index +1 Do
        if presetName == presetList[index] then result = index end
            Print(presetList[index])
    end
End


//####################### function to to update the preset-roll ################################
function UpdatePresetRoll (plugBlock : PluginBlock, roll: widget array, listStartIndex: integer, rollStartIndex : integer)
var
index : integer
indexName : string
presetList : string array = GetGPPresetList(plugBlock, 0)
    for index = 0; index<Size(roll); index=index +1 Do
        if listStartIndex - (indexRange-index) <0 or listStartIndex+index-1 >Size(presetList) then
            indexName =""
        else
            indexName = presetList[(listStartIndex-(indexRange-index))]
        end
        SetWidgetLabel(presetRoll1[index], indexName)
    end
End


//####################### function to to reactivate the las active preset ################################
function reActivatePreset()
    presetListPlugin1 = GetGPPresetList(plugin1, 0)
    actualListIndex = ScaleRange(GetWidgetValue(knbDial1), 0, Size(GetGPPresetList(plugin1, 0))-1)
    UpdatePresetRoll(plugin1, presetRoll1, actualListIndex, centerIndex)
    Sleep(50)
    SetWidgetLabel(txtField1Active, GetWidgetLabel(presetRoll1[centerIndex]))
    Sleep(50)
    LoadGPPreset(plugin1, GetWidgetLabel(txtField1Active))
End

// Called automatically after script is loaded
Initialization
    reActivatePreset()
End

// Called when you switch variations
On Variation(oldVariation : integer, newVariation : integer)
    reActivatePreset()
End



//Step one preset line UP
On WidgetValueChanged(bVal : double) from btnPlus1

    if bVal == 1.0 then
        presetListPlugin1 = GetGPPresetList(plugin1, 0)
        actualListIndex = GetPresetListIndex(GetWidgetLabel(presetRoll1[centerIndex]), presetListPlugin1)
        if actualListIndex+indexRange <= Size(GetGPPresetList(plugin1, 0)) then
            actualListIndex=actualListIndex+1
            UpdatePresetRoll(plugin1, presetRoll1, actualListIndex, centerIndex)
            setKnob()
        end
    end
End

//Step one preset line DOWN
On WidgetValueChanged(bVal : double) from btnMinus1

    if bVal == 1.0 then
        presetListPlugin1 = GetGPPresetList(plugin1, 0)
        actualListIndex = GetPresetListIndex(GetWidgetLabel(presetRoll1[centerIndex]), presetListPlugin1)
        if actualListIndex >=1  then
            actualListIndex=actualListIndex-1
            UpdatePresetRoll(plugin1, presetRoll1, actualListIndex, centerIndex)
            setKnob()
        end
    end
End

//##################### Activate the highlighted (middle) preset ##########################
On WidgetValueChanged(bVal : double) from btnSelect1
var
index:integer 
    if bVal == 1.0 then
        presetListPlugin1 = GetGPPresetList(plugin1, 0)
        SetWidgetLabel(txtField1Active, GetWidgetLabel(presetRoll1[centerIndex]))
        Sleep(50)
        LoadGPPreset(plugin1, GetWidgetLabel(txtField1Active))
    end
End

//use the knob to dial a preset
On WidgetValueChanged (kVal:double) from knbDial1
    actualListIndex = ScaleRange(kVal, 0, Size(GetGPPresetList(plugin1, 0))-1)

    if dontDial != true then
        UpdatePresetRoll(plugin1, presetRoll1, actualListIndex, centerIndex)
    end
End

//Watch the open/close events of the plugin -> renew the presets-list
On WidgetValueChanged (bVal:double) from btnOpen1
    presetListPlugin1 = GetGPPresetList(plugin1, 0)
End


9 Likes

Can’t wait to try this.
Fantastic idea.

3 Likes

Thanks, man. It even switches quite fast… you can try it by switching variations while keeping the step-sequencer running. But it all depends on the plugins you use… i first set the rackspace up with a diffrent synth from Full Bucket Music, which didn’t react to any GP-Presets, not loaded via script, nor loaded manually… maybe i used an old version… i don’t know.
I’m telling just in case, if something doesn’t work… try a diffrent plugin first.

2 Likes

Question and I apologize if I missed something.
I will have to make gpuser presets out of my plugin presets to make this work right?
Also do I need to modify anything in the script code in order to add the GP user presets ?
Or they will be automatically updated? Is there a path to put somewhere to let Gp know where the gpUser presets are ?

Let me take a closer look at the script. Perhaps it will all be clear.

Yeah, Just save gp-presets from within the opened plugin window… the path should be the right one by default (see also the initial posting).
No need to change anything in the script.
It should update the list of available presets with the first press of a button or turn of the knob.
Your can replace the plugin, but then you should be aware to either use the handle name like it was (plugin1), or you’d have to change the handle names in the script accordingly to what you choose.

2 Likes

It’s not clear in the system functions document what the second param of the GetGPPresetList system function does. I mean it says it’s Nth chunk, but I don’t see what happens if that’s set to 0.
I assume it means get the entire list without jumping to a certain chunk of the list?
how would one set the chunk size?

afaik it’s the equivalent of a present bank, so i think a chunk is a group of 128 presets… but i also may be wrong.
EDIT: I was almost right… it’s 256 presets!

1 Like

ok i tried it in my setup and it does not work.
it does get the presets on that green lcd.
they do change on the green lcd - but the actual presets inside the plugin (ARP 2600) do not change.
i do have the same script handle for the replaced plugin.
and i deleted the sequencer - because i did not have that plugin.

Which one exactly?

ARP 2600 V3 (vst3)
Oh wait it WORKS!!!
I forgot that I had to press that “select” button after selecting a preset.
My bad totally!

So theoretically using this script I could do the thing in this gig file - without utilizing so many instances.
the only thing is that i couldn’t do layers.
but it would work for splits of one instrument each.
testing splits.gig (910.6 KB)

i am guessing i would copy most of the script to adapt it for the upper range of the split.
i would also make sure to copy the widgets and give them handle which also would match in the script.

but then again - layers could probably be accomplished as well - since i could make another “instance” of this script algorithm.
so i can imagine having up to 4 of those, and then save good combinations in variations, or even better in song parts.

1 Like

Yeah, I decided to use a separate button for the final choice, since I mistrust the situation of “bombing” a poor plugin with too many preset changes in a too short time…

1 Like

here is something i don’t understand.
when i try it with your script - switching back to a variation that was already selected (with some reverb tail) works flawlessly. like i don’t hear the reverb tail - the variation gets selected as if it is the first time i am selecting it.

with my gig file (with many instances of the plugin) when i return to a variation that was already selected before (and sound has some longer release/tail) i would hear that glitch plus the end of that tail.

how is it working flawlessly with your script?
i did not see anything in the code that is related to that.
is it the reactivatePreset function?

I mean this is fantastic news - but i just don’t get how is this sorcery happening. :smile:

I can’t actually tell… obviously, miracles happen from time to time. :sunglasses: :smile:

2 Likes

HAHA. :laughing:
then if its nothing in the script, that means it could be related to the number of instances.
the less instances - the snappier and faster it is.
or maybe my tails from the presets i tried are not long enough.
i gotta try it with some long pads…

it works with the pads too!!!
whichever part of the code that is - it is brilliant.
You are LITERALLY stopping the tails of the variations. This is different than just bypassing.
It must be like offloading completely of the preset. I have to analyze this code better. OMG!

This was a huge issue for many users who tried to change presets with variations.
Including for me!!! I just didn’t want to go to separate rackspaces because it would have exponentially increased the number of required instances.

you are calling reactivatePreset() inside the On Variation change.
But inside reactivatePreset() the only thing that could cause the tails to silence that i can see - is GetGPPresetList()

could it be that getting the preset list stops all audio for that moment?

oh no!
i actually do see a problem with this system - regardless of its incredible benefits.
i have to keep reworking my variations if i add gpuserpresets over time (as opposed to all at once)
example:
i created 5 variations, and assigned them to the presets i had.
once i added another preset (the pads one with long tail) that took the index of the previous last preset.
basically if you add more presets - it will mess up existing variations.

i wish i could achieve that silencing with the version that has many instances of the same plugin.
that would be extremely flexible.
maybe i will try to write a script that just gets the gp user presets and does nothing with them - to achieve the silencing. haha

BTW - OpenPlugin1 button does not work. it does have the script handle in the widget properties, but nothing happens when i click it.

Yeah, unfortunately the label widget won’t keep it’s text when the gig file gets closed, even if it was saved before.
That’s why I had to use the knob widget’s value to jump to the corresponding preset list index. The presets are evenly distributed over the knob range, additionally they are arranged in alphabetical order… so every time the number of widgets is changed, the connection between widget value and preset index will most probably be messed up.
It would be different if one could store the presets name… but well…
Maybe with a text file? I think this could be a workaround.
Or you save all the presets you’ll need and after that you create variations and never change anything.
The open button was just mapped to the according plugin parameter.

I understand.
If possible can someone help figure out how the tail of the preset gets stopped on returning to a variation that was already played ?

Which part of the code stops audio?

This would be a way to use the variations with multiple instances - and that for me would be more than enough. Selfish me! :dragon_face:
Just teasing!

oh no!
update: it does not work with Analog Lab.
When I replace ARP 2600 V with analog lab V
I compile the script
Sees the presets - but does not change to them.

Can this be used for more than just one plugin in the same rackspace?

No it cannot. I tried it and as soon as I add gp user presets for other plugins they don’t work. Tried it with analog lab and buchla easel from Arturia.
Only the first one I tried works (arp2600 v3)
I was hoping I could use analog lab.

I have another approach which @tripleB suggested.
You use the one rackspace switching presets via variation widgets method.
Then you can put whatever plugins you want in the rackspace and mix and match them.
When you finish adding all your presets (it will be that many instances) then you duplicate your rackspace.

Now you go to set list mode and you are able to alternate rackspaces (since they are the same rackspace)
You achieve the smoothness of the rackspace switching while maintaining access to all your presets and be able to combine them as well via an adjustable split point. You can even layer them.

Now the only problem is that you will be limited by your pc cpu and mainly ram when it comes to how many you can put.

But this probably works easily with about 100 presets. I will try to see what the limit is on a Mac mini m4.

This method is not clean and limits the number of presets - but does not limit the number of combinations, layers, split points, volumes, etc. whatever other automations you need without creating additional variations.

Because in setlist mode when you reference a rackspace variation - you can modify it (the song part) without affecting the underlying rackspace variation.