maxl0rd / standingwave3

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

ListPerformance with elements overlapping in time not working correctly #3

Closed donpark closed 13 years ago

donpark commented 13 years ago

Are ListPerformance elements allowed to overlap in time? Following code produces sound as expected in StandingWave2 but not in StandingWave3 (creates buzzing noise during overlapped parts).

    sequence1.addSourceAt(tempo.beatsInSeconds(0),
            new SineSource(new AudioDescriptor(), tempo.beatsInSeconds(2), 440));
    sequence1.addSourceAt(tempo.beatsInSeconds(1),
            new SineSource(new AudioDescriptor(), tempo.beatsInSeconds(2), 660));
    sequence1.addSourceAt(tempo.beatsInSeconds(2),
            new SineSource(new AudioDescriptor(), tempo.beatsInSeconds(2), 880));

tempo is just a utility class that converts to # of beats to seconds. BPM was set to 140.

maxl0rd commented 13 years ago

Hi

That buzzing noise is probably clipping. SineSources come out full scale.

Just turn the gain down in the AudioPerformer with the mixGain property, which is mixing loss in decibels.

ie audioPerformer.mixGain = -12 ... would let you mix 4 sources without clipping.

That's a new SW3 feature.

donpark commented 13 years ago

Yup. That was it. I should have checked that first but StandingWave2 not having the problem mislead me. Thanks.