Cross Fade Classic

Archive of Nyquist Plug-ins.
Many of the plug-ins here will be available on the Audacity Wiki.
Forum rules
This Forum is an archive of old topics concerning Nyquist plug-ins.

Feedback and questions relating to topics may be posted, but please
DO NOT POST NEW TOPICS HERE.

New plug-ins may be posted on the New Plug-Ins board.
Other posts relating to Nyquist should be posted to the main Nyquist board.

The main repository for Audacity/Nyquist Plug-ins is on the Audacity Wiki.
steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Cross Fade Classic

Post by steve » Thu Aug 02, 2012 1:20 pm

Inspired by the popularity of "Pro Fade Out", here is a "one click solution" to creating a professional sounding cross fade.

The name "Cross Fade Classic" is a working title to distinguish it from the (many) other cross fade effects.

This plug-in partially automates the classic method of producing a cross-fade, which is to line two tracks up, one below the other so that they overlap, then trim and cross-fade (or cross-fade and trim).

Here is a simple example of applying "Cross Fade Classic" to create a professional sounding cross fade:

1) Align the songs so that track 2 (the second song) overlaps track 1 (the first song). We are going to cross fade the overlapping region, so select the overlapping region:
tracks000.png
tracks000.png (19.88 KiB) Viewed 7838 times
2) Effect menu > Cross Fade Classic (or use a custom key binding for Cross Fade Classic).
tracks001.png
tracks001.png (18.52 KiB) Viewed 7838 times
3) There is no "3", unless you want to mix and render.

Basically that's it. More details, hints (and the plug-in) to follow...
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Cross Fade Classic

Post by steve » Thu Aug 02, 2012 1:33 pm

Resetting the effect.

1) Why might resetting be necessary?

The cross-fade effect fades out the first track, then fades in the next track, then resets itself.
If for any reason the effect is applied to an odd number of tracks (user error :o ), then the track count will get out of sync and the plug-in will think that its on a "second track" when it's actually on the first track.

If this happens, the cross-fade will be completely wrong. The first track will fade in instead of out and the next track will fade out instead of fading in:
tracks002.png
tracks002.png (18.56 KiB) Viewed 7837 times
Of course you can use Edit menu > Undo (or Ctrl + Z) to undo the effect, but then you will still need to reset Classic Cross Fade so that it is back in sync.

2) How to reset the effect

Fortunately resetting the Cross Fade Classic is very easy.
Simply select part of one track. Just a short empty section will do. Mono or stereo, it doesn't matter which:
firsttrack000.png
firsttrack000.png (8.59 KiB) Viewed 7837 times
Apply Cross Fade Classic.
If a section containing audio was selected it will be faded in.
If an empty section of a track was selected, silence (samples at zero) will be produce:
firsttrack001.png
firsttrack001.png (8.62 KiB) Viewed 7837 times
Edit menu > Undo (or Ctrl + Z) to undo the effect.

Cross Fade Classic is now reset.

Usage tips and the plug-in to follow....
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Cross Fade Classic

Post by steve » Thu Aug 02, 2012 1:59 pm

To achieve a "perfect" cross fade, I generally find it easiest to align the tracks and apply the cross-fade before trimming any excess from the end of the first track or the start of the second track. Of course this is a matter of personal preference, but here is an example of cross-fading before trimming.

1) Align the tracks as required with the second song on track 2 and the region to be cross-faded selected.
  • Tip: If the tempo of rhythmic tracks are greatly different (as in this demonstration) it will be difficult to achieve a really smooth mix, but try and get the beats to match in the centre of the fade.
  • Tip: Set the end of the fade to a natural starting point in the second track, such as the start of a verse or chorus.
  • Tip: Listen to the selection and adjust as necessary until you think it's right. If it's not quite right you can quickly undo the effect (Ctrl+Z), make an adjustment to the selection or overlap, then reapply the effect (Ctrl+R).
tracks000.png
tracks000.png (20.65 KiB) Viewed 7839 times
2) Effect menu > Cross Fade Classic (or use a custom key binding for Cross Fade Classic).
tracks001.png
tracks001.png (20 KiB) Viewed 7839 times
3) Without adjusting the selection, Split the cross faded section. (Edit > Clip Boundaries > Split or Ctrl+I)
tracks002.png
tracks002.png (20.17 KiB) Viewed 7839 times
4) Play the selected region. If it doesn't sound quite right, undo (Ctrl+Z) and go back to step 1, otherwise continue to step 5.

5) Select the (no longer required) end section of track 1 and delete it:
tracks003.png
tracks003.png (19.94 KiB) Viewed 7839 times
6) Select and "Split Delete" the no longer required section of track 2 (Edit > Remove Audio > Split Delete or Alt+Ctrl+K)
tracks004.png
tracks004.png (18.33 KiB) Viewed 7839 times
tracks005.png
tracks005.png (17.68 KiB) Viewed 7839 times
The cross fade is now complete.
Optionally you may want to select then Mix and Render the tracks, but that is not necessary as the tracks will automatically be mixed when the project is exported.


