b = Buffer.read(s, "/home/lcoogan/snd/live/2025-04-26.Basic_City_Brewery/trax/01-Cantor_Samual_Malavsky_Shomea_Kol_Bichios.wav");
b = Buffer.read(s, "/home/lcoogan/snd/live/2025-04-26.Basic_City_Brewery/trax/06-Cantor_Zevulun_Zavel_Kwartin_sings_Tiher.wav");
b = Buffer.read(s, "/home/lcoogan/Music/Musicians/My Bloody Valentine/Loveless/05 When You Sleep.opus");


(
// PV_BrickWall
SynthDef(\pv_pv_brickwall, {
    var sig = PlayBuf.ar(1, b, BufRateScale.kr(b), loop: 1);
    var chain = FFT(LocalBuf(2048), sig);
	chain = PV_BrickWall(chain, SinOsc.ar(10.1) + SinOsc.kr(0.1)); // 10 and 0.1 ar the inputs
    Out.ar(0, IFFT(chain).dup * 0.5);
}).add;
)

// To play:
x = Synth(\pv_pv_brickwall); // yes



// Interesting resonance
(
// PV_Freeze
SynthDef(\pv_pv_freeze, {
    var sig = PlayBuf.ar(1, b, BufRateScale.kr(b), loop: 1);
    var chain = FFT(LocalBuf(1024), sig);
	chain = PV_Freeze(chain,  MouseY.kr > 0.5); // 0.5 is the input
    Out.ar(0, IFFT(chain).dup * 0.5);
}).add;
)

// To play:
x = Synth(\pv_pv_freeze); // yes




(
// PV_MagGate
SynthDef(\pv_pv_maggate, {
    var sig = PlayBuf.ar(1, b, BufRateScale.kr(b), loop: 1);
    var chain = FFT(LocalBuf(1024), sig);
	chain = PV_MagGate(chain, MouseX.kr(0,100), MouseY.kr(0, 1));
    Out.ar(0, IFFT(chain).dup * 0.5);
}).add;
)

// To play:
x = Synth(\pv_pv_maggate); // yes



(
// PV_MagShift
SynthDef(\pv_pv_magshift, {
    var sig = PlayBuf.ar(1, b, BufRateScale.kr(b), loop: 1);
    var chain = FFT(LocalBuf(1024), sig);
    chain = PV_MagShift(chain, 1, MouseX.kr(-128, 128) );
    Out.ar(0, IFFT(chain).dup * 0.5);
}).add;
)

// To play:
x = Synth(\pv_pv_magshift); // yes



(
// PV_MagSmear
SynthDef(\pv_pv_magsmear, {
    var sig = PlayBuf.ar(1, b, BufRateScale.kr(b), loop: 1);
    var chain = FFT(LocalBuf(1024), sig);
	chain = PV_MagSmear(chain, MouseX.kr(0, 100));
    Out.ar(0, IFFT(chain).dup * 0.5);
}).add;
)

// To play:
x = Synth(\pv_pv_magsmear);  // yes




(
// PV_RectComb
SynthDef(\pv_pv_rectcomb, {
    var sig = PlayBuf.ar(1, b, BufRateScale.kr(b), loop: 1);
    var chain = FFT(LocalBuf(2048), sig);
        chain = PV_RectComb(chain,  MouseX.kr(0, 32), MouseY.kr, 0.2);
	Out.ar(0, IFFT(chain).dup * 0.5);
}).add;
)

// To play:
x = Synth(\pv_pv_rectcomb); // yes

