The method described in my previous post should do a good job with that. Short files are trimmed very close to start/end of the audio. However if the files are in a compressed format such as MP3, note that:
- Audacity only works on uncompressed data, so the MP3 would be decoded (automatically) when it is imported. If you then either export as MP3, or export as WAV and re-encode to MP3 with an external encoder, there will be some sound quality loss when it is encoded. It is always best (whenever possible) to work with uncompressed audio (such as WAV files). Encoding to a lossy format (such as MP3, WMA, Ogg…) should be done as the final step, and it is usually best to keep an uncompressed (WAV) backup of the file just in case you ever want to do more editing.
- The MP3 format always adds a little bit of silence at the beginning of the file. This is a limitation of the MP3 format and makes MP3s unsuitable for looping. Ogg format offers similar quality as MP3 (often slightly better) and does not have this problem.
Unfortunately, without my patch (mentioned previously) you are limited to the effects that are listed in the Edit Chains dialogue, and this does not include reverb or other complex echo effects. (For “distortion” you could use the “Leveller” effect on a heavy setting). There are some possible workarounds:
- You set up a Chain with the Nyquist Prompt (as already described) with “code to apply reverb” in the Nyquist prompt.
Note that the major limitation of using the Nyquist Prompt in a chain is that the code in the Nyquist Prompt is not saved in the Chain. When you close Audacity the code is gone. If you use the Nyquist Prompt outside of the Chain, the code that is used in the Chain will also change. The Nyquist Prompt in the Chain will use whatever code is currently in the Nyquist Prompt window, so that means that you cannot add two different instances of Nyquist code. - You could use multiple instances of the (simple) Echo effect in the same chain with different settings each time to create a more complex echo effect.
- You could compile Audacity from the source code with the patch (mentioned previously) that adds support for Nyquist (not easy on Windows).
This would allow you to add a Nyquist reverb effect to the Chain. - You could modify the code of the Nyquist Reverb effect so that the ;control settings are predefined variables, and that the output is assigned to a local variable, then add the “Trim Silence” code after the Reverb code, replacing “s” with the local variable. (not easy without learning a bit about Nyquist programming).
Here is some code for you to play with (from "Reverb1) that adds reverb. On stereo tracks it will produce a stereo reverb.
The first 5 lines (before the License information) are the reverb settings. I think they are self explanatory, but only change the number in those first 5 lines, any other changes are likely to break the code.
(setq time 2.5) ;Reverberation time in seconds
(setq damping 50) ;High frequency damping (%)
(setq low-cut 200) ;Low cut filter (Hz)
(setq width 40) ;Stereo Width of reverb
(setq mix 20) ;Reverb mix proportion (%)
;; An implementation of reverb.lsp by Roger Dannenberg.
;; reverb1.ny by Steve Daulton. July 2011.
;; Released under terms of the GNU General Public License version 2:
;; http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
;limit values to valid range
(setq time (max 0.1 time))
(setq damping (max 0 (min 1 (/ damping 100.0))))
(setq low-cut (max 0 (min (/ *sound-srate* 2.0) low-cut)))
(setq width (max 0 (min 1 (/ width 100.0))))
(setq mix (max 0 (min 1 (/ mix 100.0))))
;; create new Left channel
(defun Lsplit (leftch df)
(let((f1 (lp leftch 300)) ;Common Sub below 300
(f2 (feedback-delay(lp(hp leftch 300)600)(* df 0.2) 0)) ;Low on LEFT 300-600
(f3 (lp(hp leftch 600)1200)) ;Common MID - 600-1200
(f4 (feedback-delay(lp(hp leftch 1200)2400)(* df 0.08) 0)) ;High Mid on LEFT 1200-2400
(f5 (hp leftch 2400))) ;Common Presence
(sim f1 f2 f3 f4 f5))) ;mix sounds
;; create new Right channel
(defun Rsplit (rightch df)
(let((f1 (lp rightch 300)) ;Common Sub below 300
(f2 (feedback-delay(lp(hp rightch 300)600)(* df 0.14) 0)) ;Low Mid on RIGHT 300-600 Hz
(f3 (lp(hp rightch 600)1200)) ;Common MID - 600-1200
(f4 (feedback-delay(lp(hp rightch 1200)2400)(* df 0.06) 0)) ;Treble on RIGHT 1200-2400
(f5 (hp rightch 2400))) ;Common Presence
(sim f1 f2 f3 f4 f5))) ;mix sounds
(defun stereo (s-in w)
(let ((dlay (+(* w 0.5)0.2)))
(if (arrayp s-in)
(vector
(sim
(mult w (Lsplit (aref s-in 0) dlay))
(mult w -0.5 (Rsplit (aref s-in 1) dlay))
(mult (- 1 w) (aref s-in 0)))
(sim
(mult w -0.5 (Lsplit (aref s-in 0) dlay))
(mult w (Rsplit (aref s-in 1) dlay))
(mult (- 1 w)(aref s-in 1))))
s-in)))
;; Reverb function by Roger Dannenberg
(defun reverb (x time)
(multichan-expand #'reverb-mono x time))
(defun reverb-mono (ga irevfactor)
(let (sr ilowpass idel ihz icsc acomball allp1 allp2 allp3 alow allp4 allp5
arevout)
(setf sr (snd-srate ga))
(setf ilowpass 9000.000) ; frequency of lowpass filter
(setf idel (list ; list of frequency/delay values
(/ 1237.000 sr) (/ 1381.000 sr) (/ 1607.000 sr)
(/ 1777.000 sr) (/ 1949.000 sr) (/ 2063.000 sr)
(/ 307.000 sr) (/ 97.000 sr) (/ 71.000 sr)
(/ 53.000 sr) (/ 47.000 sr) (/ 37.000 sr)
(/ 31.000 sr)))
; Nyquist's comb filter uses Hz rather than delay as parameter,
; so take reciprocals to get Hz:
(setf ihz (mapcar #'/ idel))
(setf icsc (list ; list of delay times
(* irevfactor 0.822) (* irevfactor 0.802)
(* irevfactor 0.773) (* irevfactor 0.753)
(* irevfactor 0.753) (* irevfactor 0.753)
(* irevfactor 0.7)))
(setf acomball (sum
(comb ga (nth 0 icsc) (nth 0 ihz))
(comb ga (nth 1 icsc) (nth 1 ihz))
(comb ga (nth 2 icsc) (nth 2 ihz))
(comb ga (nth 3 icsc) (nth 3 ihz))
(comb ga (nth 4 icsc) (nth 4 ihz))
(comb ga (nth 5 icsc) (nth 5 ihz))))
(setf allp1 (alpass acomball (nth 6 icsc) (nth 6 ihz)))
(setf allp2 (alpass allp1 (nth 6 icsc) (nth 7 ihz)))
(setf allp3 (alpass allp2 (nth 6 icsc) (nth 8 ihz)))
(setf alow (lp allp3 ilowpass))
(setf allp4 (alpass alow (nth 6 icsc) (nth 9 ihz)))
(setf allp5 (alpass allp4 (nth 6 icsc) (nth 11 ihz)))
allp5))
;; End of Reverb function.
(defun damp (s-in val)
;make a mono copy of stereo input
(let* ((mono (if (arrayp s-in)(mult 0.5(sum (aref s-in 0)(aref s-in 1))) s-in))
;clip to 0 dB
(mono (clip mono 1))
;upper limit of filter
(fmax (* 0.5 *sound-srate*))
;lower limit of filter
(fmin (+ 100(*(- 1 val)(- 1 val)(- fmax 100))))
;make envelope for low-pass filter
(env (sum fmin (mult(- fmax fmin)(snd-avg mono 100 100 op-peak)))))
(lp (lp (lp s-in fmin) env) env)))
(sim
(mult (- 1 mix) s)
(mult mix (- 0.35 (* time 0.02))
(highpass2
(damp
(reverb (stereo s width) time)
damping)
low-cut)))
Also I note that we are still in the “Audacity 1.2.x for Windows” section, but Chains are not available for Audacity 1.2.
I’ll move this to the Audio Processing section.