OSX actually puts out a key release every time it repeats a key, so you still get a string of 1 0 1 0 1 0 etc.
On 7/17/06, matthew jones mj@isvr.soton.ac.uk wrote:
Wouldn't it be straightforward to route all the expected ascii numbers to seperate [change] objects? The change can be used to prevent repeated numbers going through, so if you clear it with the keyup you can prevent the key repeats. I attached a tiny patch to show this, where the keydown code is packed with a nonzero number, and the keyup is packed with zero, so that after the route the change object sees only a 1 or 0. I'm sure somebody can come up with a nicer way to do this (with an abstraction or something)because this way requires you to manually make a [change] object for each ascii code required, plus the route needs to be edited each time a new key is required.... good luck,
Matt
-=-=-=-=-=-=-=-=-=-=-=- http://www.loopit.org -=-=-=-=-=-=-=-=-=-=-=- ----- Original Message ----- From: "Hans-Christoph Steiner" hans@eds.org To: "Luke Iannini (pd)" lukexipd@gmail.com Cc: pd-list@iem.at Sent: Monday, July 17, 2006 5:00 PM Subject: Re: [PD] Key-repeat makes keyboard-pianokeys impossible?
This is a known bug on all platforms, it has to do with the implementation of the [key] object. It would be nice to have it fixed to provide a proper key-down and key-up message instead of that pulsing. Any volunteers?
.hc
On Jul 16, 2006, at 11:54 PM, Luke Iannini (pd) wrote:
Hi all, I am being ushered to sleep so I have little time to explain this in detail, but hopefully that just means you'll all be spared tedious detail that would obfuscate the issue : ).
I'm trying to build a simple computer-key piano such as the one in Apple's GarageBand using the [key] object, and I'd like to be able to hold the keys down rather than have single shot. Key helpfully provides 0/1 notifiers for keydown and keyup - but OS X's built-in key-repeat makes it infinitely retrigger the keypress when held. The GarageBand keyboard does not do this, so I was hoping someone might have some ideas on getting around this so I don't have to pull out my (rather unportable) midi-controller when I'm patching on the road.
Thanks!
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
I spent 33 years and four months in active military service and during that period I spent most of my time as a high class muscle man for Big Business, for Wall Street and the bankers. - General Smedley Butler
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list