From ca97c53441be4d337a09c8d242a0e97b03aa6fe2 Mon Sep 17 00:00:00 2001 From: Eugene Petkevich Date: Mon, 9 May 2022 22:41:09 +0300 Subject: [PATCH] Live in forest --- server.scd | 1 + test.scd | 4 +- test2.scd | 203 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 206 insertions(+), 2 deletions(-) create mode 100644 test2.scd diff --git a/server.scd b/server.scd index c333534..829242f 100644 --- a/server.scd +++ b/server.scd @@ -1,4 +1,5 @@ ( +//s.options.outDevice = "MA WFRIENDZ"; s.options.maxNodes = 128 * 1024; s.options.maxSynthDefs = 32 * 1024; s.options.memSize = 1024 * 1024; diff --git a/test.scd b/test.scd index 4e2a277..3ed9a42 100644 --- a/test.scd +++ b/test.scd @@ -226,7 +226,7 @@ try { Exception.new().throw; ret = 1; } { ret = 2 }; ~se2.stopRec; ~se2.shiftPos(0.05); -~se2.duration = ~se.duration - 0.05; +~se2.duration = ~se.duration - 1; ~se2.playSample; Scale Tuning.directory @@ -281,7 +281,7 @@ Pdef(\samia, ~se.makeSynthBind <> Pbind( \timingOffset, 0, )).quant_(4).stop; ) -[1, 2] +.t [0, 3] + ( Pdef(\samei, ~se2.makeSynthBind <> Pbind( \scale, ~scale, diff --git a/test2.scd b/test2.scd new file mode 100644 index 0000000..a4dd2fd --- /dev/null +++ b/test2.scd @@ -0,0 +1,203 @@ +// trying varios scales + +~tun = Tuning.new((0..12).collect(_ * (12*(3 ** (1/13)).log2)), 3, "tritave"); +~scale = Scale.chromatic(~tun); + +( +SynthDef(\sibino, { | + out=0, gate=1, freq=440, modFreq=440, amp=1, release=1.0, maxIndex=1 + | + var sig, modIndex, env; + env = EnvGen.ar(Env.asr(releaseTime: release), gate, doneAction: 2); + modIndex = (1 - env) * maxIndex; + sig = PMOsc.ar(freq, modFreq, modIndex, mul: amp); + sig = sig * env; + sig = Pan2.ar(sig, Rand(-0.3, 0.3)); + Out.ar(out, sig * amp); +}).add; +) + +( +SynthDef(\sidrub, { + | out=0, gate=1, freq=440, amp=1, cut=800, rez=0.8, + modFreqMin=7, modFreqMax=12, modAmp=0.01, sustain=1.0 | + var sig = 0; + var modFreq = SinOsc.kr(Rand(modFreqMin, modFreqMax), 0, modAmp, 1); + sig = sig + Pulse.ar(freq * modFreq); + sig = RLPF.ar(sig, cut.lag(0.01), rez.lag(0.01)); + sig = sig * EnvGen.ar(Env.perc(releaseTime: sustain), gate, doneAction: 2); + sig = Pan2.ar(sig, Rand(-0.3, 0.3)); + Out.ar(out, sig * amp); +}).add; +) + +( +SynthDef(\siruse, { | gate = 1, freq = 55, amp=1, out=0 | + var sig = AnalogBassDrum.ar( + gate, + infsustain: 1, + accent: 0.9, + freq: freq, + tone: 0.7, + decay: 0.15, + attackfm: 0.31, + selffm: 0.15, + ); + sig = sig * EnvGen.ar(Env.adsr(0.01, 0.2, 0.9, 0.25), gate, doneAction: 2); + sig = Pan2.ar(sig, 0); + Out.ar(out, sig * amp); +}).add; +) + +( +Pdef(\nodi, Pbind( + \instrument, \sibino, + \scale, ~scale, + \octave, 5, + \modFreq, Pexprand(1, 1000, inf), + \maxIndex, Plprand(1, 20, inf), + \note, Pwrand([ + Pseq([0, 3, 5, 3], 1), + Pseq([0, 3, 7, 2], 1), + Pseq([3, 7, 5, 2], 1), + ], + [1, 1, 1].normalizeSum, inf), + \db, -4, + \dur, 1, + \legato, 0.2, +)).quant_(4).stop; +) + +( +Pdef(\nosa, Pbind( + \instrument, \sibino, + \scale, ~scale, + \octave, 6, + \modFreq, Pexprand(1, 1000, inf), + \maxIndex, Plprand(1, 20, inf), + \note, Pwrand([ + Pseq([0, 3, 8, 2], 1), + Pseq([0, 3, 7, 2], 1), + Pseq([3, 10, 5, 2], 1), + ], + [1, 1, 1].normalizeSum, inf), + \db, -7, + \dur, 4 * Pwrand([ + Pseq([1, 1, 1, 1].normalizeSum, 1), + Pseq([3, 3, 2, 3].normalizeSum, 1), + Pseq([2, 1, 2, 4].normalizeSum, 1), + ], + [1, 1, 1].normalizeSum, inf), + \legato, 0.6, +)).quant_(4).stop; +) + +( +Pdef(\noen, Pbind( + \instrument, \sidrub, + \scale, ~scale, + \octave, 3, + \note, Prand([0, 3, 5], inf), + \cut, Pwhite(100, 4000, inf), + \rez, Pwhite(0.2, 0.8, inf), + \db, -5, + \dur, Prand([ + Pseq([1], 1), + Pseq([1, 1].normalizeSum, 1), + Pseq([1, 1, 1, 1].normalizeSum, 1), + ], inf), + \legato, 0.7, +)).quant_(4).stop; +) + +( +Pdef(\noci, Pbind( + \instrument, \sidrub, + \scale, ~scale, + \octave, 2, + \note, Prand([0, 3, 5], inf), + \cut, Pwhite(100, 4000, inf), + \rez, Pwhite(0.2, 0.8, inf), + \db, -10, + \dur, Prand([ + Pseq([1], 1), + Pseq([1, 1].normalizeSum, 1), + Pseq([1, 1, 1, 1].normalizeSum, 1), + ], inf), + \legato, 2, +)).quant_(4).stop; +) + +( +Pdef(\noni, Pbind( + \instrument, \siruse, + \scale, ~scale, + \octave, [3, 4], + \note, Prand([0], inf), + \db, -1, + \dur, 4, + \legato, 0.1, +)).quant_(4).stop; +) + +( +// tania vocal +Pdef(\vocal, ~se2.makeSynthBind <> Pbind( + \scale, ~scale, + \octave, 5, + \note, Pxrand([0, 1, 2, -3, -5], inf), + \dur, 16, + \db, 3, + \timingOffset, -2, +)).quant_(4).stop; +) + +( +// tania vocal +Pdef(\vocal2, ~se3.makeSynthBind <> Pbind( + \scale, ~scale, + \octave, 5, + \note, Pxrand([0, 1, 2, -3, -5], inf), + \dur, 1/2 * Prand([1, 3, 2, 4, 3], inf), + \db, -18, + \timingOffset, 0, +)).quant_(4).stop; +) + +( +// axe sound +Pdef(\vocal3, ~se4.makeSynthBind <> Pbind( + \scale, ~scale, + \octave, 4, + \note, Pxrand([5, 4, 6], inf), + \dur, 1 * Prand([4], inf), + \db, -15, + \timingOffset, -0.2, +)).quant_(4).stop; +) + +TempoClock.tempo = 160 / 60; + +~se3 = ~samplerFactory.value; + +( +//(note: 9, octave: 5).play; +~se3.startRec; +) +~se3.stopRec; + +~se3.shiftPos(0.05); +~se3.duration = ~se.duration - 1; +~se3.playSample; + + +~se4 = ~samplerFactory.value; +( +//(note: 9, octave: 5).play; +~se4.startRec; +) +~se4.stopRec; + +~se4.shiftPos(-0.05); +~se4.duration = ~se4.duration - 1; +~se4.playSample; \ No newline at end of file -- 2.17.1