NestedAllpassN, NestedAllpassL, NestedAllpassC
DoubleNestedAllpassN, DoubleNestedAllpassL, DoubleNestedAllpassC

Nested Allpass filters as proposed by Vercoe and Pluckett

NestedAllpassN.ar(in, maxdel1, delay1, gain1, maxdel2, delay2, gain2);
DoubleNestedAllpassN.ar(in, maxdel1, delay1, gain1, maxdel2, delay2, gain2, maxdel3, delay3, gain3);

Useful for reverberation, especially implementing Gardner reverbs.

(
Instr([\reverb, \gardnerS], {|chan=2, in|
	var lp, fb, ap1, ap2, revout;
	fb=LocalIn.ar(chan);
	lp=LPF.ar(in, 6000);
	lp=DelayL.ar(lp, 0.024, 0.024);
	ap1=DoubleNestedAllpassL.ar(lp + (0.5 * fb));
	ap2=NestedAllpassL.ar(ap1);
	revout=ap1 * 0.5 + (ap2 * 0.6);
	LocalOut.ar(BPF.ar(revout * 0.5, 1600, 0.5));
	revout
});

Instr([\reverb, \gardnerM], {|chan=2, in|
	var lp, fb, ap1, ap2, ap3, revout;
	fb=LocalIn.ar(chan);
	lp=LPF.ar(in, 6000);
	ap1=DoubleNestedAllpassL.ar(lp + (0.5 * fb), 0.0047, 0.0047, 0.25, 0.0083, 0.0083, 0.35, 0.022, 0.022, 0.45);
	ap2=AllpassL.ar(DelayL.ar(ap1, 0.005, 0.005), 0.03, 0.03, 0.25952);
	ap2=DelayL.ar(ap2, 0.067, 0.067);
	ap3=NestedAllpassL.ar(lp + DelayL.ar(ap2, 0.015, 0.015, 0.4), 0.0292, 0.0292, 0.25, 0.0098, 0.0098, 0.35);
	revout=Mix.ar([ap1, ap2, ap3]) * 0.5;
	LocalOut.ar(BPF.ar(revout * 0.4, 1000, 0.5));
	revout
});

Instr([\reverb, \gardnerL], {|chan=2, in|
	var lp, fb, ap1, ap2, ap3, ap4, revout;
	lp=LPF.ar(in, 4000);
	fb=LocalIn.ar(chan);
	ap1=AllpassL.ar(lp + (0.5 * fb), 0.008, 0.008, 0.0459);
	ap2=AllpassL.ar(ap1, 0.012, 0.012, 0.06885);
	ap2=DelayL.ar(ap2, 0.004, 0.004);
	ap3=NestedAllpassL.ar(DelayL.ar(ap2, 0.017, 0.017), 0.025, 0.025, 0.5, 0.062, 0.062, 0.25);
	ap3=DelayL.ar(ap3, 0.031, 0.031);
	ap4=DoubleNestedAllpassL.ar(DelayL.ar(ap3, 0.003, 0.003), 0.120, 0.120, 0.5, 0.076, 0.076, 0.25, 0.030, 0.030, 0.25);
	revout=Mix.ar([ap4 * 0.8, ap3 * 0.8, ap2 * 1.5]);
	LocalOut.ar(BPF.ar(revout * 0.5, 1000, 0.5));
	revout
});
)

(
{ 
	var sig, rev;
	sig=Splay.arFill(8, { FSinOsc.ar(ExpRand(120, 850)).squared * Decay2.ar(Dust.ar(2), 0.02, 0.1, 0.3) });
	rev=Instr.ar([\reverb, \gardnerS], [2, sig]);
	0.5 * rev + sig
}.play
)

(
{ 
	var sig, rev;
	sig=Splay.arFill(8, { FSinOsc.ar(ExpRand(120, 850)).squared * Decay2.ar(Dust.ar(2), 0.02, 0.1, 0.3) });
	rev=Instr.ar([\reverb, \gardnerM], [2, sig]);
	0.5 * rev + sig
}.play
)

(
{ 
	var sig, rev;
	sig=Splay.arFill(8, { FSinOsc.ar(ExpRand(120, 850)).squared * Decay2.ar(Dust.ar(2), 0.02, 0.1, 0.3) });
	rev=Instr.ar([\reverb, \gardnerL], [2, sig]);
	0.5 * rev + sig
}.play
)