Csound Csound-dev Csound-tekno Search About

Re: [Csnd] sensekey + keydown

Date2013-07-18 15:18
From"Art Hunkins"
SubjectRe: [Csnd] sensekey + keydown
I seem to recall that I dealt with this issue successfully sometime in the past. I can't remember just what I did (though I'm sure my solution appears in my realtime projects prior to a year ago or so).
 
What occurs to me now is adding code in Csound that looks for immesdiately repeated keystrokes (sensekey) and discards them if a minimum of time has not gone by. This is not difficult to do.
 
Art Hunkins
----- Original Message -----
Sent: Thursday, July 18, 2013 8:15 AM
Subject: Re: [Csnd] sensekey + keydown

ansi terminals, afaik, have no concept of "key up" as an event

With ncurses you can get these kind of extended events from compatible terminal emulators, but I don't think csound has ncurses input support at the moment? It may be more pragmatic to throw together a small python program using their curses lib http://docs.python.org/2/howto/curses.html - or you could wait until someone decides to add ncurses input handling to csound.


On Thu, Jul 18, 2013 at 2:46 AM, Luis Antunes Pena <k_o_m_p@yahoo.de> wrote:
Joachim: thank you for this. I was not aware of this feature.
one more thing: when I use the Terminal it doesn't sense the key release. When using QuteCsound it works fine with the expected behavior. Does anyone knows how to change this in the Terminal?
Thanks,
Luís

Am 11.07.13 07:40, schrieb joachim heintz:
go to system preferences > keyboard > keyboard tab > delay until repeat = off

    j



Am 11.07.2013 04:56, schrieb Luis Antunes Pena:
I have no idea how to turn the key repetition off under OSX 10.6. Does
anyone ever done this before?
Thanks,
Luis

Am 10.07.13 23:08, schrieb joachim heintz:
did you try what justin said about automatic repetition? i do also
think that's the problem.
best -
    joachim


Am 10.07.2013 22:57, schrieb Luis Antunes Pena:
Thanks for taking a look. Here is a simple test csd.
Best,
Luis

Am 10.07.13 16:49, schrieb peiman khosravi:
Hello,

I will test this here if could send me a csd please.

Best,
Peiman




*www.peimankhosravi.co.uk <http://www.peimankhosravi.co.uk> || RSS
Feed <http://peimankhosravi.co.uk/miscposts.rss> || Concert News
<http://spectralkimia.wordpress.com/>*


On 10 July 2013 11:17, Luis Antunes Pena <k_o_m_p@yahoo.de
<mailto:k_o_m_p@yahoo.de>> wrote:

    Hello,

    I would like to ask you about the keydown funtion in the sensekey
    opcode. The manual describes it like this:

    kkeydown - returns 1 if the key was pressed, 0 if it was released
    or if there is no key event.


    testing this with printk2 when a key is pressed and not released
    the results are these:


    y i1 1.00000
    i1 0.00000
    y i1 1.00000
    i1 0.00000
    y i1 1.00000
    i1 0.00000

    ...

    so actually pressing the y key it returns that the key as been
    pressed but also that the key as been released which is not the
case.


    Am I missing something, or is this a bug?

    I'm running Csound version 5.19.02 (float samples) Jan 20 2013
    with Mac OSX 10.6

    Thanks for any advice.

    Best,
    Luís





Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
csound"




Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




--
luis antunes pena
Severinswall 54
D-50678 Köln

http://luisantunespena.eu

+49 (0)221 29020757
+49 (0)176 968 09 867 (mobile)


Date2013-07-18 16:57
FromJustin Smith
SubjectRe: [Csnd] sensekey + keydown
A correction to what I said above: terminals only provide the ANSI interface, which does not provide any key release information, even with curses extensions.

The best approach if you need key release information is to use a GUI toolkit that interprets input events (QT, TK and GTK are cross platform and work on the 3 big platforms, every platform has a myriad of other options). Accessing the raw input device is also an option, if not a portable or convenient one.


On Thu, Jul 18, 2013 at 7:18 AM, Art Hunkins <abhunkin@uncg.edu> wrote:
I seem to recall that I dealt with this issue successfully sometime in the past. I can't remember just what I did (though I'm sure my solution appears in my realtime projects prior to a year ago or so).
 
What occurs to me now is adding code in Csound that looks for immesdiately repeated keystrokes (sensekey) and discards them if a minimum of time has not gone by. This is not difficult to do.
 
Art Hunkins
----- Original Message -----
Sent: Thursday, July 18, 2013 8:15 AM
Subject: Re: [Csnd] sensekey + keydown

ansi terminals, afaik, have no concept of "key up" as an event

With ncurses you can get these kind of extended events from compatible terminal emulators, but I don't think csound has ncurses input support at the moment? It may be more pragmatic to throw together a small python program using their curses lib http://docs.python.org/2/howto/curses.html - or you could wait until someone decides to add ncurses input handling to csound.


On Thu, Jul 18, 2013 at 2:46 AM, Luis Antunes Pena <k_o_m_p@yahoo.de> wrote:
Joachim: thank you for this. I was not aware of this feature.
one more thing: when I use the Terminal it doesn't sense the key release. When using QuteCsound it works fine with the expected behavior. Does anyone knows how to change this in the Terminal?
Thanks,
Luís

Am 11.07.13 07:40, schrieb joachim heintz:
go to system preferences > keyboard > keyboard tab > delay until repeat = off

    j



Am 11.07.2013 04:56, schrieb Luis Antunes Pena:
I have no idea how to turn the key repetition off under OSX 10.6. Does
anyone ever done this before?
Thanks,
Luis

Am 10.07.13 23:08, schrieb joachim heintz:
did you try what justin said about automatic repetition? i do also
think that's the problem.
best -
    joachim


Am 10.07.2013 22:57, schrieb Luis Antunes Pena:
Thanks for taking a look. Here is a simple test csd.
Best,
Luis

Am 10.07.13 16:49, schrieb peiman khosravi:
Hello,

I will test this here if could send me a csd please.

Best,
Peiman




*www.peimankhosravi.co.uk <http://www.peimankhosravi.co.uk> || RSS
Feed <http://peimankhosravi.co.uk/miscposts.rss> || Concert News
<http://spectralkimia.wordpress.com/>*


On 10 July 2013 11:17, Luis Antunes Pena <k_o_m_p@yahoo.de
<mailto:k_o_m_p@yahoo.de>> wrote:

    Hello,

    I would like to ask you about the keydown funtion in the sensekey
    opcode. The manual describes it like this:

    kkeydown - returns 1 if the key was pressed, 0 if it was released
    or if there is no key event.


    testing this with printk2 when a key is pressed and not released
    the results are these:


    y i1 1.00000
    i1 0.00000
    y i1 1.00000
    i1 0.00000
    y i1 1.00000
    i1 0.00000

    ...

    so actually pressing the y key it returns that the key as been
    pressed but also that the key as been released which is not the
case.


    Am I missing something, or is this a bug?

    I'm running Csound version 5.19.02 (float samples) Jan 20 2013
    with Mac OSX 10.6

    Thanks for any advice.

    Best,
    Luís





Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
csound"




Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




--
luis antunes pena
Severinswall 54
D-50678 Köln

http://luisantunespena.eu

+49 (0)221 29020757
+49 (0)176 968 09 867 (mobile)