maxl0rd / standingwave3

Flash ActionScript3 dynamic audio library
http://www.noteflight.com
160 stars 25 forks source link

Alchemy envelope function bug? #29

Open starburst997 opened 11 years ago

starburst997 commented 11 years ago

Seems like there is a bug in the function (line 685)

static AS3_Val envelope(void *self, AS3_Val args)

Instead of (line 695)

expandSpline(&modPoint, scratch1, frames); // draws spline segment into scratch1

it should be

expandSpline(&modPoint, scratch1, frames*channels); // draws spline segment into scratch1

A workaround if people don't wan't to compile Alchemy is to change line 535 of "Sample.as" to

Sample._awave.envelope(getSamplePointer(offset), 1 /*_descriptor.channels*/, numFrames * 2, mp);

To trick Alchemy to do the right calculation, otherwise half of the sample don't get the envelope.

starburst997 commented 11 years ago

Also, very good library, I love it! Good work!