How to gradually increase or decrease an FMSound frequency over time?

Rob Rothwell r.j.rothwell at gmail.com
Thu Apr 20 02:40:38 UTC 2006


Craig,

Thanks for your reply:

>       Just send >>pitch: to the FMSound at the appropriate times, sweeping
>between your two values?

 I had thought of doing that, but I was hoping that I could end up at a
specific frequency at a specific time.  However, for my purposes, the
frequencies are more important to me than the times, so that may be what I
end up doing.

Basically, I am trying to use Squeak to generate Binaural Beat Sequences for
brainwave entrainment.  A Binaural Beat basically consists of a
beat at carrierfrequency pair, so I want to be able to write something
like:

     sequence := BinauralSequence new.
     sequence to: 10.00 at 109.65 for: 2.75 minutes.
     sequence to: 9.78 at 108.52 over: 15 seconds for: 2.75 minutes.
     etc...

...and have it produce the desired effect, which in this case would be
produce a beat frequency of 10.00Hz around a center carrier frequency of
109.65Hz (104.65 Left pan and 114.65 Right pan) for 2.75 minutes, then slide
the beat and carrier frequency to 9.78 at 108.52 over 15 seconds, hold for
another 2.75 minutes, etc...

The BinauralSequence would just be a part of a BinauralProgram, which would
basically create a MixedSound with background sounds (rain, babbling brook,
etc...) mixed in as desired, fade in and out as necessary, etc...

While there are available tools to do this, it is either difficult or time
consuming to tell the tool what you want it to do, and the natural message
format of Smalltalk would just be perfect for this!

However, for the time being, maybe I'll have the times in the above example
be more of a request than a command, and fudge the time to keep the
frequencies in phase and avoid any clicks or pops...

I still think it would be fun to know how to phase shift a wave form in
Squeak, though, and I still have to figure out how to fade in and out, but
other than that, it's really pretty straightforward in Squeak once you start
getting used to the classes!

Thanks again,

Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060419/26f61fd6/attachment.htm


More information about the Squeak-dev mailing list