The problem:
When an audio clip is made by cutting (or copying) a section from a piece of audio, there will often be a "click" at the start/end of the audio clip. This will happen whenever an audio clip starts / ends at a non-zero point in the waveform. As can be seen in this zoomed-in image, there is a "discontinuity" at the start of the audio clip, and that will produce an audible "click" when played:
A solution:
One possible solution is to apply a short fade to the audio clip (fade-in at the start, fade-out at the end):
Such fades can be quite easily created using Audacity's Fade-in / Fade-out effects (http://manual.audacityteam.org/o/man/ef ... linearfade), but this can be quite fiddly and time consuming when working with a lot of short audio clips.
The plugin concept:
The idea of this plugin is to make the process of applying a short fade to the start / end of an audio clip, quicker and easier.
Ideally, for this purpose, the effect should be a "one click" effect to which we can allocate a keyboard shortcut.
Keyboard shortcuts can be set for installed Nyquist effects in "Edit > Preferences > Keyboard" (http://manual.audacityteam.org/o/man/ke ... ences.html)
Limitations:
1) Because we want this to be a one-click effect, it will not have an interface - just select the audio clip and apply (no user options).
The crossfade length is therefore fixed (we will initially go for a 5 millisecond (0.005 seconds) fade, as that seems to work well for most audio clips. The length can be changed by a simple modification to the code.
2) The way that Nyquist is currently implemented in Audacity requires that the selected audio is loaded into the computer's ram memory to apply this effect, therefore it can only be used on relatively short audio clips (it should be OK for up to 30 minutes duration on most modern computers, which for the intended purpose is more than plenty
Why a Nyquist Plugin:
Probably the most useful thing about Nyquist plugins is that they can be written by anyone. They are written as plain text documents, and they run directly from that text file.
The main documentation for Nyquist plugins for Audacity is here: http://wiki.audacityteam.org/wiki/Nyqui ... _Reference
All technical information relating to this little project can be found from that documentation (including the Nyquist manual, which is linked at the top of that page).
Important note about "plain text" files:
"Plain text" means standard ASCII characters. These files can be created or modified using any "plain text editor" (such as Microsoft NotePad).
Word processing applications such as MS Word, or MS Write should NOT be used. These programs use special formatting that will completely mess up the Nyquist code.
For Windows users I would highly recommend the free text editor Notepad++ (http://notepad-plus-plus.org/), though any "plain text" editor will do.
The main advantages of Notepad++ is that it has "parentheses matching". Nyquist code uses a lot of "parentheses" - round brackets "(" and ")" - and the open/close brackets must all match up. Notepad++ also supports "syntax highlighting" for the LISP programming language. "Syntax highlighting" will colour code key words, making the code easier to read. The Nyquist language is based on LISP, so, although not comprehensive, LISP highlighting is generally helpful.
The Code:
This is the processing code that we are starting with (copied over from previous discussion):
Code: Select all
(setq fade-length 0.005)
(setq dur (get-duration 1))
(abs-env
(control-srate-abs *sound-srate*
(let* ((fl fade-length)
(env (pwlv 0 fl 1 (- dur fl) 1 dur 0)))
(mult s env))))
Coming next....
My next post will look at converting the above code into a plugin.