I have messed around with this code, but I can’t figure out how to change it from bass to normal, instead of treble to bass. If you know please let me know.
;version 3
(setq start-freq 10000) ; cannot be greater than 1/2 the sample rate
(setq end-freq 100)
(setq passes 4) ; more passes for a steeper filter cut-off
(setq sweep-type 0) ; 1 for a linear sweep, 0 for exponential sweep
(let* ((nyq (/ *sound-srate* 2.0))
(f0 (max 0 (min nyq start-freq)))
(f1 (max 0 (min nyq end-freq))))
(if (= sweep-type 0)
(setf hpfreq (pwev f0 1 f1))
(setf hpfreq (pwlv f0 1 f1)))
(dotimes (i passes s)
(setf s (hp s hpfreq))))
Trebor is absolutely correct.
As we are writing new code we should also update it to the latest ;version 4 syntax, which just mean changing the version line at the top, and changing the “S” variables to *track*:
;version 4
(setq start-freq 100)
(setq end-freq 10000) ; cannot be greater than 1/2 the sample rate
(setq passes 4) ; more passes for a steeper filter cut-off
(setq sweep-type 0) ; 1 for a linear sweep, 0 for exponential sweep
(let* ((nyq (/ *sound-srate* 2.0))
(f0 (max 0 (min nyq start-freq)))
(f1 (max 0 (min nyq end-freq))))
(if (= sweep-type 0)
(setf hpfreq (pwev f0 1 f1))
(setf hpfreq (pwlv f0 1 f1)))
(dotimes (i passes *track*)
(setf *track* (lp *track* hpfreq))))