Nyquist code for Normalize, Generate Tone
Posted: Wed May 06, 2009 6:08 pm
Hey there,
Just had a quick question. Anybody know if the Nyquist code is available somewhere for the Effect 'Normalize' (or a similar effect) and the function Generate 'Tone'?
I'm trying to automate a process for editting an audio file (my other thread has details on that) and these are the last steps before the process is fully automated.
Also curious, is there a way to combine two audio tracks into a stereo track with Nyquist?
Thanks,
Seanybob
Edit:
Just found code for normalizing:
Just had a quick question. Anybody know if the Nyquist code is available somewhere for the Effect 'Normalize' (or a similar effect) and the function Generate 'Tone'?
I'm trying to automate a process for editting an audio file (my other thread has details on that) and these are the last steps before the process is fully automated.
Also curious, is there a way to combine two audio tracks into a stereo track with Nyquist?
Thanks,
Seanybob
Edit:
Just found code for normalizing:
Code: Select all
; normalize function
(defun normalize (signal)
(setf x (if (arrayp signal)
(s-max (peak (aref signal 0) ny:all) (peak (aref signal 1) ny:all))
(peak signal ny:all)))
(scale (/ 0.95 x) signal))