master
Leo Coogan 7 months ago
parent 95a8318553
commit ef950cf881
Signed by: lcoogan
GPG Key ID: 54DBD17B0D75ABB0

BIN
.DS_Store vendored

Binary file not shown.

@ -0,0 +1,9 @@
(
SynthDef(\apl, {
var sig;
sig = SinOsc.ar(\freq.ar(440));
Out.ar(0, sig);
}).add;
)

@ -0,0 +1,15 @@
{
var drive = 2; // change this to see effect
var x = Line.kr(-1, 1, 0.01); // simulate signal range
tanh(x * drive) / tanh(drive)
}.play;
(
{
var drive = 20; // Try values like 1, 5, 10, etc.
var sig = SinOsc.ar(220); // Your basic oscillator
var shaped = tanh(sig * drive) / tanh(drive); // Dividing normalizes it for some reason I don't understand
shaped * 0.1 // scale output to prevent clipping
}.plot;
)

@ -0,0 +1,27 @@
(
{
var modEnv = EnvGen.kr(Env.adsr(1, 0.5, 0.1, 0.5), doneAction: 2);
var modulator = SinOsc.ar(50) * 500 * modEnv;
var carrier = SinOsc.ar(200 + modulator) * 0.1;
carrier
}.play;
)
(
{
var dur = 1.5;
var gaussEnv = EnvGen.kr(
Env.new(
levels: [30, 60, 0],
times: [1, 3, 4],
curves: [-4, -20] // Negative curves for smoother, bell-shaped fade in/out
),
doneAction: 2
);
var modulator = SinOsc.ar(10) * 500 * gaussEnv;
var carrier = SinOsc.ar(10 + modulator) * 0.1;
carrier = RLPF.ar(carrier, 1e4, 0.1);
}.play;
)

