List of Available Parameters in a Scriplet

Hi, I see there is a way to get the number of parameters in a Scriplet:

var x, y : Integer
var item : String

y:= GetParameterCount()

Is there a way to iterate through the parameters to get all of their names?

For x = 1 ; x <= y ; x=x+1 do
// this doesnt work
item = GetDiscreteParameterItem(x,0)
Print (item)
End

Steve

Within a Scriptlet, you can get the string names given the parameter variable, but you cannot iterate through parameters.

However I don’t understand your use case… :thinking:

Use case. None yet, just experimenting.

I noticed a script you wrote that had

PANEL1_SELECT1, PANEL1_SELECT2, PANEL1_SELECT3, PANEL1_SELECT4, PANEL1_SELECT5, PANEL1_SELECT6,
  PANEL2_SELECT1, PANEL2_SELECT2, PANEL2_SELECT3, PANEL2_SELECT4, PANEL2_SELECT5, PANEL2_SELECT6,
  PANEL3_SELECT1, PANEL3_SELECT2, PANEL3_SELECT3, PANEL3_SELECT4, PANEL3_SELECT5, PANEL3_SELECT6,
  PANEL4_SELECT1, PANEL4_SELECT2, PANEL4_SELECT3, PANEL4_SELECT4, PANEL4_SELECT5, PANEL4_SELECT6,
  PANEL5_SELECT1, PANEL5_SELECT2, PANEL5_SELECT3, PANEL5_SELECT4, PANEL5_SELECT5, PANEL5_SELECT6,
  PANEL6_SELECT1, PANEL6_SELECT2, PANEL6_SELECT3, PANEL6_SELECT4, PANEL6_SELECT5, PANEL6_SELECT6,
  PANEL7_SELECT1, PANEL7_SELECT2, PANEL7_SELECT3, PANEL7_SELECT4, PANEL7_SELECT5, PANEL7_SELECT6,
  PANEL8_SELECT1, PANEL8_SELECT2, PANEL8_SELECT3, PANEL8_SELECT4, PANEL8_SELECT5, PANEL8_SELECT6 : Subrange Parameter 0..8 = 0; // 8 is the number of CTRL

I was thinking of iterating through and printing all of the values while testing based on an index count instead of the hard coded Internal Name.

Also, maybe it would have been easier to also create these parameters by iteration through indexes and creating names based on the index value instead of manually creating each parameter when programming them. Of course this might not have been possible in the declaration section.

Steve

No, what you tried to use makes it possible to display the name of the items of a discrete parameter.e.g. If you have a discrete parameter rotary which takes three values “slow”, “fast”, “brake”, the idea is to retrive the three names from the rotary patameter. From a Rackspace GPScript, if you have got the handle name of a plugin, you can get the number of parameters and retrieve their names.

Yes, I’m having problems figuring out how to find the handle name of a plugin in a Rackspace Script.

I tried this after renaming my Scriplet “Steve”

Var Steve  :  PluginBlock
Var i : Integer


Initialization
    i = GetParameterCount(Steve)
End


I got this error in my Script Log

Plugin 'Steve' not found in rackspace 'Rackspace'
Scripting has been disabled for this rackspace
Rackspace (Rackspace) - Plugin 'Steve' not found in rackspace 'Rackspace'
Scripting has been disabled for this rackspace
Uh oh - GP Script runtime error

Yes, I’m new to this and I am primarily using this so that I can study for the future how I might use GP Script to solve client issues as they arise if there is no inherent capabilities built in.

I couldn’t find anything that could iterate through Block Handles. If I tried declaring Steve as a Block instead of a PluginBlock I got this error:

Rackspace (Rackspace) - Semantic error in "Main": Line 3, Col 15: Declarations of this type are not allowed

right-clic on the Rackspace script to auto declare

image

If Steve doesn’t appear it means that the plugin handle name is not defined:

e.g. right-click on the MIDI in plugin:

You can post your gig file if you want us to have a look into it…

Here is the gig script. Auto declare could not find anything.

test.gig (103.6 KB)

Steve

I figured out to set the handle. Now I’m on my way to the next step.

Here you have:

test_Steve.gig (103.2 KB)

