[chuck-users] SndBuf Passing args to running functions

herman verbaeten hverb54 at hotmail.com
Fri Feb 21 03:11:48 EST 2020


Hi,

I'm in big trouble. I'v been trying for a long time now to change an argument in a running function. As you can see in my script i set a certain central pos ("70000")to buf.pos  as a central position in my soundbuffer and i let my function LFOtoPOS circle around it.

Once the "spork" instruction has started the process i can't figure out how to addresss the argument "centralpos" to change it on the fly or by another function or parameter.  Some help please ...

Kind regards,

Herman
----------------------------------------------------------------------------------------------

 me.sourceDir() + "sound.wav" => string filename;
if( me.args() ) me.arg(0) => filename;

SndBuf buf => dac;

filename => buf.read;

1 => buf.pos;
.5 => buf.gain;

spork ~ LFOtoPOS(70000);

fun void LFOtoPOS(int centralpos)
{
     TriOsc lfo => blackhole;
     1 => lfo.freq;
     centralpos => buf.pos;
     while (true)
       {
       1::samp => now;
       (10000*lfo.last())$ int => buf.pos;
       }
}

// time loop
while( true )
{
   1000::ms => now;
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20200221/d10e4bf6/attachment.html>


More information about the chuck-users mailing list