Modify gen~ crossover example

nouserid's icon

Hello,

I'm trying to modify this gen~ crossover filter patch to have 5 bands instead of 3 but I'm struggling to make sense of it. Any help would be very much appreciated.

Max Patch
Copy patch and select New From Clipboard in Max.

Graham Wakefield's icon

The basic trick with crossovers is that for each split, any additional channels need matching allpass filters to keep their phase relationships the same. That's why in that patch there's an additional allpass stage to keep the already-split "high" signal in phase with the newly-split "low" and "mid".

If you have the GO book there's another example of a 3-stage crossover using trapezoidal 2-pole filters, and it does the same thing.

In short:

the input goes into a 2x onepole LP sequence to get the a lowpassed version, call it L1. The same input is passed through a matched allpass filter (call it A1), and we get a high pass H1 from A1-L1. That's the first stage. Then the second stage does this all again to L1: pass L1 through 2x onepole LP to get L2, pass L1 through a matching allpass for A2, and derive a highpass M2 as A2-L2. Now M2 is our "mid" signal, because it is the highpass of the lowpassed L1. But we can't use H1 as our "high" signal because it is now out of phase with L2 and M2. So we pass H1 through another matched allpass to fix the phases, and that's our high output H2.

You can just keep cascading more of these sections -- being sure that everytime you apply a 2x lowpass onepole to a signal, you apply a matching allpass to all the other signals at that stage.

Using 2x onepole + 1x allpass isn't the only way to split the signal, often folks cascade 2x butterworth biquad filters for this for deeper crossover transitions (4 pole).

nouserid's icon

Wicked! Thanks so much, Graham.

I do have the book, will have a look now.

nouserid's icon

Got it working! Can I send you money for a treat as a thank you?

nouserid's icon

Hmm, so the phase correction with the allpass filters makes sense to me now but I'm still struggling with properly splitting the bands with new filters and keeping the additional cutoff frequency inlets working with the others. I've been glued to the computer trying to figure it out but my brain is melting.

nouserid's icon

Here's where I'm at. Seems close but not quite right.

Max Patch
Copy patch and select New From Clipboard in Max.

Graham Wakefield's icon

It looks like you're outputting from the highpass at each stage, but I think you might want to try outputting from each lowpass instead (except for out 5)?

Also the LP1 stage needs allpasses on it to compensate for the subsequent stages.

I think it should be:

[out 1 low] = LP1 -> AP2 -> AP3 -> AP4

HP1 = AP1-LP1

[out 2 midlow] = HP1 -> LP2 -> AP3 -> AP4

HP2 = HP1->AP2 - HP1->LP2

[out 3 mid] = HP2 -> LP3 -> AP4

HP3 = HP1->HP2->AP3 - HP1->HP2->LP3

[out 4 midhi] = HP3 -> LP4

HP4 = HP1->HP2->HP3->AP4 - HP1->HP2->HP3->LP4

[out 5 hi] = HP4

nouserid's icon

Ok, thanks for the direction! Trying now.

nouserid's icon

I think we're good now. You helped me out big time, Graham. Thanks again.

Here's the filter if anyone wants to have a look.

Max Patch
Copy patch and select New From Clipboard in Max.

nouserid's icon

Hello again, I have another question if it's alright. What would be the best way to add a filter steepness function? Would it be as simple as adding or removing stages to the lowpass filter subpatch or would that totally mess everything up?

Roman Thilenius's icon

on one hand: to get from 12 to 24 db, just double all the filter building blocks.

on the other hand: 90+90=180... the optimal layout for a crossover with 6, 18 or 24 db would look different from the original linkwitz riley scheme with 12.

(as far as i can tell, this is not the case for 12db vs. 36db)

for both gen~ and MSP it is probably best to create separate patches.

nouserid's icon

Thanks Roman! I'll give it a try at 36db and see how we go.