Freeze when using linked Widgets on Scriptlets with "ParameterValueChanged" event

I can consistently cause GigPerformer to Freeze when I do this:

  1. Create a Rack with 2 Scriptlets. “Scriptlet1” and “Scriptlet2”
  2. In scriptlet1 put this code:
    var	HardwareSetup("Hardware Setup") : parameter  "A","B","C","D" = "A"

    // Called when a parameter value has changed
    On ParameterValueChanged matching HardwareSetup

    End
  1. Put the following code in Scriptlet2.
    var HardwareSetup("Hardware Setup") : parameter "A","B","C","D" = "A"

  2. Now on a Panel add two knobs.

  3. Map Knob1 to The Scriptlet1 Parameter “HardwareSetup”

  4. Map Knob2 to The Scriptlet2 Parameter “HardwareSetup”

  5. Set the “Widget Link” to “A” for both controls.

  6. Save

Once you are in normal mode, if you rotate the Knobs, gig performer freezes.
Same problem occurs if I use a number range (ex 1…4) instead of string values.
I’ve put a print command in the “ParemeterValueChanged” and the event does stop firing as well (ot at least stops printing).

Any suggestions on how to respond to a Parameter Change on a scriptlet while using linked widgets would be appreciated.

Can you upload a small gig file showing the issue?
What version of Gig Performer are you using, Mac or Windows?

Sample Gig File
Version 4.7, On Windows (11)

I loaded your gig and set the Widget Link Property of both widget to “A”
Then I moved the widgets, not issue at all.
I used the most recent version 4.8.2

What version are you using PA Edition or Deskew?

Please download and test again.

Thx

Deskew, downloaded 4.8.2. Still happens.
Windows 11 v23H2, build 22631.3296
11th Gen Intel(R) Core™ i7-11800H @ 2.30GHz 2.30 GHz
32 Gig Ram
Will try on a backup machine when I have a moment.

I can reproduce this on Windows version GP 4.8.2

Moving a knob, GP hangs and becomes unresponsive.
CPU usage for GP goes up to about 20% in Task Manager.

On Mac M1 this does not happen

I’m not quite sure why this is only happening on Windows but somehow it would seem that there is a recursive loop.

Will have to study further

Thanks for checking.

Seems that way. What is odd is the event stops firing (at list if I put a print in the event, it stops showing up).

My assumption is the following. Each time you move knob1 to update Scriptlet1 parameter, you continuously send values (not only discrete string values) to Scriptlet 1 (which in turn end its parameter value back to knob1) and to knob2 as they are synced. The process is then the same for knob2. All these communication are asynchronous which can be subject to race conditions. e.g. knob2 is continuously update bu knob1 and also continuously updated but Scriptlet2 parameter feedback and as values are not perfectly synced it will cause some loops.

Is there a way for you to merge Scriptlet1 and Scriptlet2 and to keep one single parameter (as these parameters are supposed to be synced) ?

Hi David,
Thanks. If you look in my sample there is no code in the event and I am not intentionally creating a loop back update. Note also that it appears this only happens in the Windows version and not the Mac version based on some of the other attempts to recreate noted above.

On your suggestion on merging the scripts. Unfortunately, no, in the real world the scripts serve different functions on different widgets. I might have 3-4 for that I am trying to keep in sync using the Link feature.

There is still implicit code execution.

Curious — can you replicate this issue on Windows if you use integers (or just the default floating point parameters) rather than strings?

If you change to
var HardwareSetup("Hardware Setup") : parameter 1..4 = 1
it still hangs.

To go further, you the OnParameter event doesn’t have to be against the linked or bound parameter.

    var	HardwareSetup("Hardware Setup") : parameter  1..4 = 1
    var	HardwareSetup2("Hardware Setup2") : parameter  1..4 = 1

    // Called when a parameter value has changed
    On ParameterValueChanged matching HardwareSetup2

    End

this will fail as well even through it is HardwareSetup (not hardwareSetup2) that is changing.

1 Like

I noticed this as well. That On ParameterValueChanged line can be commented out and it will still hang.

Correct - they’re parameters and changing one widget causes the scriptlet parameter to change, which is calling the widget back (which is then triggering the other widget due to the link) which then changes its parameter which then calls it back and the loop goes on.

I have to look at this more closely - I don’t understand (yet) why this is only happening on Windows.

1 Like

Exactly what I tried to explain. :+1: The callback has nothing to do in the present issue.

Blockquote Exactly what I tried to explain. :+1: The callback has nothing to do in the present issue

Why, then if there is no script/callback it works? There has to be a relationship doesn’t there?

I presume, because it probably changes a bit the timing of the parameters feedback. But it is not the source of the issue.