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!
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