mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-17 22:21:17 +01:00
Alternative fix for bug 1151
Extend available frequency range for Nyquist filter plug-ins.
This commit is contained in:
@@ -12,28 +12,19 @@
|
|||||||
;; Released under terms of the GNU General Public License version 2:
|
;; Released under terms of the GNU General Public License version 2:
|
||||||
;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
|
;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
|
||||||
|
|
||||||
;control range "Frequency range" choice "Hz,kHz" 0
|
|
||||||
;control frequency "Frequency" real "" 1000 1 1000
|
;control frequency "Frequency (Hz)" float-text "" 1000 0 nil
|
||||||
;control rolloff "Rolloff (dB per octave)" choice " 6 dB,12 dB,24 dB,36 dB,48 dB" 0
|
;control rolloff "Rolloff (dB per octave)" choice " 6 dB,12 dB,24 dB,36 dB,48 dB" 0
|
||||||
|
|
||||||
|
|
||||||
(case range
|
(cond
|
||||||
(0 (setf f0 (format nil "~a Hz" frequency))
|
((< frequency 0.1) "Frequency must be at least 0.1 Hz.")
|
||||||
(setf srate (format nil "~a Hz" *sound-srate*))
|
((>= frequency (/ *sound-srate* 2.0))
|
||||||
(setf fmax (format nil "~a Hz" (/ *sound-srate* 2))))
|
(format nil "Error:~%~%Frequency (~a Hz) is too high for track sample rate.~%~%~
|
||||||
(T (setf f0 (format nil "~a kHz" frequency))
|
Track sample rate is ~a Hz~%~
|
||||||
(setf frequency (* frequency 1000))
|
Frequency must be less than ~a Hz."
|
||||||
(setf srate (format nil "~a kHz" (/ *sound-srate* 1000)))
|
frequency
|
||||||
(setf fmax (format nil "~a kHz" (/ *sound-srate* 2000)))))
|
*sound-srate*
|
||||||
|
(/ *sound-srate* 2.0)))
|
||||||
|
(T (funcall (nth rolloff '(hp highpass2 highpass4 highpass6 highpass8))
|
||||||
(if (>= frequency (/ *sound-srate* 2.0))
|
*track* frequency)))
|
||||||
(format nil "Error:\nFrequency (~a) too high for track sample rate.~%~%~
|
|
||||||
Track sample rate is ~a~%~
|
|
||||||
Frequency must be less than ~a."
|
|
||||||
f0
|
|
||||||
srate
|
|
||||||
fmax)
|
|
||||||
(funcall
|
|
||||||
(nth rolloff '(hp highpass2 highpass4 highpass6 highpass8))
|
|
||||||
*track* frequency))
|
|
||||||
|
|||||||
@@ -12,28 +12,19 @@
|
|||||||
;; Released under terms of the GNU General Public License version 2:
|
;; Released under terms of the GNU General Public License version 2:
|
||||||
;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
|
;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
|
||||||
|
|
||||||
;control range "Frequency range" choice "Hz,kHz" 0
|
|
||||||
;control frequency "Frequency" real "" 1000 1 1000
|
;control frequency "Frequency (Hz)" float-text "" 1000 0 nil
|
||||||
;control rolloff "Rolloff (dB per octave)" choice " 6 dB,12 dB,24 dB,36 dB,48 dB" 0
|
;control rolloff "Rolloff (dB per octave)" choice " 6 dB,12 dB,24 dB,36 dB,48 dB" 0
|
||||||
|
|
||||||
|
|
||||||
(case range
|
(cond
|
||||||
(0 (setf f0 (format nil "~a Hz" frequency))
|
((< frequency 0.1) "Frequency must be at least 0.1 Hz.")
|
||||||
(setf srate (format nil "~a Hz" *sound-srate*))
|
((>= frequency (/ *sound-srate* 2.0))
|
||||||
(setf fmax (format nil "~a Hz" (/ *sound-srate* 2))))
|
(format nil "Error:~%~%Frequency (~a Hz) is too high for track sample rate.~%~%~
|
||||||
(T (setf f0 (format nil "~a kHz" frequency))
|
Track sample rate is ~a Hz~%~
|
||||||
(setf frequency (* frequency 1000))
|
Frequency must be less than ~a Hz."
|
||||||
(setf srate (format nil "~a kHz" (/ *sound-srate* 1000)))
|
frequency
|
||||||
(setf fmax (format nil "~a kHz" (/ *sound-srate* 2000)))))
|
*sound-srate*
|
||||||
|
(/ *sound-srate* 2.0)))
|
||||||
|
(T (funcall (nth rolloff '(lp lowpass2 lowpass4 lowpass6 lowpass8))
|
||||||
(if (>= frequency (/ *sound-srate* 2.0))
|
*track* frequency)))
|
||||||
(format nil "Error:\nFrequency (~a) too high for track sample rate.~%~%~
|
|
||||||
Track sample rate is ~a~%~
|
|
||||||
Frequency must be less than ~a."
|
|
||||||
f0
|
|
||||||
srate
|
|
||||||
fmax)
|
|
||||||
(funcall
|
|
||||||
(nth rolloff '(lp lowpass2 lowpass4 lowpass6 lowpass8))
|
|
||||||
*track* frequency))
|
|
||||||
|
|||||||
@@ -12,26 +12,19 @@
|
|||||||
;; Released under terms of the GNU General Public License version 2:
|
;; Released under terms of the GNU General Public License version 2:
|
||||||
;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
|
;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html .
|
||||||
|
|
||||||
;control range "Frequency range" choice "Hz,kHz" 0
|
|
||||||
;control frequency "Frequency" real "" 60 1 1000
|
;control frequency "Frequency (Hz)" float-text "" 60 0 nil
|
||||||
;control q "Q (higher value reduces width)" real "" 1 0.1 20
|
;control q "Q (higher value reduces width)" float-text "" 1 0.1 nil
|
||||||
|
|
||||||
|
|
||||||
(case range
|
(cond
|
||||||
(0 (setf f0 (format nil "~a Hz" frequency))
|
((< frequency 0.1) "Frequency must be at least 0.1 Hz.")
|
||||||
(setf srate (format nil "~a Hz" *sound-srate*))
|
((>= frequency (/ *sound-srate* 2.0))
|
||||||
(setf fmax (format nil "~a Hz" (/ *sound-srate* 2))))
|
(format nil "Error:~%~%Frequency (~a Hz) is too high for track sample rate.~%~%~
|
||||||
(T (setf f0 (format nil "~a kHz" frequency))
|
Track sample rate is ~a Hz~%~
|
||||||
(setf frequency (* frequency 1000))
|
Frequency must be less than ~a Hz."
|
||||||
(setf srate (format nil "~a kHz" (/ *sound-srate* 1000)))
|
frequency
|
||||||
(setf fmax (format nil "~a kHz" (/ *sound-srate* 2000)))))
|
*sound-srate*
|
||||||
|
(/ *sound-srate* 2.0)))
|
||||||
|
((< q 0.1) "Q must be at least 0.1.")
|
||||||
(if (>= frequency (/ *sound-srate* 2.0))
|
(T (notch2 *track* frequency q)))
|
||||||
(format nil "Error:\nFrequency (~a) too high for track sample rate.~%~%~
|
|
||||||
Track sample rate is ~a~%~
|
|
||||||
Frequency must be less than ~a."
|
|
||||||
f0
|
|
||||||
srate
|
|
||||||
fmax)
|
|
||||||
(notch2 *track* frequency q))
|
|
||||||
|
|||||||
Reference in New Issue
Block a user