[chuck-users] From 4Hz to 400Hz

Rustom Mody rustompmody at gmail.com
Sun Jul 17 11:31:39 EDT 2011


Thanks Jordan for taking the time to write that.

However I get

[chuck]: HidIn: couldn't open keyboard 1...

and no change with d or h

Looking at your code I gathered I should try 0 or 1. Same result

Tried it in console (not X windows) Still same.

Fished around in google and came to this on the wiki
http://wiki.cs.princeton.edu/index.php/ChucK/keyboard

So by some guesswork I changed your function keyboardListener to this:
[This is the first chuck I am writing!]


fun void keyboardListener()
{
    KBHit hi;
    int c;
    while(true)
    {
        hi => now;
        while(hi.more())
        {
            //if(msg.isButtonDown())
            hi.getchar() => c;
            {
                if(c == 68) // d
                    2 *=> Voice.multiplier;
                else if(c == 72) // h
                    2 /=> Voice.multiplier;
                else if(c == 73) // i
                    Voice.decreaseSpread();
                else if(c == 79) // o
                    Voice.increaseSpread();
            }
        }
    }
}

At first it did not work until I realized that the d h should be upper case.
Now I get my basic effect.

I cant hear any effect from i/I or o/O but thats minor.

Trying to reduce the jumps to less than half/double I changed the 2 to 1.5
It just goes silent

Changed the
2 *>= Voice.multiplier;
to
5 +=> Voice.multiplier;

chuck dies and I get cpu 100%.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20110717/64090032/attachment.html>


More information about the chuck-users mailing list