Hi guys!
I’m trying to make an instrument where I can change some parameters when two keys from the PC keyboard are pressed. For instance, I want to alter some kIdx variable that affects a parameter kParam when I press the down or up keys. To select the kParam I will use the letter “p” on the keyboard, hence the need for two different key values. I’m trying to do it with the sensekey opcode, but the variable it affects is univoque (just one value at a time). Do you have any idea of how could I implement this logic? So far, my test is functioning like this (it’s playing one event or another, not both):
instr 1
kKeyLetter, kKeyPressed sensekey
if (kKeyLetter == 105) then ; letter “i”
event “i”, 2, 0, 3, 110
endif
if (kKeyLetter == 32) then ; space bar
event “i”, 2, 0, 3, 550
endif
endin
instr 2
aenv linen .8, p3*.2, p3, p3*.5
asig poscil aenv, p4
out asig
endin
Thank you in advance!