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? // the patch sndbuf buf => dac; sndbuf buf2 => dac; sndbuf @ curbuf; sndbuf @ nextbuf; 2 => buf.interp; 2 => buf2.interp; // load the file "/home/charles/test.wav" => buf.read; "/home/charles/test.wav" => buf2.read; // set the playback rate (1.0 is default) 1.0 => buf.play; 1.0 => buf2.play; buf @=> curbuf; buf2 @=> nextbuf; 0 =>int u; buf.samples() => int size; std.rand2(0, size) =>int nextpos; 100::ms => dur stepping; nextpos => nextbuf.pos; 0.0 => float mixer; 1.0 => curbuf.gain; 0.0 => nextbuf.gain; // time loop sndbuf @ swap; while( true ) { 1 +=> u; if ( u>30 ) { 5::ms => stepping; 0.05 +=> mixer; 1.0 - mixer => curbuf.gain; mixer => nextbuf.gain; if ( mixer > 0.95 ) { std.rand2(0 , size) => nextpos; curbuf => swap; nextbuf => curbuf; swap => nextbuf; nextpos => nextbuf.pos; 0.0 => mixer; 0 => u; 100::ms => stepping; } } stepping => now; } --------------------------------- 1GB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo Abrí tu cuenta aquí
Hi Charlls!
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?
...
// time loop sndbuf @ swap; while( true ) {
...
curbuf => swap; nextbuf => curbuf; swap => nextbuf;
To do explicit assignment with objects, you need to use @=>. Perhaps this is something we need to make more clear in the language... I hope this helps. Best, Ge!
participants (2)
-
Charlls Quarra
-
Ge Wang