[chuck-users] getting ADSR::XTime()

eduard eaylon at gmail.com
Mon Feb 4 14:13:15 EST 2008


Hi list,

I'm afraid there is a bug on  the getters side  of the ADSR UGen. One  
can set adsr::attackTime( 10::ms ) and gets adsr::attackTime()  as  
0.010::samp, instead of (0.010*SR)::samp.
So, to be able to use

adsr::attackTime() => now

correctly, one should do:

adsr::attackTime()*sr => now

Which I don't think is the way one would expect. Could anyone confirm  
the same behaviour, so I can add it to the wiki-bug-list?


eduard




SinOsc s => ADSR env => Gain g => dac;
env.attackTime( 10::ms );
env.decayTime( 5::ms );
env.releaseTime( 1000::ms );
<<<"env_region", "\tstate()", "\tcur time[ms]", "\ttime[samp]",  
"\ttime[ms]">>>;
<<<"-------------------------------------------------------------------- 
-------","\n">>>;
while( true )
{

     env.keyOn();
     <<< "start of att", "\t", env.state(), "\t",  now/ms , "\t",
     env.attackTime()/samp, "\t", env.attackTime()/ms>>>;
     env.attackTime() => now;
     <<< "end of att", "\t",  env.state(), "\t",  now/ms >>>;
     <<< "start of dcy", "\t",  env.state(), "\t",  now/ms, "\t",  
env.decayTime()/samp,
     "\t", env.decayTime()/ms >>>;
     env.decayTime() => now;
     <<< "end of dcy", "\t",  env.state(), "\t",  now/ms >>>;
     env.keyOff();
     <<< "start release", "\t",  env.state(), "\t",  now/ms, "\t",
     env.releaseTime()/samp, "\t", env.releaseTime()/ms >>>;
     env.releaseTime() => now;
     <<<"end release", "\t",   env.state(), "\t",  now/ms >>>;
     1::second => now;
     <<< "\n","******************\n">>>;


More information about the chuck-users mailing list