1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-12 01:23:38 +02:00

Paul Licameli's Spectral Editing Patch.

This relies on three new nyquist scripts to actually do the editing.  The peak-snapping code in FrequencyWindow has been extracted into a new class, SpectrumAnalyst, to provide peak-snapping in spectrogram too.
This commit is contained in:
james.k.crook@gmail.com
2014-10-18 14:19:38 +00:00
parent b84fdb82e1
commit 37608c2290
28 changed files with 1342 additions and 279 deletions

View File

@@ -0,0 +1,32 @@
;nyquist plug-in
;version 3
;type process
;name "Spectral edit parametric EQ"
;action "Calculating..."
;control control-gain "Gain (dB)" real "" 0 -24 24
(defun wet (sig gain)
(cond
((not (or *f0* *f1*)) (throw 'debug-message "Please select frequencies"))
((not *f0*) (throw 'debug-message "Bottom frequency is undefined"))
((not *f1*) (throw 'debug-message "Top frequency is undefined"))
(t (let*
((fc (sqrt (* *f0* *f1*)))
(width-octaves (/ (s-log (/ *f1* *f0*)) (s-log 2.0))))
(eq-band sig fc gain (/ width-octaves 2))))))
(defun result (sig)
(let*
((tn (truncate len))
(rate (snd-srate sig))
(transition (truncate (* 0.01 rate)))
(t1 (min transition (/ tn 2)))
(t2 (max (- tn transition) (/ tn 2)))
(breakpoints (list t1 1.0 t2 1.0 tn))
(env (snd-pwl 0.0 rate breakpoints)))
(sum (prod env (wet sig control-gain)) (prod (diff 1.0 env) sig))))
(catch 'debug-message
(multichan-expand #'result s))