1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 23:59:37 +02:00

Track view awareness removed from Spectral Edit effects as demanded by

Paul Licameli.
This commit is contained in:
Steve Daulton 2015-07-22 09:19:12 +01:00
parent aa54699cf4
commit 4d0e8f6c76
3 changed files with 10 additions and 39 deletions

View File

@ -45,7 +45,4 @@
(T (sum (prod env (wet sig f0 f1 fc))
(prod (diff 1.0 env) sig))))))
(if (string-not-equal (get '*TRACK* 'VIEW) "spectral" :end1 8 :end2 8)
"Use this effect in the 'Spectral Selection'\nor 'Spectral Selection log(f)' view."
(catch 'error-message
(multichan-expand #'result *track*)))
(catch 'error-message (multichan-expand #'result *track*))

View File

@ -42,27 +42,15 @@
(env (snd-pwl 0.0 rate breakpoints)))
(cond
((not (or f0 f1))
(throw 'error-message (format nil "~aPlease select frequencies." p-err)))
(throw 'error-message "~aPlease select frequencies."))
((not f0)
(throw 'error-message (format nil "~aLow frequency is undefined." p-err)))
(throw 'error-message "~aLow frequency is undefined."))
((not f1)
(throw 'error-message (format nil "~aHigh frequency is undefined." p-err)))
(throw 'error-message "~aHigh frequency is undefined."))
((= bw 0)
(throw 'error-message (format nil "~aBandwidth is zero.~%Select a frequency range." p-err)))
(throw 'error-message "~aBandwidth is zero.~%Select a frequency range."))
;; If seleted frequency band is above Nyquist, do nothing.
((< f0 (/ *sound-srate* 2.0))
(sum (prod env (wet sig control-gain f0 f1)) (prod (diff 1.0 env) sig))))))
(cond
((not (get '*TRACK* 'VIEW)) ; 'View is NIL during Preview
(setf p-err (format nil "This effect requires a frequency selection in the~%~
'Spectrogram' or 'Spectrogram (log f)' track view.~%~%"))
(catch 'error-message
(multichan-expand #'result *track*)))
((string-not-equal (get '*TRACK* 'VIEW) "spectral" :end1 8 :end2 8)
"Use this effect in the 'Spectral Selection'\nor 'Spectral Selection log(f)' view.")
(T (setf p-err "")
(if (= control-gain 0) ; Allow dry preview
"Gain is zero. Nothing to do."
(catch 'error-message
(multichan-expand #'result *track*)))))
(catch 'error-message (multichan-expand #'result *track*))

View File

@ -47,9 +47,9 @@
(env (snd-pwl 0.0 rate breakpoints)))
(cond
((not (or f0 f1))
(throw 'error-message (format nil "~aPlease select frequencies." p-err)))
((and f0 f1 (= f0 f1)) (throw 'error-message
"Please select a frequency range."))
(throw 'error-message "Please select frequencies."))
((and f0 f1 (= f0 f1))
(throw 'error-message "Please select a frequency range."))
; shelf is above Nyquist frequency so do nothing
((and f0 (>= f0 (/ *sound-srate* 2.0))) nil)
(T (sum (prod env (wet sig control-gain f0 f1))
@ -63,18 +63,4 @@
(>= (get '*selection* 'high-hz)(/ *sound-srate* 2)))
(remprop '*selection* 'high-hz))
(cond
((not (get '*TRACK* 'VIEW)) ; 'View is NIL during Preview
(setf p-err (format nil "This effect requires a frequency selection in the~%~
'Spectral Selection' or 'Spectral Selection log(f)'~%~
track view.~%~%"))
(catch 'error-message
(multichan-expand #'result *track*)))
((string-not-equal (get '*TRACK* 'VIEW) "spectral" :end1 8 :end2 8)
"Use this effect in the 'Spectral Selection'\nor 'Spectral Selection log(f)' view.")
(T (setf p-err "")
(if (= control-gain 0) ; Allow dry preview
"Gain is zero. Nothing to do."
(catch 'error-message
(multichan-expand #'result *track*)))))
(catch 'error-message (multichan-expand #'result *track*))