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");

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

b = Buffer.read(s, "/home/lcoogan/snd/releases/2025.05.10-Mothers_Day/rem.wav");


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


	// chain = PV_BinDelay(chain, 0.1, 0.01, chain, chain, 0.5);
	// chain = PV_BinDelay(b,);
	// 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, Line.kr(30, 40, 1));
	//
/*	chain= chain.pvcollect(b.numFrames,{|mag, phase, index|
		// noise= LFNoise1.kr(rrand(0.5,1.1));
		noise = WhiteNoise.kr(2);
		[noise*mag,noise.range(-pi,pi)]

		},
	//
	frombin:80, tobin:100,zeroothers:0);*/



	// chain = PV_MagBelow(chain, 10);

	chain = PV_LocalMax(chain, SinOsc.kr(440, SinOsc.kr(1)));

	// chain = PV_MagSmear(chain, Line.kr(0, 100, 1, SinOsc.kr(440)));

	sig = IFFT(chain);

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

	// sig = Resonz.ar(sig, 200, 1);
	// sig = BHiShelf.ar(sig, 10000, 1);

	/*sig = BHiShelf.ar(
    sig,
		18000,
		1,
    6, // db
    3); // mul*/
	// sig = RLPF.ar(sig, 2000, 1, -1);

	sig = GVerb.ar(sig, 299, 4, 1, 0.5, 30, 1, 0.1, 0.5);
	sig = Splay.ar(sig, 4);
	sig = PitchShift.ar(sig, Line.kr(0.5, 1.0, 0.65, Line.kr(0, 3, 4)), 2.0, 0.0, 0.0, 1.0, 0 );
	sig = LPF.ar(sig, 800);
	// sig = PitchShift.ar(sig, 0.1, 0.4, 0.2, 3);


	Out.ar(out, sig.dup);

}).play;
)