@ -1,7 +1,11 @@
~terrain = Buffer.alloc(s, 1024, 1);
~terrain.sine1([1, 0.5, 0.3, 0.2, 0.1], true); // You can sculpt this more chaotically
~terrain.postln;
( (
// Generate a terrain table // Generate a terrain table
~terrain = Buffer.alloc(s, 1024, 1); ~terrain = Buffer.alloc(s, 1024, 1);
~terrain.sine1([1, 0.5, 0.3, 0.2, 0.1], true); // You can sculpt this more chaotically ~terrain.sine1([1, 0.3, 0.3, 0.2, 0.1], true); // You can sculpt this more chaotically
SynthDef("fm_pulsar_terrain", { SynthDef("fm_pulsar_terrain", {
arg a, e, f, d; arg a, e, f, d;
@ -38,7 +42,9 @@ SynthDef("fm_pulsar_terrain", {
a = Mix([ a = Mix([
SinOsc.ar(f), SinOsc.ar(f),
GrainBuf.ar(1, t, d, ~terrain, tblPos, carfreq, 0, 2) // GrainBuf.ar(1, t, d, ~terrain, tblPos, carfreq, 0, 2)
GrainBuf.ar(1, t, d, ~terrain, tblPos, carfreq);
// GrainBuf.ar(numChannels:1, trigger:0, dur:1, ~terrain, rate:1, pos:0, interp:2)
]); ]);
a = LeakDC.ar(a * e); a = LeakDC.ar(a * e);
@ -48,9 +54,10 @@ SynthDef("fm_pulsar_terrain", {
Out.ar(\outBus.kr(0), a.dup * \gain.kr(0.1)); Out.ar(\outBus.kr(0), a.dup * \gain.kr(0.1));
}).add; }).add;
)
Synth(\fm_pulsar_terrain); Synth(\fm_pulsar_terrain);
)

@ -0,0 +1,11 @@
{(SinOsc.ar(440) + SinOsc.ar(140)).dup * 0.1}.play;
{ (SinOsc.ar(440, 0) + SinOsc.ar(140, 0)).dup * 0.1 }.play;
(
{
var phasor = Phasor.ar(0, 40 / SampleRate.ir, 0, 1); // base phase
var sig = SinOsc.ar(0, phasor * 2pi) + SinOsc.ar(0, phasor * 2pi * (SinOsc.ar(640)));
sig.dup * 0.1
}.play;
)

@ -0,0 +1,41 @@
// A SynthDef without samples, using oscillators and generative modulation
(
SynthDef(\fellGenerative, { |out = 0, amp = 0.3, dur = 1, freq = 440|
var sig, env, osc1, osc2, noise, mod, freqMod, pan;
// Base oscillators
osc1 = SinOsc.ar(freq, 0, 0.5); // Sine wave oscillator 1
osc2 = Saw.ar(freq * 2, 0.3); // Saw wave oscillator 2
// Generate white noise
noise = WhiteNoise.ar(0.1);
// Frequency modulation with LFNoise1
freqMod = LFNoise1.kr(0.1).range(0.9, 1.1);
osc1 = osc1 * freqMod; // Modulate osc1's frequency slightly over time
// Envelope for smooth start and end of each sound
env = EnvGen.kr(Env.perc(0.01, dur), doneAction: 2);
// Pan modulation
pan = LFNoise1.kr(0.2).range(-1, 1); // Slow panning for stereo movement
// Combine the oscillators and noise into a timbre
sig = osc1 + osc2 + noise;
sig = sig * env * amp; // Apply amplitude envelope
// Output the sound with pan control
Out.ar(out, Pan2.ar(sqig, pan));
}).add;
)
// Generate a complex evolving pattern with rhythmic cycles and modulation
(
Pbind(
\instrument, \fellGenerative,
\amp, Pwhite(0.2, 0.6, inf), // Random amplitude
\freq, Pwhite(100, 1000, inf), // Random base frequencies
\dur, Pseq([0.3, 0.5, 1, 0.7], inf), // Rhythmic durations
\mod, Pwhite(0.2, 1.5, inf) // Random modulation depth for oscillators
).play;
)

@ -1,6 +1,6 @@
MIDIIn.connectAll; MIDIIn.connectAll;
~pulsar = 8388608; ~pulsar = 1056899563;
~mellotron = 8388611; ~mellotron = 8388611;
( (
@ -17,7 +17,7 @@ MIDIdef.noteOn(\noteOnTest_device1, {
if (src == ~pulsar, { if (src == ~pulsar, {
// Create a new synth for device 1 // Create a new synth for device 1
~notes[nn] = Synth.new( ~notes[nn] = Synth.new(
\wtable_vosc_dual_clean, [ \convolv, [
\freq, nn.midicps, \freq, nn.midicps,
\amp, vel.linexp(1,127,0.01,0.3), \amp, vel.linexp(1,127,0.01,0.3),
] ]

@ -0,0 +1,33 @@
(
{
var primes, interval, seq;
// Define a list of prime numbers
primes = [2, 3, 5, 7, 11, 13, 17, 19];
// Use primes to define a rhythmic pattern
seq = Pseq(primes, inf); // Repeat indefinitely
// Trigger a note every prime number of beats
Pbind(
\freq, 60.midicps,
\dur, seq,
\amp, 0.1
).play;
}.fork;
)
(
{
var primes, pitchSeq, sig;
primes = [2, 3, 5, 7, 11]; // List of primes
pitchSeq = Pseq(primes, inf).collect { |prime| 60 + prime }; // Map primes to pitch offsets
// Create a sequence of pitches based on the primes
Pbind(
\freq, pitchSeq.midicps,
\dur, 0.5,
\amp, 0.1
).play;
}.fork;
)

@ -0,0 +1,28 @@
~track = "/Users/lcoogan/Music/Musicians/Xiu Xiu/01-xiu_xiu-sad_pony_guerilla_girl-sge.opus".standardizePath; ~bpm=116.6;
~track = "/Users/lcoogan/Music/Musicians/Broadcast/broadcast - tender buttons (2005)/05 - Tears in the Typing Pool.opus".standardizePath; ~bpm=145.1;
~looplen = 480/~bpm;
b = Buffer.cueSoundFile(s, ~track, 0, 2);
x = { DiskIn.ar(2, b) }.play;
// Now the thing that will attempt to separate them out again (inc a buffer for it to use):
~loopbuf = Buffer.alloc(s, 1000, 513);
(
y = { |which=1, active=1, thresh=1|
var son = In.ar(0);
var chain = FFT(LocalBuf(1024), son);
chain = PV_ExtractRepeat(chain, ~loopbuf, ~looplen, memorytime:30, which:which, thresh:thresh);
ReplaceOut.ar(0, Select.ar(active, [son, IFFT(chain)]).dup);
}.play(x, addAction: \addAfter);
)
y.set(\which, 0) // focus on the nonrepeating bit
y.set(\which, 1) // focus on the repeating bit
y.set(\active, 0) // back to normal
y.set(\active, 1) // filter it again
y.set(\which, 0, \thresh, 1.5) // trying a higher threshold
y.free;
x.free;
b.close

@ -0,0 +1,39 @@
~track = "/Users/lcoogan/Music/Musicians/Xiu Xiu/01-xiu_xiu-sad_pony_guerilla_girl-sge.opus".standardizePath;
~track = "/Users/lcoogan/Music/Musicians/Suicide/1977 - Suicide [1998 Reissue]/01 Ghost Rider.opus".standardizePath;
~bpm = 191;
~track = "/Users/lcoogan/Music/Musicians/My Bloody Valentine/Loveless/05 When You Sleep.opus".standardizePath;
~bpm = 90;
~bpm = 116.6;
~looplen = 480 / ~bpm;
~track = "/Users/lcoogan/Music/Musicians/Broadcast/broadcast - tender buttons (2005)/05 - Tears in the Typing Pool.opus".standardizePath; ~bpm=145.1;
b = Buffer.cueSoundFile(s, ~track, 0, 2);
x = { DiskIn.ar(2, b) }.play;
~loopbuf = Buffer.alloc(s, 1000, 513); // Make sure loopbuf is allocated
(
y = { |which=1, active=1, thresh=1|
var son = In.ar(0);
var chain = FFT(LocalBuf(1024), son);
chain.postln; // Debug: Check the FFT output
chain = PV_ExtractRepeat(chain, ~loopbuf, ~looplen, memorytime:30, which:which, thresh:thresh);
ReplaceOut.ar(0, Select.ar(active, [son, IFFT(chain)]).dup);
}.play(x, addAction: \addAfter);
)
y.set(\which, 0) // Focus on non-repeating part
y.set(\which, 1) // Focus on repeating part
y.set(\active, 0) // Switch back to original signal
y.set(\active, 1) // Apply filter
y.set(\which, 0, \thresh, 1.5) // Try a higher threshold
y.free;
x.free;
b.close;

@ -0,0 +1,31 @@
(
SynthDef(\voiceEvolving, {
arg out=0, bufnum, amp=0.5, windowSize=1024;
var in, chain, sig;
var smearAmt, shiftAmt, wipeTrig;
in = PlayBuf.ar(1, bufnum, BufRateScale.kr(bufnum), loop: 1);
// FFT processing
chain = FFT(LocalBuf(windowSize), in);
// Slowly changing modulation sources
smearAmt = LFNoise1.kr(0.1).range(5, 50); // how smeared the spectrum is
shiftAmt = LFNoise1.kr(0.07).range(-30, 30); // shifting bins in pitch space
wipeTrig = Dust.kr(0.3); // occasional spectral dropouts
// PV mutations
chain = PV_MagSmear(chain, smearAmt);
chain = PV_BinShift(chain, shiftAmt);
chain = PV_RandWipe(chain, wipeTrig);
sig = IFFT(chain) * amp;
// Optional: gentle filtering
sig = LPF.ar(sig, 1000);
Out.ar(out, sig.dup);
}).add;
)
Synth(\voiceEvolving, [\bufnum, b, \amp, 0.4]);

@ -2,7 +2,7 @@
// Run once to convert and resample wavetable files // Run once to convert and resample wavetable files
var paths, file, data, n, newData, outFile; var paths, file, data, n, newData, outFile;
paths = PathName("/home/lcoogan/snd/wtables/AKWF").deepFiles.select { |f| paths = PathName("/Users/lcoogan/snd/wtables/AKWF").deepFiles.select { |f|
f.extension == "wav" f.extension == "wav"
}; };

Loading…
Cancel
Save