# Simple Formula for Curve of DJ Crossfader volume : Dipped

Below are the common set of curves that are used in a DJ mixer on the crossfader. I have a software equivalent and am using the "Transition" type curve but would like to include some different curve types.

On both the x and y axis' my range is from 0-1. What I usually do is have a function that gives me one side of the curve. (i.e. just the red from the diagrams below) Then as I need two levels (the red and the blue) for a given x value I invert the x value and feed it to the same formula (something like invertedX = x * -1 + 1)

I need the formula for the Dipped curve in the diagram below.

Extra credit goes to those who can give me the formulas to the other curves

• Intermediate
• Constant Power
• I'm pretty sure Slow Fade, Slow Cut and Fast Cut are all the same formula with just a parameter difference or two.

I have Transition (the easiest of them all)

-
Is "intermediate" supposed to be linear? The "fade" and "cut" ones would have to be piecewise, and the rest might be represented with simple powers. –  Ｊ. Ｍ. Sep 14 '10 at 9:45

Intermediate is clearly $y = 1 - x$ and $y = x$; should be similarly related to transition.

I want to say that Dipped is a parabola (not sure it is; hard to tell); in which case it would be

$y = (x-1)^2$ and $y = x^2$

But there are many parabolas that fit to the points (0,0) and (1,1), or (0,1) and (1,0).

The name "Power" seems to imply Power in Sound, which would mean logarithms. I could imagine fitting logarithms into that, but perhaps it would be easier to just use 1-dipped. That is, $y = 1 - (x-1)^2$ and $y = 1 - x^2$

The fade/cut/cut could be cubic formulas, shifted upwards +0.5. So they'd be variations of $x^3 + 0.5$ stretched vertically/horizontally.

I'll get back to this when I'm less sleepy, heh.

-
1-dipped worked like a charm. I would still like to see your ideas on fade/cut/cut however. thanks. –  Aran Mulholland Sep 14 '10 at 11:13

I was wrestling with some of these same questions myself earlier and never really found completely solid answers for what makes a good curve. I can, however, share my functions which I wound up using. They're all constant-power ones, but with different levels of fade/cut.

To understand what makes a curve constant-power, you have to understand that the signal is a sound-pressure level signal and that power goes as sound pressure squared. So if we have input signal $w_1$ and $w_2$ and we're attenuating the signal by multiplying $w_1 \cdot f(x)$ and $w_2 \cdot f(1-x)$ then $f$ is constant-power if $f^2(x)+f^2(1-x) = 1$. So, in this case, the easiest way would be to make $f(x) = \cos(\frac{\pi}{2}x)$.

In fact, we can generalize this and say that any function $g$ with range [0,1] for domain [0,1] can be used to produce a constant-power crossfade function $f(x)=\cos(\frac{\pi}{2}g(x))$. However, it'll make the most sense if $g(0) = 0$, $g(0.5)=0.5$, $g(1)=1$, and $g$ is monotonic. With this in mind, I more looked at functions $h$ where $h(-1) = -1$, $h(0)=0$, and $h(1)=1$ and then just did a simple linear transform between [-1,1] and [0,1]. So, the first thing I tried was $h(x)=x^{2n+1}$ for non-negative integers n. This turned out to work quite well. $n=0$ gives the constant power curve you show above and then as I go to $n=1,3,10$ I get curves a lot like slow fade, slow cut, and fast cut (although not identical since these are all constant power). There's obviously a lot of room to adjust the sharpness by using other values for n.

So my final function is $f(x)=\cos(\frac{\pi}{4}((2x-1)^{2n+1}+1))$. As you can see from the graphs below, they're quite similar to slow fade, slow cut, and fast cut, except that the plateau in the middle is at about 0.7 (actually $\frac{1}{\sqrt{2}}$) rather than at 1 and the track which doesn't fall off rises to 1 at the outside edge. You might think that going down to 0.7 in the middle would have a big sound impact on the other track, but it really doesn't. Obviously, you could convert them into the exact functions by doing $\sqrt{2} \min(f(x),1/\sqrt{2})$. But I've tried them out in a software fader in Pure Data without doing that adjustment, and they sound pretty good to my ears. I was also happy because it meant that I could switch between the four different curves with only a single parameter so that keeps the logic simple.

Below: Curves for Constant Power (n=0), Constant Power Slow Fade (n=1), Constant Power Slow Cut (n=3), and Constant Power Fast Cut (n=10).

-
That's lovely stuff Keith –  Aran Mulholland Dec 29 '13 at 23:14
Thanks. I'm not sure whether or not it's still useful to you at this point or at the time I answered (I came across the question doing a google search for the same thing), but I put it up hoping that someone would find it useful eventually. –  Keith Irwin Dec 30 '13 at 16:23

For the slow fade may be you can take the Gaussian curve $y = e^{-x^{2}}$ and here is the diagram below.

And for the transition you could try $y=-|x|$.

-
could you explain how to do this in the range 0..1? –  Aran Mulholland Sep 14 '10 at 11:14
@Aran: Please see the figure: Dont take the negative side of the graph, that is from -1 to 0. –  anonymous Sep 14 '10 at 11:49