Hello Is there any way for the two loops below to run simultaneously from the same shred? I'm wondering if, instead of weaving them together in the same "while true," I could separate them into different functions (but running at the same time), or something like that? Any responses/links would be much appreciated. Thanks! ------------------------------------------------------------------------ { std.rand2f(.51,.49)::T=>now; p.pan()*-1=> p.pan; 0 => buf.pos; Std.rand2f(.6,.9) => buf.gain; .5::T => now; } { std.rand2f(.013,.03)=> tim.mix; std.rand2f(.013,.03)=> mit.mix; 0 => fub.pos; Std.rand2f(.8,.9) => fub.gain; .5::T => now; 0 => fub.pos; Std.rand2f(.3,.2) => fub.gain; .5::T => now; }
On Mon, Apr 30, 2012 at 2:27 PM, Timothy Leonido
Is there any way for the two loops below to run simultaneously from the same shred?
There's no way to do what you're asking. Why is it that you need them to be in the same shred? If you actually just mean that they need to be in the same file, then you can do something like this: fun void loop1() { while(…) { … } } fun void loop2() { while(…) { … } } spork ~ loop1(); spork ~ loop2(); -- Tom Lieber http://AllTom.com/ http://infinite-sketchpad.com/
On Mon, Apr 30, 2012 at 02:27:00PM -0400, Timothy Leonido wrote:
Hello
Hey Timothy!
Is there any way for the two loops below to run simultaneously from the same shred? I'm wondering if, instead of weaving them together in the same "while true," I could separate them into different functions (but running at the same time), or something like that?
Yes, there is something exactly like that. I could explain it now here, but there should be a perfectly decent explanation in your manual pdf. If you like for info on "sporking shreds", you should find it. The relevant operator is called "spork". You may also wish to try some of the examples on that topic in the /examples/ dir that came with your download. Shout if that doesn't work out or if it's stays unclear. Yours, Kas.
participants (3)
-
Kassen
-
Timothy Leonido
-
Tom Lieber