diff --git a/plug-ins/SpectralEditMulti.ny b/plug-ins/SpectralEditMulti.ny index 5de9e514b..57175dcf7 100644 --- a/plug-ins/SpectralEditMulti.ny +++ b/plug-ins/SpectralEditMulti.ny @@ -45,4 +45,7 @@ (T (sum (prod env (wet sig f0 f1 fc)) (prod (diff 1.0 env) sig)))))) -(catch 'error-message (multichan-expand #'result *track*)) +(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*))) diff --git a/plug-ins/SpectralEditParametricEQ.ny b/plug-ins/SpectralEditParametricEQ.ny index a2d86814d..20d7403bd 100644 --- a/plug-ins/SpectralEditParametricEQ.ny +++ b/plug-ins/SpectralEditParametricEQ.ny @@ -42,15 +42,27 @@ (env (snd-pwl 0.0 rate breakpoints))) (cond ((not (or f0 f1)) - (throw 'error-message "~aPlease select frequencies.")) + (throw 'error-message (format nil "~aPlease select frequencies." p-err))) ((not f0) - (throw 'error-message "~aLow frequency is undefined.")) + (throw 'error-message (format nil "~aLow frequency is undefined." p-err))) ((not f1) - (throw 'error-message "~aHigh frequency is undefined.")) + (throw 'error-message (format nil "~aHigh frequency is undefined." p-err))) ((= bw 0) - (throw 'error-message "~aBandwidth is zero.~%Select a frequency range.")) + (throw 'error-message (format nil "~aBandwidth is zero.~%Select a frequency range." p-err))) ;; 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)))))) -(catch 'error-message (multichan-expand #'result *track*)) +(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*))))) diff --git a/plug-ins/SpectralEditShelves.ny b/plug-ins/SpectralEditShelves.ny index 16ff4065c..ff6c4060a 100644 --- a/plug-ins/SpectralEditShelves.ny +++ b/plug-ins/SpectralEditShelves.ny @@ -47,9 +47,9 @@ (env (snd-pwl 0.0 rate breakpoints))) (cond ((not (or f0 f1)) - (throw 'error-message "Please select frequencies.")) - ((and f0 f1 (= f0 f1)) - (throw 'error-message "Please select a frequency range.")) + (throw 'error-message (format nil "~aPlease select frequencies." p-err))) + ((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,4 +63,18 @@ (>= (get '*selection* 'high-hz)(/ *sound-srate* 2))) (remprop '*selection* 'high-hz)) -(catch 'error-message (multichan-expand #'result *track*)) +(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*))))) +