Rackspace: Parameter CTRL1 has alias name: CTRL1
Rackspace: Parameter CTRL2 has alias name: CTRL2
Rackspace: Parameter CTRL3 has alias name: CTRL3
Rackspace: Parameter CTRL4 has alias name: CTRL4
Rackspace: Parameter CTRL5 has alias name: CTRL5
Rackspace: Parameter CTRL6 has alias name: CTRL6
Rackspace: Parameter CTRL7 has alias name: CTRL7
Rackspace: Parameter CTRL8 has alias name: CTRL8
Rackspace: Parameter PANEL1_SELECT1 has alias name: PANEL1_SELECT1
Rackspace: Parameter PANEL1_SELECT2 has alias name: PANEL1_SELECT2
Rackspace: Parameter PANEL1_SELECT3 has alias name: PANEL1_SELECT3
Rackspace: Parameter PANEL1_SELECT4 has alias name: PANEL1_SELECT4
Rackspace: Parameter PANEL1_SELECT5 has alias name: PANEL1_SELECT5
Rackspace: Parameter PANEL1_SELECT6 has alias name: PANEL1_SELECT6
Rackspace: Parameter PANEL2_SELECT1 has alias name: PANEL2_SELECT1
Rackspace: Parameter PANEL2_SELECT2 has alias name: PANEL2_SELECT2
Rackspace: Parameter PANEL2_SELECT3 has alias name: PANEL2_SELECT3
Rackspace: Parameter PANEL2_SELECT4 has alias name: PANEL2_SELECT4
Rackspace: Parameter PANEL2_SELECT5 has alias name: PANEL2_SELECT5
Rackspace: Parameter PANEL2_SELECT6 has alias name: PANEL2_SELECT6
Rackspace: Parameter PANEL3_SELECT1 has alias name: PANEL3_SELECT1
Rackspace: Parameter PANEL3_SELECT2 has alias name: PANEL3_SELECT2
Rackspace: Parameter PANEL3_SELECT3 has alias name: PANEL3_SELECT3
Rackspace: Parameter PANEL3_SELECT4 has alias name: PANEL3_SELECT4
Rackspace: Parameter PANEL3_SELECT5 has alias name: PANEL3_SELECT5
Rackspace: Parameter PANEL3_SELECT6 has alias name: PANEL3_SELECT6
Rackspace: Parameter PANEL4_SELECT1 has alias name: PANEL4_SELECT1
Rackspace: Parameter PANEL4_SELECT2 has alias name: PANEL4_SELECT2
Rackspace: Parameter PANEL4_SELECT3 has alias name: PANEL4_SELECT3
Rackspace: Parameter PANEL4_SELECT4 has alias name: PANEL4_SELECT4
Rackspace: Parameter PANEL4_SELECT5 has alias name: PANEL4_SELECT5
Rackspace: Parameter PANEL4_SELECT6 has alias name: PANEL4_SELECT6
Rackspace: Parameter PANEL5_SELECT1 has alias name: PANEL5_SELECT1
Rackspace: Parameter PANEL5_SELECT2 has alias name: PANEL5_SELECT2
Rackspace: Parameter PANEL5_SELECT3 has alias name: PANEL5_SELECT3
Rackspace: Parameter PANEL5_SELECT4 has alias name: PANEL5_SELECT4
Rackspace: Parameter PANEL5_SELECT5 has alias name: PANEL5_SELECT5
Rackspace: Parameter PANEL5_SELECT6 has alias name: PANEL5_SELECT6
Rackspace: Parameter PANEL6_SELECT1 has alias name: PANEL6_SELECT1
Rackspace: Parameter PANEL6_SELECT2 has alias name: PANEL6_SELECT2
Rackspace: Parameter PANEL6_SELECT3 has alias name: PANEL6_SELECT3
Rackspace: Parameter PANEL6_SELECT4 has alias name: PANEL6_SELECT4
Rackspace: Parameter PANEL6_SELECT5 has alias name: PANEL6_SELECT5
Rackspace: Parameter PANEL6_SELECT6 has alias name: PANEL6_SELECT6
Rackspace: Parameter PANEL7_SELECT1 has alias name: PANEL7_SELECT1
Rackspace: Parameter PANEL7_SELECT2 has alias name: PANEL7_SELECT2
Rackspace: Parameter PANEL7_SELECT3 has alias name: PANEL7_SELECT3
Rackspace: Parameter PANEL7_SELECT4 has alias name: PANEL7_SELECT4
Rackspace: Parameter PANEL7_SELECT5 has alias name: PANEL7_SELECT5
Rackspace: Parameter PANEL7_SELECT6 has alias name: PANEL7_SELECT6
Rackspace: Parameter PANEL8_SELECT1 has alias name: PANEL8_SELECT1
Rackspace: Parameter PANEL8_SELECT2 has alias name: PANEL8_SELECT2
Rackspace: Parameter PANEL8_SELECT3 has alias name: PANEL8_SELECT3
Rackspace: Parameter PANEL8_SELECT4 has alias name: PANEL8_SELECT4
Rackspace: Parameter PANEL8_SELECT5 has alias name: PANEL8_SELECT5
Rackspace: Parameter PANEL8_SELECT6 has alias name: PANEL8_SELECT6

Yes, here is the code I created:

// Called automatically after script is loaded

Var Steve  :  PluginBlock
Var i, x : Integer
Var mesg : String

Initialization
    i = GetParameterCount(Steve)
    Print ("Parameter Count=" +i)
    
    for x = 0 ; x <i  ; x=x+1 do
       mesg = GetParameterName(Steve,x)
       Print(mesg)
    End

End

Thanks!

Steve

Index in GPScript start from 0, look at the code in the posted gig file. You should stop out of index range…

Yes, just noticed that. Thanks again!

1 Like