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:
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.