Here is the finished cross-fade that was used in this demonstration:
Bob-Marley-mix.mp3
(713.4 KiB) Downloaded 566 times
And here is the Cross Fade Classic plug-in: (please don't just down load it and say nothing. If you download it, please post some feedback).
Attachments
cross-fade-classic.ny
(1.35 KiB) Downloaded 556 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

waxcylinder
Forum Staff
Posts: 14685
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Cross Fade Classic

Post by waxcylinder » Thu Aug 02, 2012 4:31 pm

Downloaded it and tried it - works well "does what is says on the tin" - levels stay pretty good throughout, works briskly enough.

But and this is a big BUT - it is far too easy (as you point out) to get it out of sync with itself by working on an odd number of tracks. I can forsee lots of forum postings where the user accidentally selects on one of a pair of stereo tracks , applies the effect and then wonders why the fade goes the wrong way around :o :? :x

Can you not make it so that it demands an even number of tracks and refuses to work when an odd number of tracks are selected?
Or make it reset itself after every use?
Apart from anything else that will make it easier to document as we then won't have to document how to do a reset.

Peter
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

waxcylinder
Forum Staff
Posts: 14685
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Cross Fade Classic

Post by waxcylinder » Thu Aug 02, 2012 4:48 pm

Just did a more careful test on the levels, using two 30 second bursts of generated sound wave - sound level remained constant throughout, nic eone :)

The shape looks the same as the Pro-fade-out, is it? Does it do the same pro-trickery stuff as PFO or is is just straightford shaped amplitude fades.

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Cross Fade Classic

Post by steve » Thu Aug 02, 2012 5:22 pm

The fade shape is the "classic" raised cosine shape (an "S" curve or "sine" fade, give or take 180 degrees)

Image
http://transom.org/?p=7543

Regarding your big butt, how easy is it to accidentally get out of sync once you know that it does that, and how easy is it to get back into sync?
waxcylinder wrote:Can you not make it so that it demands an even number of tracks and refuses to work when an odd number of tracks are selected?
Unfortunately no. Nyquist has no idea how many tracks are selected, it see them one at a time.
The "trick" used to tell Nyquist which way to fade is that when it does the first fade it sets a value that survives from one run to the next. The next time it runs, if that value is set it will fade the other way and reset the value.
waxcylinder wrote:Or make it reset itself after every use?
One track is one use. It resets itself after every other use. That's how it knows whether to fade out or fade in. If it "is not set" then it knows "first track, fade out". If it "is set" then it knows "second track, fade in".

"Advanced" users may work out that they can use this "limitation" creatively if they want to fade out track 2 and fade in track 1, but we can leave that up to the imagination of "advanced" users.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Cross Fade Classic

Post by steve » Thu Aug 02, 2012 5:27 pm

waxcylinder wrote: I can forsee lots of forum postings where the user accidentally selects on one of a pair of stereo tracks , applies the effect and then wonders why the fade goes the wrong way around
To which the reply is a brief:
"See HERE".
I'll put that link in my bookmarks between http://manual.audacityteam.org/manual/h ... jects.html and http://manual.audacityteam.org/man/FAQ: ... g-Ins#lame
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

waxcylinder
Forum Staff
Posts: 14685
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Cross Fade Classic

Post by waxcylinder » Fri Aug 03, 2012 7:57 am

steve wrote:Regarding your big butt, how easy is it to accidentally get out of sync once you know that it does that, and how easy is it to get back into sync?
Very easy - but then I had RTFMd the instructions ;)

Had I not done so I probably would have thought WTF :?

Peter
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

waxcylinder
Forum Staff
Posts: 14685
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10

Re: Cross Fade Classic

Post by waxcylinder » Fri Aug 03, 2012 8:01 am

Is the non-resettability a limitation down to this being programmed in Nyquist?

If it was adopted in the future by a Developer and implemented in the mainstream code, using your Nyqist version as a paradigm, could this limitation be avoided?

Peter.
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * FAQ * * * * * Tutorials * * * * * Audacity Manual * * * * *

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Cross Fade Classic

Post by steve » Fri Aug 03, 2012 10:13 am

waxcylinder wrote:Is the non-resettability a limitation down to this being programmed in Nyquist?
The limitation is because it is a plug-in. As far as I'm aware the limitation applies to all plug-ins.
waxcylinder wrote:If it was adopted in the future by a Developer and implemented in the mainstream code, using your Nyqist version as a paradigm, could this limitation be avoided?
There's (at least) two ways that the limitation could be overcome.

An implementation in C+ should be able to avoid this limitation.

Another possible way would be if Audacity told Nyquist more about its environment so that the plug-in could know if it has just been launched or is processing another track. This solution would have the added bonus that it adds a feature that could be used in other plug-ins, so perhaps a greater ROI.

The downside of any "solution" is that there would then be no way to reverse the effect if a user wanted to do so. This is perhaps a lesser "limitation".
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Locked