You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2 KiB
Plaintext

~irA = Buffer.read(s, "/home/lcoogan/snd/samples/convolution/ir_chunks/ir_chunk_000.wav");
~irB = Buffer.read(s, "/home/lcoogan/snd/samples/freesound/vocals/ymaaela/fvocal.wav");
~ir.play;
b = Buffer.read(s, "/home/lcoogan/snd/live/2025-04-26.Basic_City_Brewery/harm/01 Ritual for Harmonica.wav", bufnum:0);
b = Buffer.read(s, "/home/lcoogan/Misc/grave.wav");
b = Buffer.read
b = Buffer.read(s, "/home/lcoogan/snd/live/2025-04-26.Basic_City_Brewery/trax/01-Cantor_Samual_Malavsky_Shomea_Kol_Bichios.wav");
(
SynthDef(\convolvCrossfade, {
var sig, convA, convB, mix;
sig = PlayBuf.ar(1, b, 1, loop: 0, doneAction: 2);
// Run both convolutions
convA = Convolution2.ar(sig, ~irA.bufnum, 512);
convB = Convolution2.ar(sig, ~irB.bufnum, 512);
// Crossfade using mix control (-1 to 1)
mix = \mix.kr(0.0); // -1 = only A, 0 = 50/50, 1 = only B
convA = convA * ((1 - mix) * 0.5); // scales from 1 to 0 as mix goes from -1 to 1
convB = convB * ((1 + mix) * 0.5); // scales from 0 to 1 as mix goes from -1 to 1
Out.ar(0, (convA + convB).dup * 0.1);
}).add;
)
x = Synth(\convolvCrossfade, [\mix, 0.0]); // 50/50 blend
x.set(\mix, -1.0); // Only IR A
x.set(\mix, 1.0); // Only IR B
x.set(\mix, 0.5); // Mostly IR B