<div class="gmail_quote">On Thu, Jul 21, 2011 at 12:36 PM,  <span dir="ltr"><<a href="mailto:tempjayren@gmail.com" target="_blank">tempjayren@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
what did i break now?<br>
i snipped the code from the message, though when i ran it it said<br>
something about an undefined variable.<br>
i wanted to see what was going on.<br>
<div><div></div><br></div></blockquote></div><br>Thanks for looking. The full code is below.<br>It works as given ie it starts as a 2 vs 3 polyrhythm.<br>You can speed it up by pressing D until the polyrhythm becomes 2 notes<br>

However if I want to speed up by less than factor of 2 then it breaks.<br><br>About 11 lines from the end: the line<br> 2 *=> Voice.multiplier;<br>if changed to <br>1.5 *=> Voice.multiplier;<br><br>Then it dies after a D and cpu shows 100%<br>

This is debian linux.<br><br>There are one or two other enhancements also I would like<br>Can I make the clicks sound a little different from each other?<br><br>Note the full context is on the other thread: Subject: From 4Hz to 400 Hz<br>
---------------------------<br>
class Voice<br>{<br>    1.0 => static float multiplier;<br>    1.0 => static float spread;<br>    float freq;<br>    float pan;<br>    Impulse imp;<br>    Pan2 p;<br><br>    fun static Voice Voice(float freq, float pan)<br>

    {<br>        Voice v;<br>        freq => v.freq;<br>        pan => v.pan;<br>        spork ~ v.cycle();<br>        return v;<br>    }<br><br>    fun void cycle()<br>    {<br>        float targetFreq;<br>        dur targetBeat;<br>

        imp => p => dac;<br>        while(true)<br>        {<br>            freq * multiplier => targetFreq;<br>            1::second / targetFreq => targetBeat;<br>            targetBeat - (now % targetBeat) => now;<br>

            pan * spread => p.pan;<br>            1.0 => imp.next;<br>        }<br>    }<br>}<br><br>fun void keyboardListener()<br>{<br>    KBHit hi;<br>    int c;<br>    int tt;<br>    while(true)<br>    {<br>        hi => now;<br>

        while(hi.more())<br>        {<br>        hi.getchar() => c;<br>            {<br>                if(c == 68) // D<br>                    2 *=> Voice.multiplier;<br>                else if(c == 72) // H<br>                    2 /=> Voice.multiplier;<br>

            }<br>        }<br>    }<br>}<br><br>Voice.Voice(3.0, -1);<br>Voice.Voice(2.0, 1);<br>spork ~ keyboardListener();<br>while(true) { 100::ms => now; }<br><br>