This plug-in convolves the two channels of a selection from a stereo track, overwriting both channels of the source track. A typical application is for one channel to contain a monaural audio sample and the other an impulse response representing a reverberant environment into which it is to be placed.
There are some limitations:
Audacity imposes a memory limit on the Nyquist (convolve) function; experimentally, this results in a 20 second limit on the selection at 48KHz sample rate. Attempts to convolve longer selections throw a table limit error that will be found in the Debug window.
Audacity applies a common selection to both channels of the selection. It will probably be necessary to prepare separate monaural tracks of your source audio and impulse response, time align them, then combine them into a stereo track to convolve. Audacity forces both the sample and the impulse, if shorter, to the length of the selection, so the convolved track will have twice the length of the original selection and will overwrite it so as to contain the "tail" of the impulse response.
(convolution) took 8 minutes to process a 10-second audio selection and impulse function at 48KHz sampling rate on a Dell laptop with an i5-5200U CPU.
Convolution is prone to overflow, so you may wish to set the input coefficients to 20%, convolve a short but high amplitude portion of your source material including the entire impulse response, then adjust the input coefficients before you commit to a 15-minute run. You can always UNDO a clipped result to get your raw material back for another try. Attempts to convolve a monaural track, convolve between tracks, or convolve selections with unmatched sample rates will also throw an error.
Code: Select all
;nyquist plug-in ;version 3 ;type process ;name "Channel Convolver..." ;action "Convolving..." ;preview "enabled" ;author "Dave Poole" ;copyright "Released under terms of the GNU General Public License version 2" ;; v0.1 14-May-2018 ;; http://www.gnu.org/copyleft/gpl.html ;control left-input-scale "Input Scale Factors\nLeft channel (%)" float "" 50 0 100 ;control right-input-scale " Right channel (%)" float "" 50 0 100 ;; Create list of values from the slider values (setq channels (list left-input-scale right-input-scale)) ; Print settings to debug window (format T "Convolution of:~%Left mix = ~a %~%Right mix = ~a %\n" (nth 0 channels)(nth 1 channels)) ; convert percent to +/- 1 (setf channels (mapcar #'(lambda (num) (/ num 100.0)) channels)) ; convolve and output as (two channel monoaural) vector (if (arrayp s) ; check for stereo track (convolve (mult (aref s 0)(nth 0 channels)) (mult (aref s 1)(nth 1 channels))) ; or error if not stereo (format NIL "Error\nChannel Convolver convolves stereo channels"))