Dear list,<br><br>Here's a small exercise testing the "new" feature, it generates noise according to the classical "3x+1" series;<br><br>//may generate extreme signals. Mind your ears, speakers and neighbours, please<br>
class Foo extends Step<br>    {<br>    true => next;<br><br>    spork ~ gen();<br>    fun void gen()<br>        {<br>        50 => int x;<br>        1 => float value;<br>        while (true)<br>            {<br>            if (x == 1) Std.rand2(1, 100) => x;<br>
            else if (x % 2) 1 + (3 * x) => x;<br>            else x / 2 => x;<br><br>            x::samp => now;            <br>            last() * -1 => next;<br>            }<br>        }<br>    }<br><br>Foo bar => dac;<br>
3::minute => now;<br><br>Notice that we can use .last() and .next() from inside of the class; this is nice. Not so clear -yet- is whether we can create our own "tick" that will be called every samp at the moment the UGen is ticked by the one downstream or whether we could get to values send into this by the ChucK operator... but it works and it's nice!<br>
<br>Yours,<br>Kas.<br>