[PD] Key-repeat makes keyboard-pianokeys impossible?
Hans-Christoph Steiner
hans at eds.org
Tue Jul 18 07:19:50 CEST 2006
On Jul 17, 2006, at 2:49 PM, Chuckk Hubbard wrote:
> On 7/17/06, Frank Barknecht <fbar at footils.org> wrote:
>> Hallo,
>> Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:
>>
>> > 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.
>>
>> I don't see that it's a bug in the [key] object. The operating
>> systems
>> I know all provide autorepeating keys: If you press and hold a
>> key, it
>> will start to generate keyup/keydown messages after a while with a
>> certain frequency. On X11 this can be changed with the "xset"
>> command.
>>
>> Now what Garageband probably does is disable this key-repeat if
>> Garageband has the focus, and enables it again, if the focus is lost
>> or if an entry field gets the focus.
>>
>> However this won't work in Pd: We cannot disable autorepeat everytime
>> Pd has the focus, because that would make editing uncomfortable to
>> say
>> the least and for some applications autorepeat is useful outside of
>> edit mode as well. So it's not something, [key] could fix. The
>> solution is to leave it up to the user to take care of his/her
>> autorepeat settings for example with "xset" (and [shell]).
>>
>> An external to change autorepeat settings from inside Pd would be
>> nice, tough.
>
> I think that or manually changing settings would be the only way. I
> just did a little timer test, and the default settings on OSX are set
> up so that the first keyup when autorepeating comes about 525 ms after
> the keydown. So to filter that would require ignoring events from the
> same key within about 550 ms of each other. At 120 bpm, a quarter
> note would stay on indefinitely. What good is keyboard note control
> if you can't play Stars & Stripes Forever? It would literally be
> forever.
I forgot to mention, you can use [hid] with keyboards and get the raw
events, i.e. key-down and key-up. That'll work on Mac OS X and GNU/
Linux.
.hc
------------------------------------------------------------------------
I have the audacity to believe that peoples everywhere can have three
meals a day for their bodies, education and culture for their minds,
and dignity, equality and freedom for their spirits. - Martin
Luther King, Jr.
More information about the Pd-list
mailing list