Script led feedback with modifier

239 viewsCSS Community Scriptsled feedback modifier
0

Hello everyone, small problem with my script. I’ll just show you the part of my script that is causing the problem.
Following the advice of the community, I assign the value of the track that contains “LC1” in its name to the modifier m1. I set m1=-1 if the track does not contain “LC1” to be able to manage the feedback LED.
If m1=-1, the LEDs are off.

Everything works as expected except if the m1 track does not exist, the encoders of my controller (track 1 of the controller) move the parameters of the devices of the last track of the session.
So I thought about assigning to the tracks that do not contain “LC1” the value of a modifier that I do not use like m9=1. So I no longer have a problem with an encoder that moves the parameters of a non-“LC1” track.
But then I can’t configure my LED feedback for the LC1 track (m1). especially to turn off the LEDs if I delete the “LC1” track
In my script I copy this technique for LC2=m2 etc up to m8.
Thanks in advance if you can help me.

gwen971 Answered question December 30, 2024
0

Tracks is a list and we refer to an item in the list with index numbers where the first item in the list has index 0, like this: Tracks[0]

You already knew this, I think, because you’re using it in your script by storing that index in a modifier:
Tracks[modifier]

What you might not have known is that you can access items in a list in a reverse order by using negative numbers. The last item in the list is then -1, the second to last is -2:
Tracks[-1]

Because you’re storing -1 in the modifier, you’re basically telling your script to use the last track.

You could instead use the keyword None and use Conditions that check if the Modifier == None to exit the Reaction with.

Glenn Verhaeghe Answered question December 24, 2024
0

Thanks it’s work perfect

gwen971 Answered question December 30, 2024