Priority when setting a parameter value from different python scripts

Hi. Is there a way to set/determine priority for two python scripts pushing different values to the same par? Currently it seems that the last created or activated script has the higher prio. Would be cool to have finer control over this.

priority.tox (750 Bytes)

Hi @daniel_steenhoff,

hm, can you give us a use case where this is required?
Initial thought would be some logic should be employed that decides which one to give preference.

cheers
Markus

Let’s say a base houses a visual that is used for a live performance. I would like to control the pars of that base in several ways:

  • Recall presets
  • Recall cues
  • Connect a step sequencer to a certain parameter for timed bumps (this connection is not a export/reference/bind, but rather a connection created in a custom UI)
  • Control the parameter with relative midi input (from an encoder)
  • When working with potmeters instead of encoders I like to have the Bind CHOP with pickup enabled
  • Touchscreen input
  • External OSC/DMX input

This can be achieved with a CHOP network that hase some kind of HTP/LTP logic, but I like the flexibility of pushing the values with python. I don’t need all of the above options for each show, and I would like to keep components as standalone as possible. So for each different setup I would like to just drop in bases or containers that do some kind of value handling, but stick to their correct prio.

Sidenote: Is there a downside to how I’m pushing values here? Are references/binds/exports notably faster?

for maximum flexibility (and you prefer to use Python) you could write an Extension which has Dependencies you bind to each parameter.
Then all your controllers for instance call a method on your extension something like
op.mixer.Set("Opacity", value=0.5, priority=2). That way you can give each controller their own priority, and in the Set() method in your Extension you can add all the custom priority/autopickup handling you need. Once the Set() method has decided the latest incoming call had enough priority to override the current live value, it can update the Opacity Dependency value.

Ah thanks that is really interesting. Will give that a try!

Do you know of Darien Brito’s TDMorph? I wonder if it could be helpful. GitHub - DarienBrito/TDMorph: TDMorph, a toolbox for enhanced parametric exploration in TouchDesigner · GitHub