How to Fade-In/Fade-Out a Sampled/Repeating/Mixed Sound

Rob Rothwell r.j.rothwell at gmail.com
Sat May 6 03:39:58 UTC 2006


Sorry--

Something somewhere is amiss with my image.  If I use a clean 3.8 image, my
example below works as expected, but still does not output properly to a
WAV...

Rob

On 5/5/06, Rob Rothwell <r.j.rothwell at gmail.com> wrote:
>
> Dean,
>
> Thanks for all your help trying to figure this out.  However, I am still
> not able to create any effect on even a SampledSound with a VolumeEnvelope
> like you suggested.  To help hear what is going on I have created a new
> method, newExponentialDecay in the  Envelope class where I have changed:
>
>     mSecsPerStep := 10.
>
>     to:   mSecsPerStep := 50.
>
> just to drag out the decay a little longer.  When I do that,
>
> snd := FMSound new.
> snd addEnvelope: (VolumeEnvelope newExponentialDecay: 0.96).
> snd setPitch: 200 dur: 5.0 loudness: 0.25.
> snd play.
>
> fades out as expected, but then when I turn that tone into a WAV and read
> it back in:
>
> snd := FMSound new.
> snd setPitch: 200 dur: 5.0 loudness: 0.25.
> snd storeWAVOnFileNamed: 'tone.wav'.
> snd := (SampledSound fromWaveFileNamed: 'tone.wav').
> snd addEnvelope: (VolumeEnvelope newExponentialDecay: 0.96).
> snd play.
>
> The tone just plays at a constant volume!  Things that make you
> go...hmm...
>
> Thanks again,
>
> Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060505/a7a584e2/attachment.htm


More information about the Squeak-dev mailing list