A pair of plug-ins for simplifying “punch in” editing.
Unlike the standard paste function in Audacity, the “punch” paste replaces the selected audio with just the right amount of pasted audio to match the duration of audio being replaced, thus the speed and timing of the track is not changed by pasting.
These plug-ins were developed from a feature request on the forum (https://forum.audacityteam.org/t/alternate-equal-length-paste-command-resolved/28836/1) to streamline the work flow of replacing parts of a track with “room noise” (ambient noise), though in its current form it could have many other uses.
The first plug-in is called “Punch Copy” and the second is called “Punch Paste”.
“Punch Copy” can be used on its own, but “Punch Paste” can only be used after using “Punch Copy”.
Punch Copy:
The default action of this plug-in is to copy the selected audio to its own clipboard (which is independent from the normal Audacity clipboard). The “clipboard” contents are held in RAM so it is essential that there is sufficient free RAM available to copy the selected audio. It also sets the parameters (settings) for the Punch Paste effect.
- Select action: [Copy (default), Paste, Clear Clipboard]
Copy will copy the selected audio to the clipboard.
Paste will paste the current “Punch” clipboard into the current selection.
Clear Clipboard empties the “Punch” Clipboard and frees the computer memory that was used for storing the clipboard. - Paste: Loop mode: [Looping (default), Single Shot]
This sets how paste will behave if pasting into a selection that is longer than the clipboard contents.
When “Looping” is selected, the clipboard will be repeated as many times as necessary to fill the current selection.
When “Single Shot” is selected, the clipboard contents are pasted once only at the start of the selection.
Note that if the clipboard contents are “looped” there is no crossfade between each repeat. - Crossfade type: {Linear (default), S-Curve, Eq Power]
When the crossfade time is greater than zero, the start and end of the paste will crossfade with the original track audio. This is useful for producing a smooth transition between the original audio and the pasted audio.
Three types of crossfade are available:
- Linear (default): Recommended for very short crossfades (when the crssfade is just a few milliseconds). The maximum amplitude after pasting will not be greater than the higher of the clipboard contents or the original audio (which means that provided that neither the audio on the clipboard, or the track being pasted into are clipped, then the result of pasting will not clip).
- S-Curve: This provides a smooth, low distortion crossfade. The maximum amplitude after pasting will not be greater than the higher of the clipboard contents or the original audio. This is recommended for longer crossfades where it is important that the resulting amplitude is not higher than the source audio (the clipboard and the destination track).
- Eq Power: This is recommended to maintain a constant perceived loudness across the crossfade transition. It is particularly effective when pasting ambient noise into similar audio. Note that the resulting audio may have a higher peak level than both the clipboard audio and the selection contents, so take care with this option if either of these have a high peak level.
- Max crossfade time (s): [slider range, 0 to 5 seconds, default 0]
When set to zero, the audio will be pasted without any crossfade. When set above zero, this will set the time taken to fade from the original selection content to the pasted clipboard content, and from the pasted clipboard content back to the original selection audio. If the crossfade time is too long to fit into the selection, then the actual crossfade time will be half of the selection length, so that the pasted content will fade in and then immediately begin to fade out.
When Punch Copy is used, the “paste” options are stored on the clipboard along with the copied audio.
Note that the settings are stored on the clipboard whether “Punch Copy” is being used to copy or paste.
The settings are cleared when the clipboard is cleared.
Punch Paste:
This plug-in is a “one click” effect with no user interface. It takes its settings from whatever was set the last time that Punch Copy was used (within the current Audacity session). Thus the defaults are the same as for Punch Copy. Obviously, before Punch Paste can be used it is necessary to use Punch Copy so that there is some audio on the clipboard.
The benefit of a separate “Punch Paste” plug-in is that allows the same clipboard content to be pasted multiple times quickly and easily. The most efficient way to paste the clipboard contents is to set a keyboard shortcut to the Punch Paste effect.
Because Punch Paste has no user interface, the only way to change the paste settings is to use the Punch Copy effect (in either “Copy” mode or “Paste” mode).
Mono / Stereo
The plug-ins support both mono and stereo.
When pasting mono audio from the clipboard into a stereo track, the clipboard is pasted into both left and right channels.
When pasting stereo audio into a mono track, the clipboard contents are mixed to mono before pasting (though the clipboard contents remain unaltered so it can still be pasted as stereo into a stereo track).
Limitations:
- The effect can be quite slow when pasting into a large selection.
- Only one audio clip can be stored on the clipboard at one time.
Attempting to copy multiple selected tracks at the same time will copy each track in turn, overwriting the previously copied selection, so that only the selection from the last audio track remains on the clipboard. - The maximum duration of audio that can be copied is 100 million samples.
WARNING:
Do not attempt to copy a large selection if your computer does not have sufficient RAM - doing so will probably cause Audacity to crash.
1 minute of stereo audio at CD quality will use around 20 MB of RAM (memory). A 20 minute selection will use around 400 MB of RAM.
Pasting the clipboard does not clear this RAM (so the same clipboard may be pasted multiple times). Use the “Clear Clipboard” option to empty the clipboard and release the used memory.
PunchCopy.ny (8.45 KB)
PunchPaste.ny (5.58 KB)
Current Version:PunchCopy.ny (9.8 KB)
Current Version: PunchPaste.ny (6.2 KB)
For a new version that is compatible with macros in Audacity 3.0.2, see: https://forum.audacityteam.org/viewtopic.php?p=427085#p427085