Update three Nyquist plug-ins
Fixed some verification errors, Removed some redundant translation strings, Define manpage for rms.ny.
This commit is contained in:
parent
9094750c54
commit
8f5629a2a6
|
@ -8,7 +8,7 @@ $manpage "Adjustable_Fade"
|
||||||
$debugbutton false
|
$debugbutton false
|
||||||
$action (_ "Applying Fade...")
|
$action (_ "Applying Fade...")
|
||||||
$author (_ "Steve Daulton")
|
$author (_ "Steve Daulton")
|
||||||
$release 2.3.0
|
$release 2.3.1
|
||||||
$copyright (_ "Released under terms of the GNU General Public License version 2")
|
$copyright (_ "Released under terms of the GNU General Public License version 2")
|
||||||
|
|
||||||
;; Released under terms of the GNU General Public License version 2:
|
;; Released under terms of the GNU General Public License version 2:
|
||||||
|
@ -57,6 +57,7 @@ $control preset (_ "Handy Presets (override controls)") choice (("None" (_ "None
|
||||||
|
|
||||||
;;; invalid values
|
;;; invalid values
|
||||||
(defun check-values (x y)
|
(defun check-values (x y)
|
||||||
|
(setf err (format nil (_ "Error~%~%")))
|
||||||
(if (= units 0) ;percentage values
|
(if (= units 0) ;percentage values
|
||||||
(cond
|
(cond
|
||||||
((or (< x 0)(< y 0))
|
((or (< x 0)(< y 0))
|
||||||
|
@ -67,11 +68,16 @@ $control preset (_ "Handy Presets (override controls)") choice (("None" (_ "None
|
||||||
((or (> x 100)(> y 100))
|
((or (> x 100)(> y 100))
|
||||||
(throw 'err (format nil (_ "~adB values cannot be more than +100 dB.~%~%~
|
(throw 'err (format nil (_ "~adB values cannot be more than +100 dB.~%~%~
|
||||||
Hint: 6 dB doubles the amplitude~%~
|
Hint: 6 dB doubles the amplitude~%~
|
||||||
\t-6 dB halves the amplitude." err)))))))
|
\t-6 dB halves the amplitude.") err))))))
|
||||||
|
|
||||||
;;; Select and apply fade
|
;;; Select and apply fade
|
||||||
(defun fade (sig type curve g0 g1)
|
(defun fade (sig type curve g0 g1)
|
||||||
(check-values gain0 gain1)
|
(when (= preset 0)
|
||||||
|
; Can't use widget validation for gain. Range depends on units.
|
||||||
|
(check-values g0 g1))
|
||||||
|
(psetq curve (/ curve 100.0)
|
||||||
|
g0 (gainscale g0 units)
|
||||||
|
g1 (gainscale g1 units))
|
||||||
(mult (get-input sig)
|
(mult (get-input sig)
|
||||||
(case preset
|
(case preset
|
||||||
(0 (case type ; Custom fade
|
(0 (case type ; Custom fade
|
||||||
|
@ -196,11 +202,4 @@ $control preset (_ "Handy Presets (override controls)") choice (("None" (_ "None
|
||||||
(db-to-linear ,gain))))
|
(db-to-linear ,gain))))
|
||||||
|
|
||||||
|
|
||||||
(setf curve (/ curve 100.0))
|
|
||||||
(setf gain0 (gainscale gain0 units))
|
|
||||||
(setf gain1 (gainscale gain1 units))
|
|
||||||
(setf err (format nil (_ "Error~%~%")))
|
|
||||||
|
|
||||||
|
|
||||||
(catch 'err (fade *track* type curve gain0 gain1))
|
(catch 'err (fade *track* type curve gain0 gain1))
|
||||||
|
|
||||||
|
|
|
@ -1,40 +1,34 @@
|
||||||
$nyquist plug-in
|
$nyquist plug-in
|
||||||
$version 3
|
$version 4
|
||||||
$type process
|
$type process
|
||||||
$preview linear
|
$preview linear
|
||||||
$name (_ "Delay")
|
$name (_ "Delay")
|
||||||
$manpage "Delay"
|
$manpage "Delay"
|
||||||
|
$debugbutton false
|
||||||
$action (_ "Applying Delay Effect...")
|
$action (_ "Applying Delay Effect...")
|
||||||
$author (_ "Steve Daulton")
|
$author (_ "Steve Daulton")
|
||||||
$release 2.3.0
|
$release 2.3.1
|
||||||
$copyright (_ "Released under terms of the GNU General Public License version 2")
|
$copyright (_ "Released under terms of the GNU General Public License version 2")
|
||||||
|
|
||||||
;; by Steve Daulton, July 2012.
|
|
||||||
;; based on 'Delay' by David R. Sky
|
|
||||||
|
|
||||||
;; 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
|
||||||
|
;; based on 'Delay' by David R. Sky
|
||||||
;;
|
;;
|
||||||
;; For information about writing and modifying Nyquist plug-ins:
|
;; For information about writing and modifying Nyquist plug-ins:
|
||||||
;; https://wiki.audacityteam.org/wiki/Nyquist_Plug-ins_Reference
|
;; https://wiki.audacityteam.org/wiki/Nyquist_Plug-ins_Reference
|
||||||
|
|
||||||
$control delay-type (_ "Delay type") choice (
|
|
||||||
(_ "Regular")
|
$control delay-type (_ "Delay type") choice ((_ "Regular")
|
||||||
("BouncingBall" (_ "Bouncing Ball"))
|
("BouncingBall" (_ "Bouncing Ball"))
|
||||||
("ReverseBouncingBall" (_ "Reverse Bouncing Ball"))
|
("ReverseBouncingBall" (_ "Reverse Bouncing Ball"))) 0
|
||||||
) 0
|
|
||||||
$control dgain (_ "Delay level per echo (dB)") real "" -6 -30 1
|
$control dgain (_ "Delay level per echo (dB)") real "" -6 -30 1
|
||||||
$control delay (_ "Delay time (seconds)") real "" 0.3 0 5
|
$control delay (_ "Delay time (seconds)") real "" 0.3 0 5
|
||||||
$control pitch-type (_ "Pitch change effect") choice (
|
$control pitch-type (_ "Pitch change effect") choice (("PitchTempo" (_ "Pitch/Tempo"))
|
||||||
("PitchTempo" (_ "Pitch/Tempo"))
|
("LQPitchShift" (_ "Low-quality Pitch Shift"))) 0
|
||||||
("LQPitchShift" (_ "Low-quality Pitch Shift"))
|
|
||||||
) 0
|
|
||||||
$control shift (_ "Pitch change per echo (semitones)") real "" 0 -2 2
|
$control shift (_ "Pitch change per echo (semitones)") real "" 0 -2 2
|
||||||
$control number (_ "Number of echoes") int "" 5 1 30
|
$control number (_ "Number of echoes") int "" 5 1 30
|
||||||
$control constrain (_ "Allow duration to change") choice (
|
$control constrain (_ "Allow duration to change") choice ((_ "Yes")(_ "No")) 0
|
||||||
(_ "Yes")
|
|
||||||
(_ "No")
|
|
||||||
) 0
|
|
||||||
|
|
||||||
|
|
||||||
;; The default pitch shift effect is a simple resampling,
|
;; The default pitch shift effect is a simple resampling,
|
||||||
|
@ -46,47 +40,23 @@ $control constrain (_ "Allow duration to change") choice (
|
||||||
;; noticeable on percussive sounds though may be acceptable
|
;; noticeable on percussive sounds though may be acceptable
|
||||||
;; on other sounds.
|
;; on other sounds.
|
||||||
|
|
||||||
(setf err "") ; initialise error message
|
|
||||||
|
|
||||||
(defun err-chk (arg min max)
|
;;; Anti-alias low pass filter
|
||||||
(if (or (< arg min) (> arg max))
|
|
||||||
T nil))
|
|
||||||
|
|
||||||
(when (err-chk number 1 50)(setq err (format nil
|
|
||||||
(_ "Number of echoes '~a' outside valid range 1 to 50.~%~a")
|
|
||||||
number err)))
|
|
||||||
|
|
||||||
(when (err-chk shift -12 12)(setq err (format nil
|
|
||||||
(_ "Pitch change '~a' outside valid range -12 to +12 semitones.~%~a")
|
|
||||||
shift err)))
|
|
||||||
|
|
||||||
(when (err-chk delay 0 10)(setq err (format nil
|
|
||||||
(_ "Delay time '~a' outside valid range 0 to 10 seconds.~%~a")
|
|
||||||
delay err)))
|
|
||||||
|
|
||||||
(when (err-chk dgain -30 6)(setq err (format nil
|
|
||||||
(_ "Delay level '~a' outside valid range -30 to +6 dB.~%~a")
|
|
||||||
dgain err)))
|
|
||||||
|
|
||||||
|
|
||||||
;;; anti-alias low pass filter
|
|
||||||
(defun lp-wall (sig freq)
|
(defun lp-wall (sig freq)
|
||||||
(do ((count 0 (1+ count))
|
(do ((count 0 (1+ count))
|
||||||
(freq (* 0.94 freq)))
|
(freq (* 0.94 freq)))
|
||||||
((= count 10) sig)
|
((= count 10) sig)
|
||||||
(setf sig (lowpass8 sig freq))))
|
(setf sig (lowpass8 sig freq))))
|
||||||
|
|
||||||
|
|
||||||
;;; Change speed
|
;;; Change speed
|
||||||
(defun change-speed (sig shift)
|
(defun change-speed (sig shift)
|
||||||
(if (= shift 0) ; no pitch shift
|
(if (= shift 0) ; no pitch shift
|
||||||
sig
|
sig
|
||||||
(let ((ratio (expt 0.5 (/ shift 12.0)))) ; shift value as frequency ratio
|
(let ((ratio (expt 0.5 (/ shift 12.0)))) ; shift value as frequency ratio
|
||||||
(force-srate *sound-srate*
|
(force-srate *sound-srate*
|
||||||
(stretch-abs ratio (sound sig))))))
|
(stretch-abs ratio (sound sig))))))
|
||||||
|
|
||||||
|
;;; Pitch shift audio
|
||||||
;;; pitch shift audio
|
|
||||||
(defun p-shift (sig shift)
|
(defun p-shift (sig shift)
|
||||||
(if (= shift 0) ; no pitch shift
|
(if (= shift 0) ; no pitch shift
|
||||||
sig
|
sig
|
||||||
|
@ -103,7 +73,7 @@ $control constrain (_ "Allow duration to change") choice (
|
||||||
(pitshift (hp sig 20) ratio 1)) ; reduce sub-sonic frequencies
|
(pitshift (hp sig 20) ratio 1)) ; reduce sub-sonic frequencies
|
||||||
(T (pitshift sig ratio 1))))))))
|
(T (pitshift sig ratio 1))))))))
|
||||||
|
|
||||||
;;; apply effects to echo
|
;;; Apply effects to echo
|
||||||
(defun modify (sig num gain shift p-type)
|
(defun modify (sig num gain shift p-type)
|
||||||
(let ((gain (db-to-linear (* num gain)))
|
(let ((gain (db-to-linear (* num gain)))
|
||||||
(shift (* num shift)))
|
(shift (* num shift)))
|
||||||
|
@ -111,7 +81,7 @@ $control constrain (_ "Allow duration to change") choice (
|
||||||
(mult gain (change-speed sig shift))
|
(mult gain (change-speed sig shift))
|
||||||
(mult gain (p-shift sig shift)))))
|
(mult gain (p-shift sig shift)))))
|
||||||
|
|
||||||
;;; compute echoes
|
;;; Compute echoes
|
||||||
(defun delays (sound gain delay shift num type mod)
|
(defun delays (sound gain delay shift num type mod)
|
||||||
(let ((echo (s-rest 0)))
|
(let ((echo (s-rest 0)))
|
||||||
(do ((count 1 (1+ count))
|
(do ((count 1 (1+ count))
|
||||||
|
@ -130,13 +100,17 @@ $control constrain (_ "Allow duration to change") choice (
|
||||||
(defun constrain-abs (sig dur)
|
(defun constrain-abs (sig dur)
|
||||||
(extract-abs 0 dur (cue sig)))
|
(extract-abs 0 dur (cue sig)))
|
||||||
|
|
||||||
;;; return errors or process
|
|
||||||
(if (> (length err) 0)
|
(let* ((delay (if (= delay-type 0)
|
||||||
(format nil (_ "Error.~%~a") err) ; return error
|
delay
|
||||||
(let* ((delay (if (= delay-type 0) delay (/ delay number)))
|
(/ delay number)))
|
||||||
(output
|
(output (multichan-expand #'delays *track*
|
||||||
(multichan-expand #'delays
|
dgain
|
||||||
s dgain delay shift number delay-type pitch-type)))
|
delay
|
||||||
(if (= constrain 1)
|
shift
|
||||||
|
number
|
||||||
|
delay-type
|
||||||
|
pitch-type)))
|
||||||
|
(if (= constrain 1)
|
||||||
(multichan-expand #'constrain-abs output (get-duration 1))
|
(multichan-expand #'constrain-abs output (get-duration 1))
|
||||||
output)))
|
output))
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
;nyquist plug-in
|
;nyquist plug-in
|
||||||
;version 4
|
;version 4
|
||||||
;type analyze
|
;type analyze
|
||||||
;name "RMS"
|
;name "Measure RMS"
|
||||||
|
;manpage "Measure_RMS"
|
||||||
|
;action "Measuring RMS level..."
|
||||||
;author "Steve Daulton"
|
;author "Steve Daulton"
|
||||||
|
;release 2.3.1
|
||||||
;copyright "Released under terms of the GNU General Public License version 2"
|
;copyright "Released under terms of the GNU General Public License version 2"
|
||||||
|
|
||||||
;; Released under terms of the GNU General Public License version 2:
|
;; Released under terms of the GNU General Public License version 2:
|
||||||
|
|
Loading…
Reference in New Issue