MaxiEnv setAttack


for the setAttack method in maxiEnv wouldn’t it be

void oscEnv::setAttack(double attackMS) {
    attack = attackMS;

why is it multiplying the sampleRate and a value of 0.001?

void oscEnv::setAttack(double attackMS) {
    attack = 1-pow( 0.01, 1.0 / ( attackMS * sampleRate * 0.001 ) );

Edit: I thought about it and I realized it’s because thats how its actually manipulating when the sound comes in for the attack, however, could someone still explain to me this algorithm of how this works please,


sampleRate * 0.001 gives the number of samples per millisecond, I’m not sure what the
1 - 0.01 to the power of (1 / numberOfSamplesInAttack)
is all about