Page 1 of 1

Help getting switches bidirectional

Posted: 07 May 2015 01:38
by logarishm
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.

Image

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:

Code: Select all

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:

Code: Select all

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!! :)

Re: Help getting switches bidirectional

Posted: 08 May 2015 18:32
by Softcore
;)

Code: Select all

decl val=subarray(MIDI_ARGS,1,1)/4;  //get a value between 0 and 31;
Switches.x=0;
Switches.x[val]=1;

Re: Help getting switches bidirectional

Posted: 08 May 2015 23:09
by logarishm
Ohhhh, thank you very much!!!
I,ll try this tomorrow first in the morning... You saved my life... ;)

All the best!

Re: Help getting switches bidirectional

Posted: 09 May 2015 15:56
by logarishm
Softcore

It worked perfectly. I really apreciate your help.

Thanks!! :D

Re: Help getting switches bidirectional

Posted: 12 May 2015 11:40
by Softcore
;)