How to apply multiple crossfaded effects?

Using Nyquist scripts in Audacity.
Post and download new plug-ins.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
Paul L
Posts: 1782
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

How to apply multiple crossfaded effects?

Post by Paul L » Fri Nov 01, 2013 3:25 pm

Suppose I have a sound s, an effect f, and a crossfading envelope e. Defining g(s) as f(s) - s, then I add this to f:
  • e * g(s)
Suppose I want to apply two successive effects on overlapping intervals with crossfading. I imagine band stops with passbands well separated.The obvious is to add
  • e2 * g2( s + e1 * g1(s) )
But is this wrong, because the effects of f1 really get faded by the product of the envelopes? If the envelopes are the same piecewise linear rise, level, and fall, the square of the envelope is steeper sided, defeating the purpose of crossfading.

This might fix that:
  • e2 * g2( s + ( e1 / e2 ) * g1(s) )
It works nicely if the interval where e1 is positive nests in that where e2 is, and simplifies to a single crossfading of the composition of effects where the envelopes are the same.

But of course it divides by zero in the general case. So what about this: use the last formula where e1/e2 is less than some threshold. Compute again with the sequence of effects interchanged where e2/e1 is less than the threshold. Crossfade the two results over the interval where both are defined.

Does that make sense? I am thinking about how to generalize to more than two effects.

dadabujontomasteel
Probationer
Posts: 34
Joined: Tue Jul 02, 2013 9:55 pm
Operating System: Please select

Re: How to apply multiple crossfaded effects?

Post by dadabujontomasteel » Sat Nov 02, 2013 1:16 am

Hi Paul

Try -

1 Make a new V track on your edit so you have an empty 'V1' at the top of your Timeline
2 Open 'Effects' panel
3 Choose Video, Keying>Image Key
4 Drag and Drop the 'Image Key' FX straight to V1 - you'll see it will expand (unfold) to an FX1 track
5 RT click, 'Configure' the FX1 effect
6 Choose your Logo file in the Image Keyer set-up panel 'choose a file', use Blend mode 'in front' should take into account alpha channel information in your graphic file [if it exists - transparency]. Scale, crop and position as required. You can position by clicking on the video window to do that with the mouse.

Hope that helps.

Paul L
Posts: 1782
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: How to apply multiple crossfaded effects?

Post by Paul L » Sat Nov 02, 2013 3:03 am

Thanks, but I have no idea what any of that means! I'm talking about a Nyquist programming problem.

Robert J. H.
Posts: 3633
Joined: Thu May 31, 2012 8:33 am
Operating System: Windows 10

Re: How to apply multiple crossfaded effects?

Post by Robert J. H. » Sat Nov 02, 2013 8:24 am

Hi Paul
Your abstract example may be a little confusing.
I presume that you want to produce a notch in the original sound (1 - 0 - 1) and fill it with a modified version (0 - 1 0), in other words a double cross-fade. Cascading is normally the way to go.
The overall calculation is addition, not multiplication, the envelopes won't be squared, but added up: e*a + e*b = e(a + b).
apply the different envelopes to the different functions (e.g. frequency bands), add them all up and normalize the new sound by 1 / number of envelopes.
Take the same envelopes and add them up separately, normalize them and substract them from one. This complement will now be multiplied with the original sound (new_s = (1 - norm(sum_env123)) * s + norm(env1*f1(s) + env2*f2(s) + env3*f3(s)).
That's in the end all idle talk without a concrete problem to solve - there are too many constraints unknown.

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

Re: How to apply multiple crossfaded effects?

Post by steve » Sat Nov 02, 2013 11:51 am

dadabujontomasteel wrote:1 Make a new V track on your edit so you have an empty 'V1' at the top of your Timeline
Thank you for your enthusiasm, but please, if you don't understand the question don't post spurious replies.
Your post is a copy of a post from another forum and is totally unrelated to Audacity or to the question being asked. Sifting through misinformation is just a waste of everyone's time.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Paul L
Posts: 1782
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: How to apply multiple crossfaded effects?

Post by Paul L » Sat Nov 02, 2013 2:23 pm

steve,

I think I recognize the deesser code you shared in your desciption. This is different.

Think of the clicks I am trying to fix as certain tall and thin rectangles in the spectrogram. I fix each with a band stop by summing results of high and low pass filters with cutoffs dependent on the top and bottom levels. I do not add the passband back.

But it is possible for rectangles in different frequency ranges to overlap in time. If I treat each rectangle separately, what is the best way to combine repairs? I tried to explain why I thought that doing them iteratively might not be best. Could the repair applied first end up crossfaded less well, because the envelope is effectively multiplied by that of the second effect?

I don't know yet how important this will be in practice.

While I have your attention, a different question. Is there a way to do in code what the equalization tool does? For each click I have information about which frequencies need how much reduction and perhaps it is crude just to choose one lowpass and highpass sufficient for the most prominent ones.

But I think much of this now is speculation running ahead of experiment.

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

Re: How to apply multiple crossfaded effects?

Post by steve » Sat Nov 02, 2013 3:32 pm

Just passing through briefly - about to go to work :)

Have a look at graphiceq.lsp (I've attached it as I don't think it is included in Audacity). In particular, see: (defun nband-range (sig gains lowf highf)
grapheq.lsp
(2.67 KiB) Downloaded 106 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Paul L
Posts: 1782
Joined: Mon Mar 11, 2013 7:37 pm
Operating System: Please select

Re: How to apply multiple crossfaded effects?

Post by Paul L » Sat Nov 02, 2013 5:24 pm

Thanks!

I see you simply apply eq-band repeatedly for each of the data points of the "curve." I was thinking of writing exactly that for myself but I didn't know if what the graphic equalization tool does is something different and better mathematically.

For now I am stepping frequencies linearly when testing for clicks, but if I step logarithmically instead, maybe I would miss a click but then I could use this code more directly.

I see eq-band has the possibility of varying the gain over the interval, just as I could vary the cutoff frequency with lp or hp.

Post Reply