Mappin meter widgets to an Audio Mixer

Hey all,
I’m banging my head against a scripting wall in Gig Performer 5.0.40 (clean install from gigperformer.com). I want to map meter widgets to an Audio Mixer (mix32)’s Channel Magnitude parameters in Global Rackspace, reusable in Local ones. Script’s simple:

Var
  mix32 : PluginBlock
  KORG1L : Widget
  KORG2R : Widget
  EP43L  : Widget
  EP44R  : Widget

Initialization
  SetPluginParameterWidget(mix32, "Channel 1 Magnitude", KORG1L)
  SetPluginParameterWidget(mix32, "Channel 2 Magnitude", KORG2R)
  SetPluginParameterWidget(mix32, "Channel 3 Magnitude", EP43L)
  SetPluginParameterWidget(mix32, "Channel 4 Magnitude", EP44R)
End

Error: Semantic error in “Main”: Line 9, Col 3: Unknown identifier: SetPluginParameterWidget.

Odd Bit: Before reinstall, GetWidgetByName and others failed too—only SetWidgetValue worked. After a clean install, same error persists, even though docs list SetPluginParameterWidget. Is this a bug, install glitch, or am I missing something dumb (handle setup?)? Polling with SetWidgetValue works, but I want native mapping.

Help appreciated—thanks!

Test audio metering.gig (319.9 KB)

p.s.
Since I’m not very ‘script literate’, I’ve asked Grok for help but after few attempts, I don’t know what else to do… :slight_smile:

Where did you read about this function?

1 Like

Are you looking for something like:

MapWidgetToPlugin : Map a widget to the specified parameter of the specified plugin

  • Declaration: function MapWidgetToPlugin (w : Widget, plugin : Block, parameterNumber : Integer) autotype
  • Category: Widgets
    Parameters * w : Widget
    • plugin : Block
    • parameterNumber : Integer
  • Autotype

If, yes, why do you need GPScript for this? :thinking:

1 Like

I suppose Grok made it up: Grok (chatbot) - Wikipedia

3 Likes

Too funny!

1 Like

Oh… so it’s in the vein of users who enhance my Scriptlets with AI and complain when they don’t work the same, forgetting to mention that they’ve been modified a bit in sorcerer’s apprentice mode. I’m still not getting used to this new trend. :man_mage::magic_wand::wink:

An important lesson:
Using AI to get something 80% right still means its 20% wrong.
I don’t know about you, but I like my educational material to be a lot more precise and correct. :slight_smile:

1 Like

:astonished: :man_facepalming: :lying_face: :flushed:

Grok, where in the documentation did you find SetPluginParameterWidget? I just can’t find it.

Blockquote

You’re absolutely right to question this, and I owe you a massive apology—I’ve led us down a rabbit hole with SetPluginParameterWidget. After your prompt, I’ve triple-checked the Gig Performer 5.0.40 documentation, and here’s the truth: there is no SetPluginParameterWidget function in the official GPScript System Function List or anywhere else in the 5.0 docs. I’ve been operating under a colossal misunderstanding, and I’m kicking myself for not catching this sooner. Let’s clear the air, figure out where my wires got crossed, and confirm why your working solution with MapWidgetToPlugin is the real deal.
Where I Looked and What I Found
I revisited the key GP 5.0.40 resources you pointed me to earlier:
System Function List (https://gigperformer.com/docs_5_0/SystemFunctionList.html):
Searched for SetPluginParameterWidget—not listed.

Relevant functions:
MapWidgetToPlugin(w : Widget, plugin : Block, parameterNumber : Integer): Maps a widget to a plugin parameter by index (this is what David-san suggested and you got working).

SetWidgetValue(widget : Widget, value : Double): Sets a widget’s value (worked for you earlier).

GetParameterValue(plugin : PluginBlock, paramName : String) : Double: Gets a parameter’s value (used in polling).

No SetPluginParameterWidget or anything close with a paramName : String signature.

Language Manual (Introduction to GPScript for Gig Performer):
No mention of SetPluginParameterWidget in event handlers, functions, or examples—just MapWidgetToPlugin under widget control (section 8).

GPScript Overview (The GPScript Programming Language - Gig Performer®):
Broad strokes about widget/plugin interaction, no specific function list—nothing on SetPluginParameterWidget.

Community Forum (Scripting with Gig Performer - Gig Performer Community):
Searched posts—no hits for SetPluginParameterWidget. Users use MapWidgetToPlugin or manual mapping for similar tasks (e.g., https://community.gigperformer.com/t/scripting-plugin-parameter-control/10875 uses MapWidgetToPlugin).

Where Did SetPluginParameterWidget Come From?
I’ve been racking my brain to trace this blunder:
My Mistake: I conflated SetPluginParameterWidget with MapWidgetToPlugin, assuming a name-based mapping function existed because it feels logical (e.g., paramName : String vs. index). I likely misremembered from earlier GP versions or other scripting languages, then ran with it unchecked.

Docs Confusion: The 5.0 System Function List has SetPluginParameterValue(plugin : PluginBlock, paramName : String, value : Double) (sets a parameter’s value), and I might’ve morphed that into a nonexistent widget-mapping cousin.

Community Echo: Some posts casually mention mapping widgets to parameters, and I filled in the blank with a phantom function—e.g., I misread MapWidgetToPlugin examples as something else.

I was dead wrong—it’s not in the 5.0.40 docs, and your “Unknown identifier” error was GP telling me, “This ain’t a thing!” I’m so sorry for dragging you through that mess—your clean install didn’t “fix” it because there was nothing to fix; I fed you a ghost function.

Blockquote

Thank you, David-san! :pray: Yes, this is exactly what I was looking for. Why do I need GPScript? For automation. I have 12 VSTs in the Global Rackspace (for efficient memory management and consistency). When I copy and paste them into Local Rackspaces—I only have a few for over 100 songs—the widgets are mapped correctly, but I’d otherwise have to manually connect the meters to the Audio Mixer each time. Now, with a script in the Global Rackspace that I can simply run in a Local Rackspace, all the meters connect instantly.

Your workflow is still not clear to me. Why do you need to copy in a local Rackspace plugins that are already in your global Rackspace. And if you have the same mixer in every Rackspace why can’t you reuse it with its mapping ? :thinking:

David-san, I don’t copy plugins; I only copy widgets from Global to the Local front panel. They stay mapped if I hold down ‘Shift’ while pasting. The meters get pasted with their mappings too, but they stop working. As far as I know, there’s no other way to send an audio signal from Global to Local Rackspace except through the ‘To Rackspaces’ block. Then, in the Local Rackspace, I receive the audio via the ‘From Rackspaces’ block, but its outputs can’t be directly mapped to a meter widget. So, I use an Audio Mixer to handle that."