General

Help getting switches bidirectional

Started by logarishm on .

Sign in or create an account to join the conversation.

5 posts

Topic starter
Hello!

I´m getting nuts with this, and can´t find anything in the forum...
I have a group of switches in radio mode to select the LFO sync tempo on my hardware synth and it works fine.

[img]https://dl.dropboxusercontent.com/u/47971490/switches.png[/img]

What i want is turn ON the corresponding switch when i move the tempo knob in the synth. In any knob or fader assigned to a CC there is bidirectional comunication and i want to get this switches bidirectional too.

For the output i use cltout() function. And i´m trying to use an script in ON MIDI mode to change the activated switch. The midi target, CC number etc in the script is allrigth, and the script works fine on a fader (for testing purposes) with this expresion:
x=subarray(MIDI_ARGS,1,1)/127;
It gets the value of the control, converts it to 0.000-1.000 value and it´s just fine.
But when trying to apply it to the switches doesn´t work. What i have at this moment is this:
decl val=subarray(MIDI_ARGS,1,1)/4;  //get a value between 0 and 31;
set(switches.x,1,val);
Any help? Any experience with something like this?

Thanks!! :)