<br> This program kills chuck 1.2.0.4 after u>30, when curbuf and nextbuf references are swapped. There is something blatantly wrong with this code?<br> <br> // the patch <br> sndbuf buf => dac;<br> sndbuf buf2 => dac;<br> sndbuf @ curbuf;<br> sndbuf @ nextbuf;<br> <br> 2 => buf.interp;<br> 2 => buf2.interp;<br> // load the file<br> "/home/charles/test.wav" => buf.read;<br> "/home/charles/test.wav" => buf2.read;<br> <br> // set the playback rate (1.0 is default)<br> 1.0 => buf.play; <br> 1.0 => buf2.play;<br> buf @=> curbuf;<br> buf2 @=> nextbuf;<br> <br> 0 =>int u; <br> buf.samples() => int size;<br> std.rand2(0, size) =>int nextpos;<br> 100::ms => dur stepping;<br> nextpos => nextbuf.pos;<br> 0.0 => float mixer;<br> 1.0 => curbuf.gain;<br> 0.0 => nextbuf.gain;<br> // time loop<br> sndbuf @ swap;<br> while( true )<br> {<br> 1 +=> u;<br> if ( u>30 )<br> {<br>
5::ms => stepping; <br> 0.05 +=> mixer;<br> 1.0 - mixer => curbuf.gain;<br> mixer => nextbuf.gain;<br> if ( mixer > 0.95 )<br> {<br> std.rand2(0 , size) => nextpos;<br> curbuf => swap;<br> nextbuf => curbuf;<br> swap => nextbuf;<br> nextpos => nextbuf.pos;<br> 0.0 => mixer;<br> 0 => u; <br> 100::ms => stepping;<br> } <br> }<br> stepping => now;<br> }<br> <p>
                <hr size=1>
<font color="#9900FF"><b>1GB gratis</b></font>, Antivirus y Antispam<br>
<font color="#9900FF">Correo Yahoo!</font>, el mejor correo web del mundo<br>
<a href="http://login.yahoo.com/config/mail?.intl=ar">Abrí tu cuenta aquí</a>