Sweep

Hello, everyone,
does anyone know how I can generate the following sound in Audacity?

https://mega.nz/file/4gkhzaYQ#JkOz7axUu1ZJ8VFYPBt-S_1oAwDiVhbclYTW6BZsII8

Run this code in the Nyquist Prompt (see: https://manual.audacityteam.org/man/nyquist_prompt.html)

;type generate
(setf dur 30)


(setf *square-table*
  (sum (build-harmonic 1 2048)
       (mult 0.3 (build-harmonic 3 2048))
       (mult 0.1 (build-harmonic 5 2048))
       (mult 0.03 (build-harmonic 7 2048))))

(setf *square-table*
  (list *square-table* (hz-to-step 1.0) t))

(let ((ctrl (lfo 10 dur *saw-table*)))
  (setf ctrl (sum 2000 (mult 1000 (sum 1 ctrl))))
  (hzosc ctrl *square-table*))

Thanks for the tip. But why is it so cumbersome to implement using code? That should be easier to do …

Because it is not just one tone. It is 4 tones at harmonic intervals of (1), 3, 5, and 7, that sweep in unison.


This creates the harmonic table:

(setf *table*
  (sum (build-harmonic 1 2048)
       (mult 0.3 (build-harmonic 3 2048))
       (mult 0.1 (build-harmonic 5 2048))
       (mult 0.03 (build-harmonic 7 2048))))

(setf *table* (list *square-table* (hz-to-step 1.0) t))

This creates the sweep:

(lfo 10 dur *saw-table*)

This sets the pitch and range of the sweep:

(setf ctrl (sum 2000 (mult 1000 (sum 1 ctrl))))

And this generates the sound:

(hzosc ctrl *table*)

A similar, but slightly different sweeping sound can be made with a lot less code:

;type generate

(let ((ctrl (lfo 10 30 *saw-table*)))
  (setf ctrl (sum 2000 (mult 1000 (sum 1 ctrl))))
  (hzosc ctrl *tri-table*))

This is simpler because it uses one of Nyquist’s built-in wavetables; tri-table, but the 3x harmonic is lower so it sounds a little less shrill.