What I have:
I have three scenes in different tops. I connect them to a switch top. With the Index in the switch top I can choose between the Inputs.
What I want:
I want to control the Index of the switch top with keyboard numbers. For example if I press 0 it stets the Index value to 0 and if I press 1 to 1 and so on.
(I could do it for only one toggle [two values] with keyboard in chop and a logic chop. But I dont know how to do it with more than two values)
one solution would be this one, with that python script:
def onOffToOn(channel, sampleIndex, val, prev):
op(‘switch1’).par.index = channel.name
return
using rename to obtain 0, 1, 2 etc channel switch.toe (3.6 KB)
Thank you very much. It is exactly what I needed.
I have to admit that I don’t understand the way it works. But I got which values to change and what to rename to use it in different situations. Maybe once I progress I will get it completly.
I also thought of using the 1 key for the 0 Index, but you already did that for me.
Why ist it that there is a line between the 4th key that I added?
The way it works is quite simple:
– the keyboardin chop receive the key strokes
– rename chop change the channel names: k1 to 0, k2 to 1 etc.
– the python script wait for some on to off event in channels, take the name of the channel where happen the event and put it in the switch index parameter.