Here is essentially what I want to do, which gives a &quot;smooth&quot; (stepped) progression from f1 to f2.&nbsp; stepsPerSecond sort of controls the &quot;smoothness&quot; of the progression.<br><br>&nbsp;&nbsp;&nbsp; f1 := 330.50.<br>&nbsp;&nbsp;&nbsp; f2 := 
440.90.<br>&nbsp;&nbsp;&nbsp; f := f1.<br>&nbsp;&nbsp;&nbsp; t := 0.<br>&nbsp;&nbsp;&nbsp; sec := 15.<br>&nbsp;&nbsp;&nbsp; stepsPerSecond := 10.0. &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; df := (f2-f1) / (sec*stepsPerSecond).<br>&nbsp;&nbsp;&nbsp; ss := SequentialSound new.<br>&nbsp;&nbsp;&nbsp; f := f-df.<br><br>&quot;&nbsp;&nbsp; Sweep smoothly from f1 to just shy of f2 over the specified time, re-calculating the amount of time for each step
<br>&nbsp;&nbsp;&nbsp; based on the integral number of frequencies that can be completed within the estimated step size.<br>&nbsp;&nbsp;&nbsp; We should end up just shy of the target frequency, at the end of a complete cycle...&quot;<br><br>&nbsp;&nbsp;&nbsp; 1 to: (sec*stepsPerSecond) do: [
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :i |<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dt := (((i asFloat)/stepsPerSecond)-(t asFloat)).<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; f := (f + df).<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cycles := (f*dt) roundTo: 1.0. <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dt := cycles / f.<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Transcript show: f; tab; show: dt; cr.
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ss add: (FMSound new setPitch: f dur: dt loudness: 0.5).<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t := t + dt.<br>&nbsp;&nbsp;&nbsp; ].&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br><br>&quot;&nbsp;&nbsp; Add the the final frequency and play it briefly...&quot;<br>&nbsp;&nbsp;&nbsp; Transcript show: f2; cr.<br>&nbsp;&nbsp;&nbsp;&nbsp; ss add: (FMSound new setPitch: f2 dur: 
1.0 loudness: 0.5).<br><br>&nbsp;&nbsp;&nbsp; ss storeWAVOnFileNamed: 'test.wav'.&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; ss play.<br><br>I would do something similar with the times if I wanted to &quot;step&quot; sharply from one frequency to another without the slide, but without introducing an audible &quot;click.&quot;&nbsp; Basically I just need to make sure that the transition from one frequency to another happens on an integral number of wave cycles.
<br><br>However, this seems somewhat inelegant given the apparent richness of the sound classes.&nbsp; It *feels* like I am doing something &quot;by hand&quot; that is probably already built into the system.&nbsp; It seems like the PitchEnvelope class *should* work, if I understood it better!&nbsp; Furthermore, without understanding the VolumeEnvelope class, I would do something like the above to fade-in and fade-out, changing volume levels instead of frequencies.
<br><br>Thanks,<br>Rob<br><br><div><span class="gmail_quote">On 4/20/06, <b class="gmail_sendername">Hans-Martin Mosner</b> &lt;<a href="mailto:hmm@heeg.de" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
hmm@heeg.de</a>&gt; wrote:</span></div><br>&gt;Have you looked at the PitchEnvelope class? It allows you to sweep a
<br>&gt;sound between frequencies.<br>&gt;You would need to take into account that it's working on a logarithmic<br>&gt;scale, so it does not interpolate frequencies linearly, but musical<br>&gt;notes. In many cases this would be the desired behaviour, I don't know
<br>&gt;enough about your application to say whether it is acceptable here as well.<br>&gt;<br>&gt;Cheers,<br>&gt;Hans-Martin<br><br>