Page 1 of 1

Mix and Render with Auto Crossfade

Posted: Thu Feb 12, 2015 3:52 pm
by Steve Bender
Sorry if this has been suggested already. I did a search and could not find it.

A feature that I would find extremely helpful is Mix and Render with Auto Crossfade.

So, say you have four tracks with a composite length of 10 seconds. Track 1 is from 0-3, Track 2 is from 2.5-5.5, Track 3 is from 5-8, Track 4 is from 7.5-10. So there is a total of 1.5 seconds of overlap between all tracks. You don’t want to do a simple mix and render because this would cause clipping in the overlapped regions. You could go and do a crossfade on the three overlapping regions and then mix and render. That’s fairly simple, and not all that time-consuming. But what if you have 16 tracks, with 15 regions of overlap? That starts to become a real bear. How about 31 regions of overlap? I think you catch my drift.

So what about a feature that accomplishes all of these steps in one fell swoop? This would allow an infinite number of non-clipping tracks to be mixed together into a single non-clipping track.

This feature would open up a world of possibilities for me, and I think other users would grow to love it, even if they don’t understand the appeal right away.

Thanks.

Re: Mix and Render with Auto Crossfade

Posted: Fri Feb 13, 2015 3:04 pm
by steve
This does not completely satisfy your request (so your feature request still stands), but the next version of Audacity will include an effect that makes crossfading tracks much simpler. You can see the (provisional) documentation for this new feature in the "alpha" manual here: http://manual.audacityteam.org/man/Crossfade_Tracks

There is also another crossfade effect on the way, but it was not ready before the deadline for new features. It will be available as an optional plugin soon after the next Audacity release (the plugin cannot be released until then because it requires a feature that is not available in the current version of Audacity).

Re: Mix and Render with Auto Crossfade

Posted: Fri Feb 13, 2015 3:44 pm
by Steve Bender
Thanks for the response. I guess I'll have to wait on this one. This is actually kind of my dream request!

I can accomplish the same thing "by hand" if it's only a hanfdul of edits prior to mix and render, but I've mainly started to avoid trying out certain ideas that I know are going to involve 16 or more crossfades prior to M&R. It just gets too time consuming. But I have avoiding ideas for that reason, because the crosfade/m&R methodology can really produce some interesting results that you just can't get in any other way.

But I was actually thinking about my request, and how it might work. As long as no two overlapping sections overlap with each other (the overlapped regions do not overlap with other overlapped regions), it should be pretty "simple" to make this happen. I have no idea if writing the code is "simple" or not - I just mean that it wouldn't invlolve any algorithms for decision-making or whatever. It would just operate on the logic of "crossfade ANY overlapping regions."

But - if you did have overlapped regions that DO overlap with other overlapped regions, then that could strat to get tricky. I'm guessing you'd probably just want to do a top down fashion.

I'll keep my fingers crossed that this is a feature I might see in the relatively near future.

Thanks!

Re: Mix and Render with Auto Crossfade

Posted: Fri Feb 13, 2015 4:59 pm
by steve
Steve Bender wrote:But - if you did have overlapped regions that DO overlap with other overlapped regions, then that could strat to get tricky.
I think you have hit the nail on the head ;)

If this were to be a standard feature built into Audacity, then really it would need to be able to handle the general case. We have no idea what people will try to do, so we need to be able to handle all eventualities (without Audacity crashing). In some cases this involves popping up an error message (if the user tries to do something that is impossible), and sometimes involves making compromises according to what we think is the most useful behaviour (if the user tries to do something that has multiple possible results).

Adding features to Audacity that apply only to one, or a few specific tasks or work-flows, can create a lot of problems in the long run. Audacity is designed to be a versatile multi-track audio editor, and people use it for all sorts of things. I am strongly of the opinion that "special purpose" tools should be implemented as optional plugins (you will see many "specialist tools" among the plugin collection on the Audacity wiki: http://wiki.audacityteam.org/wiki/Downl ... t_Plug-ins)

If we were to try and implement this within Audacity itself, how would we handle something like this:
tracks005.png
tracks005.png (18.87 KiB) Viewed 922 times
On the other hand, if we provided your suggested feature as a "special purpose" optional plugin, then we could provide instructions for when and how it should be used, and throw error messages for anything that does not fall within those parameters.

The new "crossfade" tools that I have been working on recently (the first of which will be included in the next Audacity release) are designed to be as "general purpose" as possible.

At present there are technical reasons why it would be difficult to implement your suggestion as a Nyquist plugin, (mostly due to memory management), but this is likely to change in the not too distant future. In the meantime, I'd be happy to work with you on producing a prototype plugin (should be good for projects that have a total track time of up to about 30 minutes).

Re: Mix and Render with Auto Crossfade

Posted: Fri Feb 13, 2015 5:28 pm
by Steve Bender
Yup, so my intuition was correct. And that totally makes sense that the “off the shelf” Audacity should be very general purpose. I’m starting to realize that I use Audacity in a lot of fairly novel ways!

I would be more than happy with a plugin solution. That’s still programmable to a keyboard shortcut, so it’s still just as easy for me.

And the more I think about it, it might actually be better to leave the “Mix and Render” out of it. I think a plugin just to accomplish the auto-crossfade is really the important part. That’s what takes a lot of work. M&Ring it once that’s done is easy peasy. Plus, keeping the two steps separate would allow me to look at the results of the cross fade, and potentially make some fine-touch adjustments, if needed.

As for how the “logic” would work – I would be completely comfortable with it operating in a top-down fashion. Take a look at this pic - http://wiki.audacityteam.org/w/images/8/8d/Playlist.jpg

This is very representative of what I would want it for. All overlapping regions do NOT overlap with any other overlapping regions. So if you could just write it to be like “Crossfade Track 1 with Track 2, then Crossfade Track 2 with Track 3” etc etc down the line, that would work just fine for me. It’s easy to either put/build my tracks in this order, or to use the “Sort tracks by first sound or onset time” or whatever the exact name is (in the track menu).

And actually, I think that same strategy would even work for tracks that DO have overlapping regions that overlap with other overlapping regions. At least I think it would. Maybe I’m not thinking about it hard enough, but it seems like t would work pretty well.

Re: Mix and Render with Auto Crossfade

Posted: Fri Feb 13, 2015 5:46 pm
by steve
Steve Bender wrote:This is very representative of what I would want it for. All overlapping regions do NOT overlap with any other overlapping regions.
With that "restriction" in place, then I think that it would be quite easy to accomplish as a Nyquist effect (assuming that we are using Audacity 2.1 - due for release in a few weeks)., though it would need to run as a "two pass" effect - that is, you run the effect once (the plugin looks for the start and end of each audio clip), then run the effect again to apply the fades. The first "analysis" pass would be very quick.

The reason that it would need to be applied twice is that plugins access one track at a time. In the first pass, it would find the start/end times of each clip in the first selected, add them to a list, then move to the next selected track and find the start / end times of clips in that track - add them to the list, and so on. Optionally, the first pass could create a label track that shows the time positions of each fade that will be applied by the second pass.

In cases (like the image in my previous post) where the "correct" output is ambiguous, I think that the plugin would need to flag up the problem (an error message) and NOT apply the fades (because there is a very good chance that it will not do what you actually want it to do).

There is still the problem in Audacity 2.1 that each track needs to be loaded into ram, and another limitation is that all "white-space" (empty space between audio clips) will be rendered as silence (flat line). Hopefully both of these limitations can be resolved in future versions of Audacity (but too late for the next release).