How to gradually increase or decrease an FMSound frequency over
time?
Rob Rothwell
r.j.rothwell at gmail.com
Wed Apr 19 04:02:12 UTC 2006
Maybe someone can point me in the right direction...
I am trying to figure out how to gradually change the frequency of an
FMSound over time, for example a gradual slide from, say, 99.12Hz to
109.56Hz over a given amount of time (sort of like a very slow Doppler shift
in a way, I guess). The actual function governing the frequency change
could in theory be just about anything, but for now I am probably just
looking at linear slides, and the length of time the slide could take could
be seconds to minutes.
I still consider myself a Smalltalk beginner, and my first instinct is
always to "do it myself" because I have a hard time reading the existing
code to figure out what has already been done. Thus, my first idea was to
try to output small segments (say 1 sec each) of a fixed frequency into a
SequentialSound, and increase the frequency [of each segment] over time.
This "works," but with the fractional cycles inherent in non-integral
frequencies and/or times it results in a sharp transient at the junction of
each new frequency segment--resulting in unwanted audible clicks.
Is there a way to "manually" adjust the phase of each subsequent
SequentialSound so I can "line them up," or will the PitchEnvelope class
completely take care of this for me and I just can't figure it out?!
Overall, though, I have to say I am impressed with the depth of the classes
in the Sound-Synthesis category, I just don't know how to use them!
However, I am guessing that Squeak knows how to do exactly what I want to
do!
Thanks in advance for any help; I still have a hard time knowing if I am
even looking in the right direction. I hope I explained the problem well
enough--a picture would have been easier in this case!
Thanks again,
Rob Rothwell
P.S. If the answer is at all related to how I would fade the volume of a
sound in or out over 15 to 30 seconds, could you let me know?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060419/2d0d057f/attachment.htm
More information about the Squeak-dev
mailing list
|