From b6d05ace47962b5e25819b08f6b5015f34dae956 Mon Sep 17 00:00:00 2001 From: Leo Coogan Date: Mon, 14 Jul 2025 14:29:36 -0400 Subject: [PATCH] random stuff --- convolution.scd | 12 ++++++++++-- granular.scd | 6 +++++- nes.scd | 12 ++++++++++++ wavesegment.scd | 27 ++++++++++++++++++++++++++ wavesegment_fvoc.scd | 46 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 nes.scd create mode 100644 wavesegment.scd create mode 100644 wavesegment_fvoc.scd diff --git a/convolution.scd b/convolution.scd index 7e9a684..a19711d 100644 --- a/convolution.scd +++ b/convolution.scd @@ -3,6 +3,13 @@ s.boot; ~irB = Buffer.read(s, "/home/lcoogan/snd/samples/freesound/vocals/ymaaela/fvocal.wav"); ~irA.play; +~irA = Buffer.read(s, "/home/lcoogan/snd/ir/cantorial-granular/cantorial-ir.01s.wav"); +~irB = Buffer.read(s, "/home/lcoogan/snd/ir/cantorial-granular/cantorial-ir.05s.wav"); + +b.play; + +b = Buffer.read(s, "/home/lcoogan/snd/releases/cantorial-resynthesis/wav/Cantor Samuel Malavsky Zechor [531eF9Py_a0].wav"); + 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"); @@ -34,7 +41,7 @@ SynthDef(\convolvCrossfade, { 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); + Out.ar(0, (convA + convB).dup); }).add; ) @@ -57,6 +64,7 @@ SynthDef(\convolvCrossfadeLFO, { 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); @@ -75,6 +83,6 @@ SynthDef(\convolvCrossfadeLFO, { x = Synth(\convolvCrossfadeLFO, [\lfoFreq, 0.1]); // very slow modulation x.set(\lfoFreq, 0.1); -x.set(\lfoFreq, 9); // faster modulation +x.set(\lfoFreq, 100); // faster modulation s.record; diff --git a/granular.scd b/granular.scd index b6ea627..cad6328 100644 --- a/granular.scd +++ b/granular.scd @@ -1,5 +1,9 @@ ~klezmer = "/home/lcoogan/snd/live/2025-04-26.Basic_City_Brewery/granular/Cantorial/Acheinu_Kol_Beit_Israel.wav" +~klezmer = "/home/lcoogan/snd/releases/cantorial-resynthesis/wav/Cantor Mordechai Hershman Baruch Hashem Bayom [L3VASTL4irk].wav"; + +b = Buffer(s, "/home/lcoogan/snd/releases/cantorial-resynthesis/wav/Cantor Mordechai Hershman Baruch Hashem Bayom [L3VASTL4irk].wav"); + ( { var sig; @@ -7,7 +11,7 @@ 1, Impulse.ar(2), 1, - ~klezmer, + b, 1, 1.2, 1, diff --git a/nes.scd b/nes.scd new file mode 100644 index 0000000..ae07ace --- /dev/null +++ b/nes.scd @@ -0,0 +1,12 @@ +( +{ + + var freq = 440; + var pulse = LFPulse.ar(freq, 0, 0.5); + var env = EnvGen.kr(Env.perc(0.01, 0.5), doneAction: 2); + (pulse * env * 0.2).dup +}.play; +) + + + diff --git a/wavesegment.scd b/wavesegment.scd new file mode 100644 index 0000000..089c97d --- /dev/null +++ b/wavesegment.scd @@ -0,0 +1,27 @@ +( +s.waitForBoot { + ~buf1 = Buffer.read(s, "/home/lcoogan/snd/samples/freesound/vocals/ymaaela/333264__ymaaela__female-vocal-cut-ups-collage.mono.wav"); + ~buf2 = Buffer.read(s, "/home/lcoogan/snd/samples/freesound/vocals/ymaaela/attribution/330909__ymaaela__discordant-clip.mono.wav"); + + SynthDef(\crossfadeBuf, { |out=0, buf1, buf2, crossfade=0, rate=1| + var sig1 = PlayBuf.ar(1, buf1, rate * BufRateScale.kr(buf1), loop: 1); + var sig2 = PlayBuf.ar(1, buf2, rate * BufRateScale.kr(buf2), loop: 1); + var mix = XFade2.ar(sig1, sig2, (crossfade * 2) - 1); + Out.ar(out, mix ! 2); + }).add; + + s.sync; + + ~synth = Synth(\crossfadeBuf, [\buf1, ~buf1.bufnum, \buf2, ~buf2.bufnum]); + + // Create a routine to update crossfade randomly every ~1 second with smooth transitions + Routine({ + loop { + var target = rrand(0.0, 1.0); // random target crossfade between 0 and 1 + // Smoothly glide to the new target over 1 second + ~synth.set(\crossfade, target, \lag, 1); + 1.wait; // wait 1 second before choosing a new target + } + }).play; +}; +) diff --git a/wavesegment_fvoc.scd b/wavesegment_fvoc.scd new file mode 100644 index 0000000..d484ca2 --- /dev/null +++ b/wavesegment_fvoc.scd @@ -0,0 +1,46 @@ +( +s.waitForBoot { + ~buf1 = Buffer.read(s, "/home/lcoogan/snd/samples/freesound/vocals/ymaaela/333264__ymaaela__female-vocal-cut-ups-collage.mono.wav"); + ~buf2 = Buffer.read(s, "/home/lcoogan/snd/samples/scarlett/clickin.mono.wav"); + ~buf3 = Buffer.read(s, "/home/lcoogan/snd/samples/scarlett/scarlett singing.mono.wav"); + + SynthDef(\crossfade3Buf, { |out=0, buf1, buf2, buf3, gain1=1, gain2=0, gain3=0, rate=1.2| + var sig1 = PlayBuf.ar(1, buf1, rate * BufRateScale.kr(buf1), loop: 1); + var sig2 = PlayBuf.ar(1, buf2, rate * BufRateScale.kr(buf2), loop: 1); + var sig3 = PlayBuf.ar(1, buf3, rate * BufRateScale.kr(buf3), loop: 1); + + var mix = sig1 * gain1 + sig2 * gain2 + sig3 * gain3; + + mix = GVerb.ar(mix, damping:1); + Out.ar(out, mix ! 2); + }).add; + + s.sync; + + ~synth = Synth(\crossfade3Buf, [ + \buf1, ~buf1.bufnum, + \buf2, ~buf2.bufnum, + \buf3, ~buf3.bufnum, + \gain1, 0, + \gain2, 0, + \gain3, 1 + ]); + + Routine({ + var prevGains = [1.0, 0.0, 0.0]; + loop { + var newGains = Array.fill(3, { rrand(0.0, 1.0) }); + var sum = newGains.sum; + newGains = newGains.collect { |g| g / sum }; // normalize gains to sum to 1 + + // Smoothly interpolate each gain from prev to new over 1 second using \lag + ~synth.set(\gain1, newGains[0], \lag, 0); + ~synth.set(\gain2, newGains[1], \lag, 0); + ~synth.set(\gain3, newGains[2], \lag, 0); + + prevGains = newGains; + 0.1.wait; + } + }).play; +}; +)