Reactions – Difficulty targeting named device

150 viewsCSS QuestionsReactions
0

I have a Reaction that was working in 2.7 that I’m having difficulty setting up in 2.8.5

The goal is use Reactions to look for a device called “High and Low Pass Filter” on a given track, find its position, and map the first macro knob in that audio effect rack to an encoder.

Here’s my Reaction setup:

Listeners: Track’s devices value has changed, script is initialized, track’s data value has changed

Loop: Devices

Conditions: Device – Name — (Text) exactly matches — High & Low Pass Filter

Actions: Modifier: m1, Value To Set: loop – iteration number

Here’s my Parameter Mapping:

Track Selection: Track Type (track), Track number (1), Relative to session box position (No), Include folder tracks (No)

Device Selection: Select or device number (number), Select device number / modifier (m1), Use modifier (checked)

Parameter: Device Parameter (1), Device parameter range: Minimum % (0), Maximum % (100)

Controller Input: Select input (Knob 1), Control Override (default), LED Feedback (default)

It’s mapping Knob 1 but it’s targeting the wrong device. I took screenshots of my 2.7 setup in case I ever need it, and I can’t figure out what’s different about things in the new version.

Does anyone have any ideas?

JohnC Unselected an answer July 6, 2024
1

It could be that the loop is starting at the number 0 (meaning the first device has loop_number 0, second device has loop_number 1, etc…) while the numbering inside the Parameter Mapping starts at 1 for the first device.

If so, this would mean you need to add 1 to the stored loop_number to get the correct device.

I haven’t tested this but it’s a common thing to watch out for.

JohnC Posted new comment July 6, 2024

** SOLUTION FOUND **

Within the python file I found that this block:

try:
reaction_listener_number = 1
loop_is_active = False
loop_number = 0
loop_result_count = len(self.song().tracks[0].devices)
for item in self.song().tracks[0].devices:
loop_is_active = True
if “HLPF” in self.song().tracks[0].devices[loop_number].name:
self.set_modifier_value(“m1”, loop_number)
loop_number = loop_number + 1
loop_is_active = False

One line needed to be edited from:

if “HLPF” in self.song().tracks[0].devices[0].name:

To:

if “HLPF” in self.song().tracks[0].devices[loop_number].name:

With that changed, the script is working properly.

See my reply…

0

@timmons you just need to set the device number to the loop iteration number:
This will give you the same code output

JohnC Unselected an answer July 6, 2024