b = Buffer.read(s, "/home/lcoogan/snd/live/2025-04-26.Basic_City_Brewery/trax/04-Cantor_Samuel_Malavsky_Zechor.wav");
b.play;

b = Buffer.read(s, "/home/lcoogan/Music/Musicians/My Bloody Valentine/Loveless/02 Loomer.wav");


b = Buffer.read(s, "/home/lcoogan/Misc/my_grave.wav");

c = Buffer.read(s, "/home/lcoogan/Misc/loomer.wav");
b = Buffer.read(s, "/home/lcoogan/snd/releases/desolation-mountain/out.wav");


(
SynthDef(\brickwall, {
    arg out=0, bufnum, fftSize=4096;
	var source, chain, sig, noise;
	//
    source = PlayBuf.ar(1, b, loop: 0, doneAction: 2);
	//
	chain = FFT(LocalBuf(fftSize), source);
	chain = PV_BrickWall(chain, -0.95);
	chain = PV_BrickWall(chain, 0.035);
	// chain= PV_BrickWall(chain, Line.kr(-1,0,10));


	// chain = PV_BinDelay(chain, 0.01, 0.01, chain, chain, 0.5);
	// chain = PV_BinScramble(chain, 0.1, 0.2, SinOsc.kr(1));
	// chain = PV_BrickWall(chain, -0.99);
	// chain = PV_ConformalMap(chain, 0.1, Phasor.kr(8));
	// chain = PV_Conj(chain);
	// chain = PV_Whiten(chain, b, 0.01, 0.5, Dust.kr(1), Dust.kr(0.5));
	chain = PV_MagAbove(chain, 10);

	// chain= chain.pvcollect(b.numFrames,{|mag, phase, index|
	// 	noise= LFNoise1.kr(rrand(0.5,1.1));
	// 	[noise*mag,noise.range(-pi,pi)]
	//
	// 	},
	//
	// frombin:0, tobin:10,zeroothers:1);



	// chain = PV_MagBelow(chain, 40);

	// chain = PV_LocalMax(chain, 4);

	// chain = PV_MagSmear(chain, 4);

	sig = IFFT(chain);

	// sig = BPF.ar(sig, 4000, 0.1);

	/*sig = GVerb.ar(sig, 299, 4, 1, 0.5, 30, 1, 0.1, 0.5);
	sig = Splay.ar(sig, 4);*/


	Out.ar(out, sig.dup);

}).play;
)
