Get the CHOP channel that is outputing values

Essentially I want to hit 1 on my keyboard and get 1, 2 and get 2. Right now I’m using the dumbest way, I have 1~6 on my Keyboard In CHOP, and I assigned 6 maths, one to each channel, is there a better way of doing this?

I have attached an example with a couple of possible solutions.

the keyboard in DAT could be set to ‘Perform Window Only’.

hope that helps.
Keyboard in.toe (4.3 KB)

YES! Thank you so much <3

Is there a way to make it only register key down with the DAT?
I’m trying to make a synth using touchdesigner and I’m trying to use the numbers as pitch control, right now with the dat it refreshes on key up too. Or is there a way to hold the last key pressed with the fan?

If I understood what you are trying to accomplish, between the keyboard in CHOP and the keyboard in DAT you should have all the options you need.

with the keyboard in CHOP, if you hold down a key, it will hold that value for as long as that key is pressed, similarly to a MIDI keyboard note on / note off principle, or a momentary button in TD.

with the keyboard in DAT, the last value is held until a different key is registered, similarly to radio buttons in TD.

hope that helps!

I have attached a second example with a small tweak.

I have set the fan chop to ‘set to -1’ for all channels off.
Now keys 1 to 6 release their value when not pressed, and value of 0 could be your note off.

That should do what you are after.
Keyboard in v2.toe (4.29 KB)