Exponential Wind-downs for synths?

I am back with another problem. This problem is very similar to the last problem I had. I know Nyquist can be used in many ways. My question is, since I can generate exponential wind-ups now, is there a code someone has done and tested that can generate exponential wind-downs?

What I do now is generate many chirps of varying lengths back to back, and that takes ages and is usually incorrect according to TheWoog34. I want my synths to be correct with the timing of everything and how things are done.

For anyone new to this thread, the topic is (I presume) “synthesizing siren sounds” (as per these topics: How to generate non-linear chirps? and https://forum.audacityteam.org/t/special-kind-of-frequency-sweep-chirp/21236/1 ). Is that right sirendude2011?

I expect that it can be done in a similar way to the wind-up, but I’ve not yet seen it in code.

I’d not be surprised if the wind down is non-linear, but is it “exponential”? Have you analysed the rate of pitch change?

Which code are you using for the Wind-up?

Yes steve it would be for siren synthesizing. The code I’m using for wind-ups is the same as the code that you linked in the second link. I was figuring, if there was some way to reverse the coding to reverse the way it generates (generates a wind-down rather than a wind-up), it might work the way I would like it to. Maybe I’ll have to learn basic Nyquist coding and code one myself somehow.

Have a play with this code.
It is just the basic sawtooth version so you will get some aliasing distortion (the distortion will sound similar to tuning in a short-wave radio)…
There is an additional control “opt” which may be set to 1, 2 or 3 to give different pitch change curves. Are any of those close to what you need?

(setq start-freq 1320)  ; initial frequency - Hz
(setq final-freq 440)   ; final frequency - Hz
(setq initial-amp 0.5)  ; initial amplitude on a scale 0 to 1
(setq final-amp 0.5)    ; final amplitude on a scale 0 to 1
(setq opt 1)            ; pitch curve can be 1, 2 or 3

(setq hz1 start-freq)
(setq hz2 final-freq)
(setq iamp (max (min initial-amp 1) 0))
(setq famp (max (min final-amp 1) 0))

(mult (pwlv iamp 1 famp)
  (fmosc 0
    (sum
      hz1
      (mult
        (- hz1 hz2)
        (case opt
          (1 (sum -1 (pwev 1 1 0.01)))
          (2 (pwlv 0 1 -1))
          (T (mult -1 (pwev 0.1 1 1))))))
    *saw-table*))

This code is perfect! Thanks Steve!

Which of the curves is most realistic?
Is it the same curve for all sirens, or do some need a different curve?
Would it be useful to have a variable curve?

It depends on the siren. Some sirens, such as the ACA Hurricane, STL-10 and STH-10 have VERY long wind-downs that aren’t exactly logarithmic but they aren’t linear either. Thunderbolts tend to have quick logarithmic wind-downs.

Oh, Steve, is there any audacity plugin that can be like a “low-pass fade-in” - it starts at a low-pass filter of your choice and gradually becomes less low-passed? When sirens spin, the sound is low-passed more as the siren rotor gets slower. The “low-pass fade” could apply to wind-downs as well as wind-ups.


Also, one more question. The exponential wind-up coding that you gave me on the forums a while ago is amazingly perfect for synthesizing single phase sirens - the motor starts torque-y and winds up slower and slower until it peaks. However, most sirens were made with 3 phase motors which gives them a fairly linear wind-up. Unlike the linear chirp option in Audacity, 3 phase sirens tend to have this smooth “pitch curve” right as it peaks while the linear chirp in Audacity jumps right up to full speed.

http://www.youtube.com/watch?v=UJIWx-eC7YU here’s an example of a typical 3 phase siren with that special linear wind-up. How would we construct this in Audacity?

Here’s a siren with a wind-up that can be completely accurately reproduced using the linear chirp generator in Audacity - http://www.youtube.com/watch?v=X2MlmcY8UZU - notice the difference right near the end of the wind-up.

I don’t know of any existing plug-ins for that, but it’s not hard to program in Nyquist.
Are you interested in learning how to program these things yourself? If you are, I’d be happy to help you.


It seems like the curves need to be customisable. So we have three curves of change: frequency, level, low pass filter. I guess that these must all be proportional in some way?

Yes, as a siren increases in frequency it should become less and less low-passed, but there has to be a limit that can be changed depending on what siren you are trying to re-create.

Here’s my recording of an SD-10A (linked to the wind-down) http://www.youtube.com/watch?v=vvaA7gG8M2g&feature=player_detailpage#t=35s

Here’s sirendude’s SD-10B synth (at the wind-down part) notice how it sounds wrong as it winds down, like it is too rough while in the recording the sound gets softer and softer as it winds down. http://www.youtube.com/watch?v=-miHwa9UA_Q&feature=player_detailpage#t=108s

I figured out how to manually do the wind-up: this is a little time consuming but it DOES work. Simply combine the regular chrip generator with the exponential chirp nyquist coding. I also found other programs that can do the low-pass curve.

Could you point me towards a plugin that is like the HQ tone plugin except it generates chirps instead? Non-aliased waveforms are a lot easier to work with.

Thank you for the tremendous amount of help you have given us so far, Steve. I’ll be sure to give you plenty of credit in my latest synth I’m working on.

Try this:

(setq start-frequency 10) ; initial frequency in kHz
(setq end-frequency 1) ; final frequency in kHz


(let* ((ny (/ *sound-srate* 2))
       (f1 (min (* start-frequency 1000) ny))
       (f2 (min (* end-frequency 1000) ny)))
  (lp (lp s (pwlv f1 1 f2))(pwlv f1 1 f2)))

The start and end frequencies must be less than half of the track sample rate.

Perfect, now I have to just fool around with it until it sounds right.

I have this little piece of code here that converts any waveform into non-aliased triangle (a little mis-shapen though), I’ll try and fix it up and create one for saw and square.

(mult 2.0 (sum (snd-abs s) -0.5))

sites.google.com/site/nmoakman/test/fsweep.dll

http://www.youtube.com/watch?v=EXCQrnr9Ow4&feature=g-u-u

Check out this little plugin that Nick Oakman made. He owns the Youtube channels alarmsynthsrus and guitarguy19852.