Hello,
I'm trying to program something to make my alph-numeric computerkeybourd work like a music-keyboard : as many keys should play different sounds. The problem I face is that the keys start toggling between key up and key down when they are pressed continously. The left outlet of "keyname" doesn't have the toggling-problem, but reacts on any key. (As you all have noticed, I'm not a computergenius)
Any sugesstions?
Thanks.
-
Keys
-
Hi beerwolf,
Try using [key] (for key down) and [key up] (for key up).
You can look for specific values by specifying them as an argument.
For example, [key 97] will only output if 'a' is pressed down (on my keyboard anyway).
-
Hello Jwif, thanks for your answer.
It might be a specific keyboard problem. If I press fi the a key shortly it gives me an "a", but if I keep it down I get "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".
When writing it's not a problem, but if I want to use it as a "musical" keyboardkey, I get a strage effect, wich can be appealing, but not in the way I want to use it. -
check out [change], which stops multiple messages going through if they are not changed.
-
Yeah as mod mentioned you can use [change]. I think the multiple messages are an OS thing anyway. In OS X you can change the speed of the repeats and add a delay to them after holding down.
-
I believe you had to to this with [keyname] which has an outlet for the pressed status (0 or 1). You'll have to patch around it to make it work though...
|] [] |.| ][|-| -- http://soundcloud.com/domxh
-
I managed to counter the problem by turning off keyrepeat in the accessibilitymenu. This works in vista, strangly enough in xp it works for one key, but it doesn't for two or more keys together. So it's useless to mesince I want to use the device to study microtonality and intervals. I'll try the [change] to make it work without having to change anything. I have been trying [keyname], but the left outlet gives me a 0/1 on any key, and the right outlet in combination with fi [select a] has the toggling problem again.
-
To make something completely generic is not possible I believe. I think you'll have to make a "key watcher" subpatch per key you want to monitor. In combination with [route] i guess one could come up with something that works. I vaguely remember that hardoff once made something like this...
|] [] |.| ][|-| -- http://soundcloud.com/domxh
-
I tried the [change] but than it doesn't swith off when the key is released.
A friend soundengineer has send me something in max without togglingproblems, but unfortunately for me not enough keys. I first tried liberty basic and scratch and now pD-ing away. The road is the goal!! -
Is this what you're looking for. The keyControls subpatch is a bit messy, but on my machine this works.
It's here : http://puredata.hurleur.com/sujet-5228-non-repeated-keys because apparently you cannot post patches in this part of the forum.
I've noticed that on xp it doesn't work for more than 4 keys at the same time.
|] [] |.| ][|-| -- http://soundcloud.com/domxh
-
Apperently it depends on wich key you press. I can combine azeryio the same time, but when I start with t I can only add one other key, and the computer itself gives me a warning bleep. Windows logic?
The patch I made has the same combinationlimitations. Your patch is far easier to use and I don't have to mess with accessibilaty.
Thanks a lot!!
One little question, I don't see the us of the [change], it works as well when I let it out. -
I assumed that the keyname keeps on spitting out 1's and 0's (following the repeat rate of the keyboard), but apparently it doesn't so then indeed change is not necessary.
|] [] |.| ][|-| -- http://soundcloud.com/domxh