--- /dev/null
+
+TempoClock.tempo = 240 / 60;
+
+~beri = ~bcrFactory.value;
+
+(
+~curNote = 60;
+~steps = (0..15);
+~intervalWeights = [1]++(0!15);
+~freqHigh = 3200;
+~freqLow = 200;
+~chorus = (0..15);
+~chorusWeights = [1]++(0!15);
+
+~durs = (1..8);
+~durWeights = (0!7) ++ [1];
+
+~legatos = (1..8)/8;
+~legatoWeights = (0!7) ++ [1];
+
+~decibels = [110, 100, 90, 80, 70, 60, 40, 20];
+~decibelWeights = [1] ++ (0!7);
+
+~pnotes = Pfunc({
+ var direction, step, upWeight, downWeight, chorus, curFreq;
+ upWeight = 1;
+ downWeight = 1;
+ curFreq = ~curNote.midicps;
+ if (curFreq > ~freqHigh, {downWeight = curFreq/~freqHigh;});
+ if (curFreq < ~freqLow, {upWeight = ~freqLow/curFreq;});
+ direction = [-1, 1].wchoose([downWeight**3, upWeight**3].normalizeSum);
+ step = ~steps.wchoose(~intervalWeights.normalizeSum);
+ ~curNote = ~curNote + (step * direction);
+ chorus = ~chorus.wchoose(~chorusWeights.normalizeSum);
+ [~curNote, ~curNote+chorus];
+});
+
+~pdurs = Pfunc({
+ var dur;
+ dur = ~durs.wchoose(~durWeights.normalizeSum);
+ dur;
+});
+
+~plegatos = Pfunc({
+ var legato;
+ legato = ~legatos.wchoose(~legatoWeights.normalizeSum);
+ legato;
+});
+
+~pdecibel = Pfunc({
+ var decibel;
+ decibel = ~decibels.wchoose(~decibelWeights.normalizeSum);
+ decibel;
+});
+)
+
+(
+~beri.turn = {|zi, val, num|
+ num.postln;
+ if (num <= 16, {
+ ~intervalWeights[num-1] = val;
+ ("interval "++~steps[num-1]++" weight changed to "++val).postln;
+ });
+ if ((num >= 17) && (num <= 32), {
+ ~chorusWeights[num-17] = val;
+ ("chorus "++~chorus[num-17]++" weight changed to "++val).postln;
+ });
+ if ((num >= 81) && (num <= 88), {
+ ~durWeights[num-81] = val;
+ ("duration "++~durs[num-81]++" weight changed to "++val).postln;
+ });
+ if ((num >= 89) && (num <= 96), {
+ ~legatoWeights[num-89] = val;
+ ("legato "++~legatos[num-89]++" weight changed to "++val).postln;
+ });
+ if ((num >= 97) && (num <= 104), {
+ ~decibelWeights[num-97] = val;
+ ("decibel "++~decibels[num-97]++" weight changed to "++val).postln;
+ });
+};
+)
+
+(
+Pdef(\qeka, ~de.feja <> Pbind(*[
+ midinote: ~co.bass,
+ dur: Pseq([5, 3], inf),
+ db: -19 + Pseq([-2, -3], inf),
+])).quant_(8).stop;
+)
+
+(
+Pdef(\maka, ~de.feja <> Pbind(*[
+ midinote: ~co.snare,
+ dur: Pseq([Rest(2), 4, 2], inf),
+ db: -29,
+])).quant_(8).stop;
+)
+
+(
+Pdef(\gitu, ~de.feja <> Pbind(*[
+ midinote: ~co.hatclosed,
+ dur: Pwrand([
+ Pseq(2!4, 1),
+ Pseq(1!8, 1),
+ Pseq(0.5!16, 1),
+ ], [15, 5, 1].normalizeSum, inf),
+ db: -32,
+])).quant_(8).stop;
+)
+
+(
+Pdef(\huzi, ~de.feja <> Pbind(*[
+ midinote: ~co.clap,
+ dur: 32/3 * Pwrand([
+ Pseq(1!3, 1),
+ Pseq(0.5!6, 1),
+ ], [5, 2].normalizeSum, inf),
+ db: -59,
+])).quant_(8).stop;
+)
+
+(
+Pdef(\xula, ~de.feja <> Pbind(*[
+ midinote: Prand([~co.side, ~co.rim, ~co.tomfloor, ~co.tomlow, ~co.tomhigh, ~co.hatopen, ~co.cowbell, ~co.ride, ~co.ccrash, ~co.ride2, ~co.splash, ~co.hatsemiopen], inf),
+ dur: 4 * Prand([2, 3, 4], inf),
+ db: -37,
+])).quant_(8).stop;
+)
+
+(
+Pdef(\rulu, ~de.dufe <> Pbind(
+ \midinote, ~pnotes.trace,
+ \dur, ~pdurs/2,
+ \legato, ~plegatos,
+ \amp, ~pdecibel/127,
+)).quant_(8).stop;
+)
+
+(
+Pdef(\dipo, ~de.dufe <> Pbind(
+ \midinote, ~pnotesLow-24,
+ \dur, ~pdursLow*3/2,
+ \legato, ~plegatosLow,
+ \amp, ~pdecibelLow/127,
+)).quant_(8).stop;
+)
+
+(
+~curNoteLow = 60;
+
+~pnotesLow = Pfunc({
+ var direction, step, upWeight, downWeight, chorus, curFreq;
+ upWeight = 1;
+ downWeight = 1;
+ curFreq = ~curNoteLow.midicps;
+ if (curFreq > ~freqHigh, {downWeight = curFreq/~freqHigh;});
+ if (curFreq < ~freqLow, {upWeight = ~freqLow/curFreq;});
+ direction = [-1, 1].wchoose([downWeight**3, upWeight**3].normalizeSum);
+ step = ~steps.wchoose(~intervalWeights.normalizeSum);
+ ~curNoteLow = ~curNoteLow + (step * direction);
+ chorus = ~chorus.wchoose(~chorusWeights.normalizeSum);
+ [~curNoteLow, ~curNoteLow+chorus];
+});
+
+~pdursLow = Pfunc({
+ var dur;
+ dur = ~durs.wchoose(~durWeights.normalizeSum);
+ dur;
+});
+
+~plegatosLow = Pfunc({
+ var legato;
+ legato = ~legatos.wchoose(~legatoWeights.normalizeSum);
+ legato;
+});
+
+~pdecibelLow = Pfunc({
+ var decibel;
+ decibel = ~decibels.wchoose(~decibelWeights.normalizeSum);
+ decibel;
+});
+)
+
+(
+Pdef(\heri, ~de.dufe <> Pbind(
+ \midinote, ~pnotesMid-12,
+ \dur, ~pdursMid,
+ \legato, ~plegatosMid,
+ \amp, ~pdecibelMid/127,
+)).quant_(8).stop;
+)
+
+(
+~curNoteMid = 60;
+
+~pnotesMid = Pfunc({
+ var direction, step, upWeight, downWeight, chorus, curFreq;
+ upWeight = 1;
+ downWeight = 1;
+ curFreq = ~curNoteMid.midicps;
+ if (curFreq > ~freqHigh, {downWeight = curFreq/~freqHigh;});
+ if (curFreq < ~freqLow, {upWeight = ~freqLow/curFreq;});
+ direction = [-1, 1].wchoose([downWeight**3, upWeight**3].normalizeSum);
+ step = ~steps.wchoose(~intervalWeights.normalizeSum);
+ ~curNoteMid = ~curNoteMid + (step * direction);
+ chorus = ~chorus.wchoose(~chorusWeights.normalizeSum);
+ [~curNoteMid, ~curNoteMid+chorus];
+});
+
+~pdursMid = Pfunc({
+ var dur;
+ dur = ~durs.wchoose(~durWeights.normalizeSum);
+ dur;
+});
+
+~plegatosMid = Pfunc({
+ var legato;
+ legato = ~legatos.wchoose(~legatoWeights.normalizeSum);
+ legato;
+});
+
+~pdecibelMid = Pfunc({
+ var decibel;
+ decibel = ~decibels.wchoose(~decibelWeights.normalizeSum);
+ decibel;
+});
+)
+
--- /dev/null
+// Init
+// TODO: move into classes or startup
+
+(
+~co = Environment[
+ // drumkit midi mappings
+ \bass -> 36,
+ \side -> 37,
+ \snare -> 38,
+ \clap -> 39,
+ \rim -> 40,
+ \tomfloor -> 41,
+ \hatclosed -> 42,
+ \tomlow -> 43,
+ \hatpedal -> 44,
+ \tomhigh -> 45,
+ \hatopen -> 46,
+ \cowbell -> 47,
+ \ride -> 48,
+ \ccrash -> 49,
+ \ride2 -> 50,
+ \splash -> 51,
+ \hatsemiopen -> 52,
+ \bell -> 53,
+];
+~co.know = true;
+
+//=== MIDI setup
+MIDIClient.init;
+MIDIIn.connectAll;
+MIDIClient.destinations.do({ arg item;
+ switch (item.device,
+ "amsynth",
+ { ~co.outAmsynth = MIDIOut(0, item.uid); },
+ "Hydrogen",
+ { ~co.outHydrogen = MIDIOut(0, item.uid); },
+ "LinuxSampler",
+ { ~co.outLinuxSampler = MIDIOut(0, item.uid); }
+ );
+});
+
+//=== Beat patterns
+~bi = Environment[
+ // plain dnb
+ \koxa -> Pbind(
+ \midinote,
+ Pseq([~co.bass, ~co.snare], 2),
+ \dur,
+ Pseq([1, 1.5 , 0.5, 1]),
+ ),
+];
+~bi.know = true;
+
+//=== Device patterns
+~de = Environment[
+ // amsynth
+ \sowu -> Pbind(
+ \type, \midi,
+ \midiout, ~co.outAmsynth,
+ \midicmd, \noteOn,
+ \chan, 1,
+ ),
+
+ // Hydrogen
+ \feja -> Pbind(
+ \type, \midi,
+ \midiout, ~co.outHydrogen,
+ \midicmd, \noteOn,
+ \chan, 1,
+ ),
+
+ // linuxsampler
+ \dufe -> Pbind(
+ \type, \midi,
+ \midiout, ~co.outLinuxSampler,
+ \midicmd, \noteOn,
+ \chan, 1,
+ ),
+];
+~de.know = true;
+
+"Ҙыԃегы кёԋю жуҫище дёҏеке".postln;
+)
+
+// input
+
+(
+SynthDef(\mixer, {|in=0, out=0, amp=1|
+ var sig = SoundIn.ar([in, in+1], amp);
+ Out.ar(out, sig)
+}).add;
+
+SynthDef(\echo, {|in=0, out=0|
+ var sig, rev;
+ sig = In.ar(in, 2);
+ rev = JPverb.ar(sig, t60: 1.0, damp: 0.0, size: 1.0, earlyDiff: 0.707, modDepth: 0.1, modFreq: 2.0, low: 1.0, mid: 1.0, high: 1.0, lowcut: 500.0, highcut: 2000.0);
+ Out.ar(out, sig+rev);
+}).add;
+)
+
+~sources = Group.new;
+~effects = Group.new(addAction: \addToTail);
+
+~sourceBus = Bus.audio(s, 2);
+
+//~micInput = Synth(\mixer, [in: 0,
+~drumInput = Synth(\mixer, [in: 2], ~sources);
+~pianoInput = Synth(\mixer, [in: 4], ~sources);
+~amsynthinput = Synth(\mixer, [in: 6], ~sources);
+~sources.set(\out, ~sourceBus);
+
+~echo = Synth.new(\echo, [in: ~sourceBus], ~effects);
+
+// beats
+
+TempoClock.tempo = 2;
+
+(
+Pdef(\qixu, Pbind(*[
+ midinote: ~co.bass,
+ dur: Pseq([4, 4, 4, 2, 1, 1].normalizeSum*4, inf),
+ db: -7,
+]) <> ~de.feja).quant_(4).stop;
+)
+
+(
+Pdef(\rodi, Pbind(*[
+ midinote: Prand([~co.snare, ~co.rim], inf),
+ dur: Pseq([Rest(0.2), 4, 4, 4, 2, 1, 0.8]/4, inf),
+ db: Pwhite(-20, -15, inf),
+]) <> ~de.feja).quant_(4).stop;
+)
+
+(
+Pdef(\cubu, Pbind(*[
+ midinote: Prand([~co.hatclosed, ~co.hatpedal], inf),
+ dur: Prewrite(1, [
+ 1: [1, 2, 3],
+ 2: [3, 2, 1],
+ 3: [1, 2, 1],
+ ], 6)*3/16,
+ db: Pwhite(-20, -17, inf),
+]) <> ~de.feja).quant_(4).stop;
+)
+
+(
+Pdef(\gofu, Pbind(*[
+ midinote: Prand([53, 60, 67, 74], inf)+Prand([12], inf),
+ dur: Prewrite(2, [
+ 1: [1, 2, 3],
+ 2: [3, 2, 1],
+ 3: [1, 2, 1],
+ ], 7)*3/16,
+ db: Pwhite(-7, -10, inf),
+ legato: Phprand(0.5, 0.9, inf),
+]) <> ~de.dufe).quant_(4).stop;
+)
\ No newline at end of file
--- /dev/null
+
+TempoClock.tempo = 1.5;
+
+(
+Pdef(\ritm, Pmono(\liwe, *[
+ dur: Pwrand([
+ Pseq([1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([1, 1, 1, 1, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([4, 2, 2, 2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 3, 2, 3].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 2, 3, 3].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 3, 3, 2].normalizeSum*4, 1),
+ Pseq([2, 1, 2, 1, 4, 2, 2, 2].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 2, 1, 1, 1/2, 1/2, 1/2, 1/2, 2].normalizeSum*4, 1),
+ ], [5, 2, 1, 1, 2, 2, 2, 1, 1].normalizeSum, inf),
+ db: -21,
+ pan: Pwhite(-0.5, 0.5),
+ t_trig: Pwrand([1, 0], [15, 1], inf),
+ tension: 0.006/(Pkey(\dur)**0.4)*Pwhite(0.95, 1.05),
+ loss: Plprand(0.9999, 0.99995, inf),
+])).quant_(4).stop;
+)
+
+(
+Pdef(\ritm2, Pmono(\qoba, *[
+ dur: Pwrand([
+ Pseq([1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([1, 1, 1, 1, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([4, 2, 2, 2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 3, 2, 3].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 2, 3, 3].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 3, 3, 2].normalizeSum*4, 1),
+ Pseq([2, 1, 2, 1, 4, 2, 2, 2].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 2, 1, 1, 1/2, 1/2, 1/2, 1/2, 2].normalizeSum*4, 1),
+ ], [5, 2, 1, 1, 2, 2, 2, 1, 1].normalizeSum, inf),
+ db: 15,
+ pan: Pwhite(-0.5, 0.5),
+ trig: Pwrand([1, 0], [15, 1], inf),
+ accent: 0.3,
+ freq: Pexprand(40, 80),
+ tone: 0.01,
+ decay: 0.2,
+ attackfm: 0.15,
+ selffm: 0.6,
+])).quant_(4).stop;
+)
+
+(
+Pdef(\ritm3, Pmono(\buti, *[
+ dur: Pwrand([
+ Pseq([1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([1, 1, 1, 1, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([4, 2, 2, 2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 3, 2, 3].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 2, 3, 3].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 3, 3, 2].normalizeSum*4, 1),
+ Pseq([2, 1, 2, 1, 4, 2, 2, 2].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 2, 1, 1, 1/2, 1/2, 1/2, 1/2, 2].normalizeSum*4, 1),
+ ], [5, 2, 1, 1, 2, 2, 2, 1, 1].normalizeSum, inf),
+ timingOffset: 1/2,
+ db: -20,
+ pan: Pwhite(-0.5, 0.5),
+ trig: Pwrand([1, 0], [15, 1], inf),
+ accent: 0.5,
+ freq: Pexprand(40, 160),
+ tone: 0.1,
+ decay: Pwhite(0.1, 0.5),
+ snappy: Pwhite(0.1, 0.9),
+])).quant_(4).stop;
+)
+
+(
+Ndef(\stormofkicks, {
+ var trig = Impulse.kr(8);
+ var sig = AnalogBassDrum.ar(
+ trig,
+ infsustain: 0.0,
+ accent: 0.25,
+ freq: TExpRand.kr(40,120, trig),
+ tone: 0.0,//TRand.kr(0.5,1.0,trig),
+ decay: 0.15,
+ attackfm: 0.11,//TRand.kr(0.1,1.0,trig),
+ selffm:TRand.kr(0.1,0.9,trig)
+ );
+
+ Pan2.ar(sig, TRand.kr(-1.0,1.0,trig));
+}).play;
+)
+
+{ Impulse.ar(5, 0.0, 0.5, 0) }.play
+
+(
+Pdef(\ritmbase, Pbind(*[
+ type: \set,
+ id: ~m.nodeID,
+ \args, #[\t_trig, \tension, \loss, \amp],
+ dur: Pseq([1, 1, 1, 1].normalizeSum*4, inf),
+ db: -25,
+ t_trig: 1,
+ tension: 0.004,
+ loss: 0.99995,
+ timingOffset: 0.01,
+])).quant_(4).stop;
+)
+
+(
+{ var excitation = EnvGen.kr(Env.perc,
+ MouseButton.kr(0, 1, 0),
+ timeScale: 0.1, doneAction: 0
+ ) * PinkNoise.ar(0.4);
+ var tension = MouseX.kr(0.01, 0.1);
+ var loss = MouseY.kr(0.999999, 0.999, 1);
+ MembraneCircle.ar(excitation, tension, loss)!2;
+}.play;
+)
+
--- /dev/null
+(
+SynthDef(\sisudi, {|out=0, gate=1, freq=440, amp=1, cut=800, rez=0.8,
+ modFreqMin=7, modFreqMax=12, modAmp=0.01, release=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.asr(releaseTime: release), gate, doneAction: 2);
+ sig = Pan2.ar(sig, Rand(-0.3, 0.3));
+ Out.ar(out, sig * amp);
+}).add;
+
+SynthDef(\sileto, { |freq = 440, sustain = 1, amp=1, out=0|
+ var sig = 0;
+ var num = 26;
+ var partial = 0;
+ num.do({
+ var pfact = ExpRand(1, 16);
+ partial = SinOsc.ar(freq * pfact, Rand(0, 2pi)) / num / pfact;
+ partial = partial * EnvGen.kr(Env.perc(0.03, Rand(sustain/5, sustain)));
+ partial = Pan2.ar(partial, Rand(-0.5, 0.5));
+ sig = sig + partial;
+ });
+ sig = sig * Line.kr(1, 1, sustain+0.1, doneAction: 2);
+ Out.ar(out, sig*amp);
+}).add;
+
+SynthDef(\sipope, {|out=0, gate=1, freq=440, amp=1|
+ var sig = 0;
+ var num = 30;
+ num.do({
+ sig = sig + (LFPulse.ar(freq, Rand(0, 0.01), SinOsc.kr(SinOsc.kr(Rand(2, 8), 0, 2, 2), Rand(0, 2pi), 0.5, 0.5)) / num);
+ });
+ sig = sig * EnvGen.kr(Env.asr(0.03, 0.3, 1.8), gate, doneAction: Done.freeSelf);
+ sig = Pan2.ar(sig, Rand(-0.2, 0.2), amp);
+ Out.ar(out, sig);
+}).add;
+)
+
+~mix = MidiMix();
+
+(
+~mix.rot1_{|v|
+ TempoClock.tempo = TempoClock.tempo * (1.01**v);
+ TempoClock.tempo.postln;
+};
+)
+
+TempoClock.tempo = 89 / 60;
+
+~necoGr = Group.new();
+
+~efGr = Group.new(addAction: \addToTail);
+
+~efBus = Bus.audio(numChannels: 2);
+
+(
+Pdef(\neco, Pbind(*[
+ instrument: \sisudi,
+ db: Pwhite(-20, -15, inf)-26,
+ octave: Prand([2, 3, 4], inf),
+ note: Pxrand([0, 4, 9], inf),
+ legato: 0.4,
+ dur: Prand([1, 2, 3, 4]/4, inf),
+ timingOffset: 0.0,
+ group: ~necoGr,
+])).quant_(4).stop;
+)
+
+(
+Pdef(\dodi, Pbind(*[
+ instrument: \sileto,
+ db: Pwhite(-20, -15, inf),
+ octave: Prand([2, 3, 4], inf),
+ note: Pxrand([0, 4, 9], inf),
+ legato: 0.7,
+ dur: Prand([1], inf),
+ timingOffset: 0.5,
+ group: ~necoGr,
+ out: ~efBus,
+])).quant_(4).stop;
+)
+
+(
+Pdef(\nadi, Pbind(*[
+ instrument: \sipope,
+ db: Pwhite(-20, -15, inf)-10,
+ octave: Prand([2, 3, 4], inf),
+ note: Pxrand([0, 4, 9], inf),
+ legato: Pwhite(0.2, 0.8),
+ dur: Prand([1, 2, 3, 4, 6]/2, inf),
+ timingOffset: 0,
+ group: ~necoGr,
+ out: ~efBus,
+])).quant_(4).stop;
+)
+
+(
+SynthDef(\reverb, { | amp=1, in, out=0, mix=0.33, t60= 1.0, damp= 0.0, size= 1.0, earlyDiff= 0.707, modDepth= 0.1, modFreq= 2.0, low= 1.0, mid= 1.0, high= 1.0, lowcut= 500.0, highcut= 2000.0 |
+ var sig, rev;
+ sig = In.ar(in, 2);
+ rev = JPverb.ar(sig, t60, damp, size, earlyDiff, modDepth, modFreq, low, mid, high, lowcut, highcut);
+ sig = sig + (rev*mix);
+ Out.ar(out, sig*amp);
+}).add;
+)
+
+~reverb = Synth(\reverb, [in: ~efBus], ~efGr);
+~reverb.free;
+
+(
+~mix.again_{|v|
+ ~reverb.set(\mix, v);
+ v.postln;
+};
+)
+
+(
+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(\paketo, Pbind(
+ \instrument, Pseq([\siruse], inf),
+ \octave, [2, 3, 4],
+ \note, Pxrand([0, 2], inf),
+ \dur, Pseq([3, 3, 2].normalizeSum, inf),
+ \timingOffset, [0, 1/5, 2/5],
+ \legato, [1, 4/5, 3/5]*0.2,
+ \db, Pseq([-2], inf),
+ \out, ~efBus,
+ \group, ~necoGr,
+)).quant_(1).stop;
+)
\ No newline at end of file
--- /dev/null
+TempoClock.tempo = 1;
+
+(
+Pdef(\bass1, Pbind(*[
+ instrument: \dytu,
+ release: 2.0,
+ dur: 1 * 2,
+ db: -12,
+ octave: 2,
+ cut: 200,
+ rez: 0.9,
+ note: Pseq([4, 4, 7], inf),
+])).quant_(3).stop;
+)
+
+(
+Pdef(\bass2, Pbind(*[
+ instrument: \dytu,
+ release: 1.0,
+ dur: Pseq([2, 1, 1, 2].normalizeSum * 3, inf),
+ db: -12,
+ octave: 3,
+ note: Pseq([4, 9, 5, 4], inf),
+ cut: 400,
+ rez: 0.9,
+])).quant_(3).stop;
+)
+
+(
+Pdef(\mid1, Pbind(*[
+ instrument: \dytu,
+ release: Pseq([0.6, 0.7, 1.0], inf),
+ dur: Pseq([2, 3, 3].normalizeSum * 3, inf),
+ db: -14,
+ octave: 4,
+ note: Pseq([9, 4, 0], inf),
+ cut: 600,
+ rez: 0.7,
+])).quant_(3).stop;
+)
+
+(
+Pdef(\mid2, Pbind(*[
+ instrument: \dyti,
+ release: 0.3,
+ legato: 0.5,
+ dur: Pseq([1, 1+(1/9), 1-(1/9)], inf),
+ db: -27,
+ octave: 5,
+ note: Pseq([2, 2, 4, 4, 4, 2, 2, 2, 4, 9, 7, 2], inf),
+ cut: 800,
+ rez: 0.6,
+])).quant_(3).stop;
+)
+
+(
+Pdef(\mid3, Pbind(*[
+ instrument: \dyti,
+ release: 0.9,
+ legato: 0.1,
+ dur: Pseq([3, 3, 1, 3, 2].normalizeSum * 3 / 2, inf),
+ db: -30,
+ octave: 6,
+ note: Pxrand([2, 4, 5, 7], inf),
+ cut: 1000,
+ rez: 0.5,
+])).quant_(3).stop;
+)
+
+(
+Pdef(\hi1, Pbind(*[
+ instrument: \dytu,
+ release: Pwhite(0.2, 0.4, inf),
+ dur: Pseq([2, 2, 1, 3].normalizeSum * 3 / 8, inf),
+ strum: 1/27,
+ db: -41,
+ octave: 7,
+ note: Pxrand([2, 4, 5, 7], inf) + [0, 2, 5],
+ cut: 1200,
+ rez: 0.4,
+])).quant_(3).stop;
+)
+
+(
+Pdef(\hi2, Pbind(*[
+ instrument: \dyti,
+ release: 0.3,
+ legato: 0.9,
+ dur: Pseq([2, 1, 2, 1].normalizeSum * 3, inf),
+ db: -42,
+ octave: 8,
+ note: Pxrand([0, 5, 7, 9], inf),
+ cut: 1400,
+ rez: 0.4,
+])).quant_(3).stop;
+)
+
+(
+Pdef(\hi3, Pbind(*[
+ instrument: \dyti,
+ release: 0.1,
+ legato: 0.5,
+ dur: Pseq([2, 1, 2, 1].normalizeSum * 3 / 4, inf),
+ db: -31,
+ octave: 9,
+ note: Pxrand([0, 5, 7, 9], inf),
+ cut: 1600,
+ rez: 0.3,
+])).quant_(3).stop;
+)
+
+
+
--- /dev/null
+~push = MidiPush();
+~push.midiout.latency_(0.2);
+
+~kedi = MidiRemote25SL();
+
+(
+~kedi.tempo_{|v|
+ TempoClock.tempo = v / 60;
+ v.postln;
+};
+
+TempoClock.play({|beats, time, clock|
+ ~push.syncTempo_(true);
+}, 1);
+)
+
+// infinite pattern
+// ###
+// ###
+(
+~screen = Array2D.new(8, 8);
+8.do{|i|
+ 8.do{|j|
+ ~screen[i, j] = 1.rand;
+ };
+};
+
+~draw = {|arr|
+ 8.do{|i|
+ 8.do{|j|
+ ~push.ledPad(i, j, arr[i, j]*3);
+ }
+ };
+};
+)
+
+~draw.value(~screen);
+
+(
+~conway = IdentityDictionary[
+ \arr -> Array2D.new(8, 8),
+ \time -> 0,
+ \init -> {|zi|
+ 8.do{|i|
+ 8.do{|j|
+ zi.arr[i, j] = 0;
+ };
+ };
+ },
+ \get -> {|zi, i, j|
+ i = i % 8;
+ j = j % 8;
+ zi.arr[i, j];
+ },
+ \nextGen -> {|zi|
+ var arrcopy = zi.arr.deepCopy;
+ 8.do{|i|
+ 8.do{|j|
+ var cur, sum;
+ cur = zi.get(i, j);
+ sum = 0;
+ (-1..1).do{|k|
+ (-1..1).do{|l|
+ sum = sum + zi.get(i+k, j+l);
+ };
+ };
+ sum = sum - cur;
+ if (cur == 1) {
+ if ((sum < 2) || (sum > 3)) {
+ arrcopy[i, j] = 0;
+ };
+ } {
+ if (sum == 3) {
+ arrcopy[i, j] = 1;
+ };
+ };
+ };
+ };
+ zi.arr = arrcopy;
+ zi.time = zi.time + 1;
+ }
+];
+~conway.know = true;
+~conway.init;
+)
+
+~conway.arr[1, 1] = 1;
+~conway.arr[2, 2] = 1;
+~conway.arr[1, 2] = 1;
+~conway.arr.postln;
+~conway.nextGen;
+
+(
+~eventGen = {|i, j, sum|
+ var ev = nil;
+ if (7.rand < 2) {
+ ev = (
+ instrument: [\dyti].choose,
+ midinote: 24+(i*5)+(j*2),
+ amp: 3/sum/(i+5),
+ legato: 0.2,
+ timingOffset: 3.rand/3// + 0.15
+ )
+ };
+ ev;
+};
+)
+
+~sum = 0;
+
+~routine.stop;
+
+(
+~conway.init;
+~conway.arr[2, 0] = 1;
+~conway.arr[2, 1] = 1;
+~conway.arr[2, 2] = 1;
+~conway.arr[3, 2] = 1;
+~conway.arr[3, 3] = 1;
+~conway.arr[3, 4] = 1;
+/*
+8.do{|i|
+8.do{|j|
+~conway.arr[i, j] = 2.rand;
+};
+};
+*/
+~routine = {
+ true.while{
+ ~sum = ~conway.arr.sum;
+ ~draw.value(~conway.arr);
+ 8.do{|i|
+ 8.do{|j|
+ if (~conway.arr[i, j] == 1) {
+ ~eventGen.value(i, j, ~sum).play;
+ };
+ };
+ };
+ 1.wait;
+ ~conway.nextGen;
+ };
+}.fork(quant: 1);
+)
+
+(
+~push.pad_{|d, v, c, r|
+ ~conway.arr[r, c] = 1;
+ ~push.ledPad(r, c, ~conway.arr[r, c]*3);
+};
+)
+
+~push.ledButton(\play, \brightBlink);
+
+(
+Pdef(\ritm, Pmono(\liwe, *[
+ dur: Pwrand([
+ Pseq([1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([1, 1, 1, 1, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([4, 2, 2, 2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 3, 2, 3].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 2, 3, 3].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 3, 3, 2].normalizeSum*4, 1),
+ Pseq([2, 1, 2, 1, 4, 2, 2, 2].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 2, 1, 1, 1/2, 1/2, 1/2, 1/2, 2].normalizeSum*4, 1),
+ ], [5, 2, 1, 1, 2, 2, 2, 1, 1].normalizeSum, inf),
+ db: -21,
+ pan: Pwhite(-0.5, 0.5),
+ t_trig: Pwrand([1, 0], [15, 1], inf),
+ tension: 0.006/(Pkey(\dur)**0.4)*Pwhite(0.95, 1.05),
+ loss: Plprand(0.9999, 0.99995, inf),
+])).quant_(4).stop;
+)
+
+(
+Pdef(\ritm2, Pmono(\qoba, *[
+ dur: Pwrand([
+ Pseq([1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([1, 1, 1, 1, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([4, 2, 2, 2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 3, 2, 3].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 2, 3, 3].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 3, 3, 2].normalizeSum*4, 1),
+ Pseq([2, 1, 2, 1, 4, 2, 2, 2].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 2, 1, 1, 1/2, 1/2, 1/2, 1/2, 2].normalizeSum*4, 1),
+ ], [5, 2, 1, 1, 2, 2, 2, 1, 1].normalizeSum, inf),
+ db: 15,
+ pan: Pwhite(-0.5, 0.5),
+ trig: Pwrand([1, 0], [15, 1], inf),
+ accent: 0.3,
+ freq: Pexprand(40, 80),
+ tone: 0.01,
+ decay: 0.2,
+ attackfm: 0.15,
+ selffm: 0.6,
+])).quant_(4).stop;
+)
+
+(
+Pdef(\ritm3, Pmono(\buti, *[
+ dur: Pwrand([
+ Pseq([1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([1, 1, 1, 1, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([4, 2, 2, 2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 3, 2, 3].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 2, 3, 3].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 3, 3, 2].normalizeSum*4, 1),
+ Pseq([2, 1, 2, 1, 4, 2, 2, 2].normalizeSum*4, 1),
+ Pseq([3, 3, 2, 2, 1, 1, 1/2, 1/2, 1/2, 1/2, 2].normalizeSum*4, 1),
+ ], [5, 2, 1, 1, 2, 2, 2, 1, 1].normalizeSum, inf),
+ timingOffset: 1/2,
+ db: -20,
+ pan: Pwhite(-0.5, 0.5),
+ trig: Pwrand([1, 0], [15, 1], inf),
+ accent: 0.5,
+ freq: Pexprand(40, 160),
+ tone: 0.1,
+ decay: Pwhite(0.1, 0.5),
+ snappy: Pwhite(0.1, 0.9),
+])).quant_(4).stop;
+)
--- /dev/null
+// Ableton push handler
+// by Eugene Zuelum
+//
+// see https://github.com/Ableton/push-interface for info about ABI:
+// https://github.com/Ableton/push-interface/blob/master/doc/AbletonPush2MIDIDisplayInterface.asc
+
+(
+~bcrFactory = {
+ var controler = Environment[
+ \version -> "33.7.3.6",
+
+ \channel -> 0,
+ ];
+
+ controler.know = true;
+
+ MIDIdef.cc(\bcr2000defaultTurn, { |...args|
+ controler.turn(*args);
+ }, (1..110), controler.channel, 2621440);
+
+ "Ԃиџуту готов к использованию 😊".postln;
+
+ controler;
+};
+)
+
+//============================================================================= Testing
+
+/* Test incoming MIDI messages from push
+(
+MIDIdef.cc(\testcc, {|...args|
+(["cc"] ++ args).postln;
+});
+MIDIdef.noteOn(\testnoteon, {|...args|
+(["note on"] ++ args).postln;
+});
+MIDIdef.noteOff(\testnoteoff, {|...args|
+(["note off"] ++ args).postln;
+});
+MIDIdef.touch(\testtouch, {|...args|
+(["touch"] ++ args).postln;
+});
+MIDIdef.polytouch(\testpolytouch, {|...args|
+(["polytouch"] ++ args).postln;
+});
+MIDIdef.bend(\testbend, {|...args|
+(["bend"] ++ args).postln;
+});
+MIDIdef.sysex(\testsysex, {|...args|
+(["sysex"] ++ args).postln;
+});
+)
+*/
--- /dev/null
+
+
+~sekick = Sampler(\kik);
+
+~sekick.startRec;
+~sekick.stopRec;
+
+~sekick.playSample;
+~sekick.shiftPos(0.05);
+
+~procBus = Bus.audio(s, 2);
+
+(
+Pdef(\kik, ~sekick.makeSynthBind <> Pbind(*[
+ dur: 1,
+ octave: 4,
+ db: -15,
+ legato: 5,
+ sendGate: false,
+ out: ~procBus,
+])).quant_(4).stop;
+)
+
+(
+SynthDef(\sexi, {| in, out=0 |
+ var sig;
+ sig = In.ar(in, 2);
+ //sig = sig + CombC.ar(sig, 5.0, 1/6, 2.1);
+ //sig = sig * 0.7;
+ //sig = sig * Pulse.ar(Pulse.ar(Pulse.ar(171).range(2, 401)).range(0, 6703));
+ //sig = sig + DelayC.ar(CombC.ar(sig, 5.0, 1/13, 1.0), 0.1, LFNoise2.ar(151).range(0, 0.09));
+ //sig = sig*0.5 + Pulse.ar(LFNoise2.ar(32).range(400, 800), mul: LFNoise2.ar(16).range(0.01, 0.02));
+ sig = LPF.ar(sig, LFNoise2.ar(16).range(2000, 16000));
+ Out.ar(out, sig);
+}).add;
+
+{
+ ~procSynth.free;
+ ~procSynth = Synth(\sexi, [
+ in: ~procBus,
+ ], s, \addToTail);
+}.defer(0.1);
+)
\ No newline at end of file
--- /dev/null
+~beri = ~bcrFactory.value;
+
+(
+~melmaker = Environment[
+ \current
+ \makemelody ->
+ {
+
+ }
+];
+~melmaker.know = true;
+
+)
+
+(
+SynthDef(\pulsetone,
+ { arg out = 0, freq = 440, sustain = 0.05, gate=1, amp=1;
+ var env, sig;
+ sig = Pulse.ar(freq, 0.5, amp);
+ sig = LPF.ar(sig, 4000);
+ env = EnvGen.kr(Env.asr(0.01, 0.8, 0.05), gate, doneAction: Done.freeSelf);
+ sig = sig * env;
+ sig = Pan2.ar(sig, Rand(-0.6, 0.6));
+ Out.ar(out, sig);
+}).add;
+)
+
+});
+
+}, {});
+
+(
+~curFreq = 110;
+~steps = (0..15);
+~intervalWeights = [1]++(0!15);
+~freqHigh = 1000;
+~freqLow = 200;
+
+~durs = (1..8);
+~durWeights = (0!7) ++ [1];
+
+~legatos = (1..8)/8;
+~legatoWeights = (0!7) ++ [1];
+
+~decibels = (0..7) * -2;
+~decibelWeights = [1] ++ (0!7);
+
+~chorus = (0..15);
+~chorusWeights = [1]++(0!15);
+
+/*~chooseWeighted = {|values, weights|
+ values.
+};*/
+)
+
+(
+~beri.turn = {|zi, val, num|
+ num.postln;
+ if (num <= 16, {
+ ~intervalWeights[num-1] = val;
+ ("interval "++~steps[num-1]++" weight changed to "++val).postln;
+ });
+ if ((num >= 17) && (num <= 32), {
+ ~chorusWeights[num-17] = val;
+ ("chorus "++~chorus[num-17]++" weight changed to "++val).postln;
+ });
+ if ((num >= 81) && (num <= 88), {
+ ~durWeights[num-81] = val;
+ ("duration "++~durs[num-81]++" weight changed to "++val).postln;
+ });
+ if ((num >= 89) && (num <= 96), {
+ ~legatoWeights[num-89] = val;
+ ("legato "++~legatos[num-89]++" weight changed to "++val).postln;
+ });
+ if ((num >= 97) && (num <= 104), {
+ ~decibelWeights[num-97] = val;
+ ("decibel "++~decibels[num-97]++" weight changed to "++val).postln;
+ });
+ ~pnotes = Pfunc({
+ var direction, step, upWeight, downWeight, chorus;
+ upWeight = 1;
+ downWeight = 1;
+ if (~curFreq > ~freqHigh, {downWeight = ~curFreq/~freqHigh;});
+ if (~curFreq < ~freqLow, {upWeight = ~freqLow/~curFreq;});
+ //[downWeight, upWeight].postln;
+ direction = [-1, 1].wchoose([downWeight**3, upWeight**3].normalizeSum);
+ //direction.postln;
+ step = ~steps.wchoose(~intervalWeights.normalizeSum);
+ ~curFreq = ~curFreq * (direction*step).midiratio;
+ chorus = ~chorus.wchoose(~chorusWeights.normalizeSum);
+ //("new chorus: "++chorus).postln;
+ [~curFreq, ~curFreq*chorus.midiratio];
+ });
+
+ ~pdurs = Pfunc({
+ var dur;
+ dur = ~durs.wchoose(~durWeights.normalizeSum);
+ //("new duration: "++dur).postln;
+ dur;
+ });
+
+ ~plegatos = Pfunc({
+ var legato;
+ legato = ~legatos.wchoose(~legatoWeights.normalizeSum);
+ //("new legato: "++legato).postln;
+ legato;
+ });
+
+ ~pdecibel = Pfunc({
+ var decibel;
+ decibel = ~decibels.wchoose(~decibelWeights.normalizeSum);
+ //("new decibel: "++decibel).postln;
+ decibel;
+ });
+
+ ~melody = ~se.makeSynthBind <> Pbind(
+ \instrument, \sinetone,
+ \freq, ~pnotes,
+ \dur, ~pdurs,
+ \legato, ~plegatos,
+ \db, -10+~pdecibel,
+ );
+ Pdef(\melody, ~melody).quant_(1).play;
+};
+)
+
+Pdef(\melody).stop;
+
+~se.shiftPos(0.05);
+~se.playSample
+
+a = ~pnotes.asStream;
+a.next
+
+TempoClock.tempo = 1;
+
+// with beat
+
+(
+~curFreq = 220;
+~steps = [0, 7, 5, 12];
+~intervalWeights = [1, 5, 2, 1];
+~freqHigh = 800;
+~freqLow = 300;
+
+~durs = [1, 2, 3, 4, 8];
+~durWeights = [1, 2, 0, 1, 0];
+
+~legatos = [0.2, 0.3, 0.4, 0.9];
+~legatoWeights = [1, 4, 4, 3];
+
+~decibels = [-20, -55, -62];
+~decibelWeights = [0, 43, 28];
+
+~chorus = [5, 7, 9, 12];
+~chorusWeights = [1, 2, 1, 5];
+
+~pnotes = Pfunc({
+ var direction, step, upWeight, downWeight, chorus;
+ upWeight = 1;
+ downWeight = 1;
+ if (~curFreq > ~freqHigh, {downWeight = ~curFreq/~freqHigh;});
+ if (~curFreq < ~freqLow, {upWeight = ~freqLow/~curFreq;});
+ direction = [-1, 1].wchoose([downWeight**3, upWeight**3].normalizeSum);
+ step = ~steps.wchoose(~intervalWeights.normalizeSum);
+ ~curFreq = ~curFreq * (direction*step).midiratio;
+ chorus = ~chorus.wchoose(~chorusWeights.normalizeSum);
+ [~curFreq, ~curFreq*chorus.midiratio];
+});
+
+~pdurs = Pfunc({
+ var dur;
+ dur = ~durs.wchoose(~durWeights.normalizeSum);
+ dur;
+});
+
+~plegatos = Pfunc({
+ var legato;
+ legato = ~legatos.wchoose(~legatoWeights.normalizeSum);
+ legato;
+});
+
+~pdecibel = Pfunc({
+ var decibel;
+ decibel = ~decibels.wchoose(~decibelWeights.normalizeSum);
+ decibel;
+});
+)
+
+(
+SynthDef(\beat,
+ { arg out = 0, amp=1;
+ var env, sig;
+ sig = BrownNoise.ar();
+ sig = sig + LFPulse.ar(50, width: LFSaw.ar(1, 0.5), mul: 0.4);
+ sig = LPF.ar(sig, 300);
+ env = EnvGen.kr(Env.perc(0.001, 0.4), doneAction: Done.freeSelf);
+ sig = sig * env * amp;
+ Out.ar(out, sig!2)
+}).add;
+)
+
+(
+SynthDef(\hat,
+ { arg out = 0, amp=1;
+ var env, sig;
+ sig = PinkNoise.ar();
+ sig = sig + LFPulse.ar(200, width: LFSaw.ar(1, 0.5), mul: 0.2);
+ sig = LPF.ar(sig, 14000);
+ env = EnvGen.kr(Env.perc(0.001, 0.1), doneAction: Done.freeSelf);
+ sig = sig * env * amp;
+ Out.ar(out, sig!2)
+}).add;
+)
+
+(
+SynthDef(\reverb, { |in, out = 0, mix=0|
+ var sig, wet;
+ sig = In.ar(in, 2);
+ wet = CombC.ar(sig, 5, 3/8, 6/8, mix);
+ Out.ar(out, sig+wet)
+}).add;
+)
+
+(
+~melody = Pbind(
+ \instrument, \pulsetone,
+ \freq, ~pnotes,
+ \dur, ~pdurs,
+ \legato, ~plegatos,
+ \db, -20+~pdecibel,
+ \out, ~busOne,
+);
+Pdef(\melody, ~melody).quant_(8).stop;
+)
+
+(
+Pdef(\beat1, Pbind(
+ \instrument, \beat,
+ \dur, 8,
+ \db, -2,
+ \out, ~busOne,
+)).quant_(8).stop;
+)
+
+(
+Pdef(\beat2, Pbind(
+ \instrument, \hat,
+ \dur, Pwrand([
+ Pseq([8], 1),
+ Pseq(4!2, 1),
+ Pseq(2!4, 1),
+ Pseq(1!8, 1),
+ ], [1, 4, 2, 1].normalizeSum, inf),
+ \db, -26,
+ \out, ~busOne,
+)).quant_(8).stop;
+)
+
+~busOne = Bus.audio(s, 2);
+~groupReverb = Group.new(s, \addToTail);
+
+~reverbSynth.free;
+~reverbSynth = Synth(\reverb, [\in, ~busOne, \out, 0], ~groupReverb);
+~reverbSynth.set(\mix, 0.9);
\ No newline at end of file
--- /dev/null
+(
+~mix = MidiMix();
+~se = Sampler();
+)
+
+(
+~mix.cue_ {|down|
+ if (down) {
+ ~se.startRec();
+ ~mix.led(\cue, \on);
+ } {
+ ~se.stopRec();
+ ~mix.led(\cue, \off);
+ };
+};
+
+~mix.play_ {|down|
+ if (down) {
+ ~se.playSample();
+ ~mix.led(\play, \on);
+ } {
+ ~se.stopPlay();
+ ~mix.led(\play, \off);
+ };
+};
+
+~fine = 0.1;
+~coarse = 0.1;
+~fineActive = false;
+
+~mix.but1_{|d|
+ if (d) {
+ ~fineActive = ~fineActive.not;
+ ~mix.led(\but1, ~fineActive);
+ };
+};
+
+~mix.rot1_{|v|
+ var delta = v * ~coarse;
+ if (~fineActive) {
+ delta = delta * ~fine;
+ };
+ ~se.shiftPos(delta);
+ ~se.startPos.postln;
+};
+
+// granular
+~mix.again_{|v|
+ ~amp = v;
+ ~gran.set(\amp, ~amp);
+ "amp is %f".format(~amp).postln;
+};
+
+~mix.rotload_{|d|
+ var mul = 1.1;
+ if (d < 0) {mul = 1/mul; d = d.neg};
+ d.do{
+ ~density = ~density * mul;
+ };
+ ~gran.set(\density, ~density);
+ "density is %".format(~density).postln;
+};
+
+~mix.rot2_{|d|
+ var mul = 1.1;
+ if (d < 0) {mul = 1/mul; d = d.neg};
+ d.do{
+ ~len = ~len * mul;
+ };
+ ~gran.set(\len, ~len);
+ "len is %".format(~len).postln;
+};
+
+~mix.bfade_{|v|
+ ~rate = v.linexp(0, 1, 1/4, 4);
+ ~gran.set(\rate, ~rate);
+ "rate is %".format(~rate).postln;
+};
+
+~mix.jogrot_{|d|
+ var mul = 0.001;
+ ~pos = ~pos + (d*mul);
+ ~gran.set(\pos, ~pos);
+ "pos is %".format(~pos).postln;
+};
+)
+
+(
+Pdef(\samploop, Pbind(*[
+ db: -5,
+ dur: 2,
+ midinote: 57,
+]) <> ~se.makeSynthBind).quant_(2).stop;
+)
+
+(
+SynthDef(\granular, {|out=0, amp=1, buf=0, density=10, len=0.1, rate=1, pos=0|
+ var sig;
+ sig = GrainBuf.ar(1, Dust.ar(density), len, buf, rate, pos+LFNoise2.ar().range(0, len/1000), 4, 0, -1, 1024, amp);
+ Out.ar(out, sig!2);
+}).add;
+)
+
+(
+~amp = 1;
+~density = 10;
+~len = 0.1;
+~rate = 1;
+~pos = 0;
+~gran = Synth(\granular, [
+ amp: ~amp,
+ buf: ~se.buf,
+ density: ~density,
+ len: ~len,
+ rate: ~rate,
+ pos: ~pos
+]);
+)
+
+~gran.free;
\ No newline at end of file
--- /dev/null
+~ke = MidiRemote25SL(\kedifu);
+~mi = MidiMix101(\mix);
+
+(
+SynthDef(\zuFader, {|in, amp=1.0, mix=0.0, room=0.5, damp=0.5, out=0|
+ var sig;
+ sig = In.ar(in, 2);
+ sig = FreeVerb2.ar(sig[0], sig[1], mix, room, damp, amp);
+ Out.ar(out, sig);
+}).add;
+)
+
+(
+// Multitrack class
+/*
+~trackFactory = {
+ (
+ name: \mumy,
+ def:
+ )
+};
+*/
+
+~trackerFactory = {
+ (
+ tracks: [\lonu, \fose, \ziba, \pepo, \kaco, \xehi, \puso, \nuhu],
+ groups: Array(8),
+ buses: Array(8),
+ faders: Array(8),
+
+ init: {|self|
+ self.sourceGroup = Group();
+ self.faderGroup = Group.after(self.sourceGroup);
+ self.kedifu = MidiRemote25SL(\kedifuTracker, reveal: false);
+ self.sasihu = MidiMix101(\sasihuTracker, reveal: false);
+ self.selected = 0;
+ self.tracks.do{|k, i|
+ var group, bus, fader;
+ Pdef(k).endless;
+ self[k] = Pdef(k);
+ self[(k ++ \_).asSymbol] = {|self, f| Pdef(k, f)};
+ group = Group(self.sourceGroup);
+ self.groups.add(group);
+ bus = Bus.audio(numChannels: 2);
+ self.buses.add(bus);
+ Pdef(k).set(\group, group, \out, bus);
+ fader = Synth(\zuFader, [in: bus, out: 0], self.faderGroup);
+ self.faders.add(fader);
+ };
+ self.kedifu.fader_{|v, n|
+ self.faders[n].bindRange(\amp, -60.dbamp, 0.dbamp).value(v);
+ };
+ self.kedifu.lowrot_{|v, n|
+ self.faders[n].bindRange(\mix, 0, 1).value(v);
+ };
+ self.kedifu.butlr_{|v, n|
+ if (v) {
+ self.selected = n;
+ self.sasihu.afade = self.faders[self.selected].bindRange(\room, 0, 1);
+ self.sasihu.bfade = self.faders[self.selected].bindRange(\damp, 0, 1);
+ "% selected\n".postf(self.tracks[self.selected]);
+ };
+ };
+
+ self
+ },
+ )
+};
+)
+
+// test
+
+(
+~tracker = ~trackerFactory.value.init;
+
+~tracker.lonu_{
+ Pbind(*[
+ instrument: \naje,
+ db: Pwhite(-9, -6!2),
+ dur: Prand((1!43)++(2!14)++(3!51)++(4!31), inf)/4,
+ pan: Pwhite(-0.7, 0.7!2, inf),
+ scale: Scale.nahawand,
+ octave: Pseq([2, 2, 2, 3, 3, 2, 3, 4, 3, 4], inf) + [2, 6],
+ degree: Pseq([0, 4, 5, 7, 6, 1], inf),
+ legato: Pwhite(0.8, 1.3!2, inf),
+ cut: Pwhite(600, 900!2),
+ rez: Pwhite(0.7, 0.9!2),
+ modFreqMin: Pwhite(6, 8!2),
+ modFreqMax: Pwhite(11, 13!2),
+ modAmp: Pwhite(0.01, 0.02!2),
+ ])
+}.quant_(7).play;
+
+~tracker.fose_{
+ Pbind(*[
+ instrument: \leto,
+ db: -1,
+ dur: Prand([1, 2, 3], inf)/2,
+ pan: Pwhite(-0.4, 0.4, inf),
+ scale: Scale.nahawand,
+ octave: Pxrand([3, 4, 5, 6, 7], inf),
+ degree: [0, 4],
+ legato: Pwhite(0.5, 0.9, inf),
+ ])
+}.quant_(7).play;
+
+~tracker.ziba_{
+ Pbind(*[
+ instrument: \zuqy,
+ db: -5,
+ dur: Prand([1, 2, 3, 4], inf)/4,
+ pan: Pwhite(-0.4, 0.4, inf),
+ scale: Scale.nahawand,
+ octave: Pxrand([2], inf),
+ degree: Prand((0..12), inf),
+ legato: Pwhite(0.2, 0.7, inf),
+ distort: 150.0,
+ ])
+}.quant_(7).play;
+
+~tracker.pepo_{
+ Pbind(*[
+ instrument: \xaxa,
+ db: -5,
+ dur: Prand([1, 2, 3, 4], inf)/1,
+ pan: Pwhite(-0.4, 0.4, inf),
+ scale: Scale.nahawand,
+ octave: Pxrand([2], inf),
+ degree: Prand((0..12), inf),
+ legato: Pwhite(0.3, 0.6, inf),
+ feedbackAmp: 0.2,
+ feedbackRate: 3,
+ detuneAmp: 0.1,
+ detuneRate: 2,
+ ])
+}.quant_(7).play;
+
+~tracker.kaco_{
+ Pmono(\liwe, *[
+ db: -10,
+ trig: 1,
+ dur: Pseq([1, 2, 1, 2, 3, 2, 1, 2], inf)/4,
+ pan: Pwhite(-0.1, 0.1, inf),
+ tension: 0.001 + (0.017 * Pkey(\dur)),
+ loss: 0.99992,
+ impact: 0.1,
+ ])
+}.quant_(7).play;
+
+~tracker.xehi_{
+ Pbind(*[
+ instrument: \neta,
+ db: -19,
+ dur: Pseq([1, 2, 1, 1, 1, 0.5, 1/4, 1/8, 1/8], inf),
+ scale: Scale.nahawand,
+ octave: Pxrand([Pseq(2!3), Pseq(3!3), Pseq(4!3)], inf),
+ degree: Pxrand([0, 2, 4, 5, 7], inf) + [0, 2, 4],
+ legato: Pwhite(0.2, 0.6, inf),
+ ])
+}.quant_(7).play;
+)
\ No newline at end of file
--- /dev/null
+(
+//======== Busses
+// speakers
+~spik = 0;
+
+// headphones
+~phon = 2;
+
+// recording
+~bare = Bus.audio(s, 2);
+
+// effect
+~bafe = Bus.audio(s, 2);
+
+a = { [2r10010, 2r101011, 2r11100].choose.postln };
+b = a >> 2;
+b.value.asBinaryDigits.join;
+
+
+//======== Groups
+// sources
+~guso = Group.new(s);
+
+// recording
+~gu
+
+~gure = Group.new(~guSources, \addAfter);
+
+~tempo
+)
\ No newline at end of file
--- /dev/null
+//=============================================================================
+// test midi
+//=============================================================================
+(
+~kedi = MidiRemote25SL();
+~push = MidiPush();
+~peda = MidiPedals();
+)
+
+(
+Pdef(\test, Pbind(*[
+ dur: 1,
+ db: -17,
+])).quant_(1).play;
+)
+
+(
+TempoClock.play({|beats, time, clock|
+ ~push.syncTempo_(false);
+ [beats, time, clock].postln;
+}, 1);
+)
+
+(
+~kedi.tempo_{|v|
+ TempoClock.tempo = v / 60;
+ v.postln;
+};
+)
+
+~push.ledPad(0, 0, color: -60);
+~push.ledPadOff;
+~push.ledButlo(2, color: 5, light: 3, mode: 0);
+~push.ledButup(2, \off, true, \always);
+~push.ledButton(\play, \off);
+~push.ledButton(\d14t, \lime, true);
+
+//=============================================================================
+
+(
+~same = Sampler();
+~kedi = MidiRemote25SL();
+~push = MidiPush();
+~peda = MidiPedals();
+~samtrig = MidiSampler(~push, ~peda, ~same, false);
+~keys = KeySynth(~kedi, ~same.synthdefName, 1, true, {~same.makeSynthArgs});
+~pads = PadSynth(~push, ~same.synthdefName, 1, true, {~same.makeSynthArgs});
+)
+
+~keys.amp = 3;
+
+//=========================== scale experiments
+
+(
+//(note: 9, octave: 5).play;
+~se2.startRec;
+)
+~se2.stopRec;
+
+~se2.shiftPos(0.05);
+~se2.duration = ~se.duration - 1;
+~se2.playSample;
+Scale
+Tuning.directory
+(0..12).collect(_ * (3 ** (1/13)))
+~tun = Tuning.new((0..12).collect(_ * (12*(3 ** (1/13)).log2)), 3, "tritave");
+~scale = Scale.chromatic(~tun);
+
+(
+Pdef(\sampe, ~se.makeSynthBind <> Pbind(
+ \scale, ~scale,
+ \octave, 5,
+ \note, Pseq([[0, -7]]++(9!8), inf),
+ \dur, 3,
+ \db, -10,
+)).quant_(9).stop;
+)
+(
+Pdef(\sampo, ~se.makeSynthBind <> Pbind(
+ \scale, ~scale,
+ \octave, 5,
+ \note, Pxrand([2, 5, 8, 11], inf),
+ \dur, 1,
+ \db, -20,
+ \timingOffset, 1/3,
+)).quant_(9).stop;
+)
+(
+Pdef(\sampi, ~se.makeSynthBind <> Pbind(
+ \scale, ~scale,
+ \octave, 7,
+ \note, Pxrand((1,3..12), inf),
+ \dur, 1,
+ \db, -30,
+ \timingOffset, 1/6,
+)).quant_(9).stop;
+)
+
+TempoClock.tempo = 2;
+(
+Pdef(\teste, Pbind(
+ \dur, 1
+)).stop;
+)
+~se2 = ~samplerFactory.value;
+(
+Pdef(\samia, ~se.makeSynthBind <> Pbind(
+ \scale, ~scale,
+ \octave, 5,
+ \note, Pseq((0..12)++(11..1) +.t [0, 7], inf),
+ \dur, 4,
+ \db, -1,
+ \timingOffset, 0,
+)).quant_(4).stop;
+)
+
+(
+Pdef(\samei, ~se2.makeSynthBind <> Pbind(
+ \scale, ~scale,
+ \octave, 5,
+ \note, Pseq((0..12)++(11..1) +.t [0, 3], inf),
+ \dur, 3,
+ \db, -15,
+ \timingOffset, 0,
+)).quant_(4).stop;
+)
+
+{SinOsc.ar(440, mul: 0.2)}.play
+
+(
+s.waitForBoot{
+ SSampler(\reel).load([Quarks.folder ++ "/SuperSampler/Testcode/Sounds/Reel Palindruome_44.1kHz_int16.aiff"]);
+}
+)
+
+//=============================================================================
+[ 0, 1, 3, 5, 7, 8, 10 ]+2
+~kedi = MidiRemote25SL();
+~kedi2 = MidiRemote25SL(\kedi2);
+
+~monokeys = KeySynthRelative(~kedi);
+~monokeys.synthName = \dyti;
+~monokeys.bendRadius = 0.2;
+~monokeys.centerKey = 67;
+~monokeys.intervals = #[2, 5, 7];
+
+~monokeys.params[\modAmp] = 0.0;
+(
+~kedi.press_{|v|
+ var val = v * 0.02;
+ ~monokeys.group.set(\modAmp, val);
+ ~monokeys.params[\modAmp] = val;
+};
+)
+
+~monokeys2 = KeySynthRelative(~kedi2, centerKey: 52, intervals: #[2, 3]);
+~monokeys2.amp = 2;
+~monokeys2.synthName = \pope;
+~monokeys2.bendRadius = 0.2;
+~monokeys.intervals = #[2, 5, 7];
+
+//=============================================================================
+
+~kedi = MidiRemote25SL();
+[ 0, 2, 8, 10, 14, 18, 20 ]/2
+[ 0.0, 2.0, 4.0, 5.0, 7.0, 8.0, 11.0 ].do{|e, i| };
+
+~geshude = Scale([0, 2, 4, 5, 7, 9, 10], 12, tuning: Tuning.et12);
+~integral = Scale([0, 2, 3, 7, 8, 10], 12, tuning: Tuning.et12);
+
+todi: Scale([ 0, 1, 3, 6, 7, 8, 11 ], 12, Tuning.et12)
+
+(
+~keys = KeySynth(~kedi, \dyti, 1, true, nil, 0.2, nil, false);
+~keys.amp = 0.5;
+~keys.synthName = \dyti;
+~keys.onlyWhite = true;
+~keys.scale = Scale.todi;
+~keys.params[\modAmp] = 0.0;
+~kedi.press_{|v|
+ var val = v * 0.02;
+ ~keys.group.set(\modAmp, val);
+ ~keys.params[\modAmp] = val;
+};
+)
+
+[ D, E, F, G, A, A#, C# ]
+
+Scale.nahawand
\ No newline at end of file
--- /dev/null
+(
+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;
+
+//====
+
+(
+SynthDef(\eoau, { |out=0, amp=1, freq=440, gate=1|
+ var modFreq, sig, env;
+ env = EnvGen.ar(Env.adsr(releaseTime: 0.2), gate, doneAction: 2);
+ modFreq = Pulse.ar((freq**(1/2))*env, mul: env*freq/4, add: freq);
+ sig = Saw.ar(modFreq) * Pulse.ar(modFreq) * SinOsc.ar(freq) * amp;
+ sig = sig * env;
+ sig = Pan2.ar(sig, Rand(-0.5, 0.5));
+ Out.ar(out, sig);
+}).add;
+)
+
+TempoClock.tempo = 90 / 60;
+
+(
+Pdef(\asui, Pbind(
+ \instrument, \eoau,
+ \dur, Pseq([1, 1].normalizeSum / 4, inf),
+ \db, -1,
+ \octave, 2,
+ \note, 0,
+ \legato, Pwhite(0.1, 0.2),
+)).quant_(4).stop;
+)
+
+(
+Pdef(\sodi, Pbind(
+ \instrument, \eoau,
+ \dur, Pseq([1, 1, 1].normalizeSum * 4, inf),
+ \db, -22,
+ \octave, Prand([5, 6], inf),
+ \note, Prand([
+ Pseq([9, 7, 19, 12, 7, 4, 2], 1),
+ Pseq([7, 4, 7, 2], 1),
+ ], inf),
+ \legato, Pwhite(2.8, 4.2),
+)).quant_(4).stop;
+)
+
+(
+Pdef(\osud, Pbind(
+ \instrument, \eoau,
+ \dur, Pseq((1!7).normalizeSum/4, inf),
+ \db, -55,
+ \octave, 7,
+ \note, Prand([9, 7, 16, 12, 7, 4], inf),
+ \legato, 0.5,
+)).quant_(4).stop;
+)
+
+(
+Pdef(\saau, Pbind(
+ \instrument, \eoau,
+ \dur, Pgeom(1, 0.9, 50),
+ \db, -25,
+ \octave, 4,
+ \note, Prand([2, 5, 9, 12], inf),
+ \legato, 1,
+)).quant_(4).stop;
+)
--- /dev/null
+~se = ~samplerFactory.value;
+(
+//(note: 9, octave: 5).play;
+~se.startRec;
+)
+~se.stopRec;
+
+~se.shiftPos(0.05);
+~se.duration = ~se.duration + 0.2;
+~se.playSample;
+
+(
+Pdef(\stae, Pbind(
+ \octave, Pxrand([3, 4], inf),
+ \note, Prand([0, 2, 4], inf),
+ \dur, Pwrand([
+ Pseq([1], 1),
+ Pseq(0.5!2, 1),
+ Pseq(0.25!4, 1),
+ ], [1, 1, 1].normalizeSum, inf),
+ \db, -3,
+ \duration, Pwhite(0.1, 0.2),
+) <> ~se.makeSynthBind).quant_(4).stop;
+)
+
+(
+Pdef(\steio, Pbind(
+ \octave, 5,
+ \note, Prand([0, 2, 4, 7, 9], inf),
+ \dur, Pwrand([
+ Pseq([3, 3, 2]/2, 1),
+ ], [1].normalizeSum, inf),
+ \db, -15,
+ \duration, Pwhite(0.5, 2),
+ \startpos, Pwhite(1, 2.0),
+) <> ~se.makeSynthBind).quant_(4).stop;
+)
+
+TempoClock.tempo = 2;
\ No newline at end of file
+++ /dev/null
-
-TempoClock.tempo = 240 / 60;
-
-~beri = ~bcrFactory.value;
-
-(
-~curNote = 60;
-~steps = (0..15);
-~intervalWeights = [1]++(0!15);
-~freqHigh = 3200;
-~freqLow = 200;
-~chorus = (0..15);
-~chorusWeights = [1]++(0!15);
-
-~durs = (1..8);
-~durWeights = (0!7) ++ [1];
-
-~legatos = (1..8)/8;
-~legatoWeights = (0!7) ++ [1];
-
-~decibels = [110, 100, 90, 80, 70, 60, 40, 20];
-~decibelWeights = [1] ++ (0!7);
-
-~pnotes = Pfunc({
- var direction, step, upWeight, downWeight, chorus, curFreq;
- upWeight = 1;
- downWeight = 1;
- curFreq = ~curNote.midicps;
- if (curFreq > ~freqHigh, {downWeight = curFreq/~freqHigh;});
- if (curFreq < ~freqLow, {upWeight = ~freqLow/curFreq;});
- direction = [-1, 1].wchoose([downWeight**3, upWeight**3].normalizeSum);
- step = ~steps.wchoose(~intervalWeights.normalizeSum);
- ~curNote = ~curNote + (step * direction);
- chorus = ~chorus.wchoose(~chorusWeights.normalizeSum);
- [~curNote, ~curNote+chorus];
-});
-
-~pdurs = Pfunc({
- var dur;
- dur = ~durs.wchoose(~durWeights.normalizeSum);
- dur;
-});
-
-~plegatos = Pfunc({
- var legato;
- legato = ~legatos.wchoose(~legatoWeights.normalizeSum);
- legato;
-});
-
-~pdecibel = Pfunc({
- var decibel;
- decibel = ~decibels.wchoose(~decibelWeights.normalizeSum);
- decibel;
-});
-)
-
-(
-~beri.turn = {|zi, val, num|
- num.postln;
- if (num <= 16, {
- ~intervalWeights[num-1] = val;
- ("interval "++~steps[num-1]++" weight changed to "++val).postln;
- });
- if ((num >= 17) && (num <= 32), {
- ~chorusWeights[num-17] = val;
- ("chorus "++~chorus[num-17]++" weight changed to "++val).postln;
- });
- if ((num >= 81) && (num <= 88), {
- ~durWeights[num-81] = val;
- ("duration "++~durs[num-81]++" weight changed to "++val).postln;
- });
- if ((num >= 89) && (num <= 96), {
- ~legatoWeights[num-89] = val;
- ("legato "++~legatos[num-89]++" weight changed to "++val).postln;
- });
- if ((num >= 97) && (num <= 104), {
- ~decibelWeights[num-97] = val;
- ("decibel "++~decibels[num-97]++" weight changed to "++val).postln;
- });
-};
-)
-
-(
-Pdef(\qeka, ~de.feja <> Pbind(*[
- midinote: ~co.bass,
- dur: Pseq([5, 3], inf),
- db: -19 + Pseq([-2, -3], inf),
-])).quant_(8).stop;
-)
-
-(
-Pdef(\maka, ~de.feja <> Pbind(*[
- midinote: ~co.snare,
- dur: Pseq([Rest(2), 4, 2], inf),
- db: -29,
-])).quant_(8).stop;
-)
-
-(
-Pdef(\gitu, ~de.feja <> Pbind(*[
- midinote: ~co.hatclosed,
- dur: Pwrand([
- Pseq(2!4, 1),
- Pseq(1!8, 1),
- Pseq(0.5!16, 1),
- ], [15, 5, 1].normalizeSum, inf),
- db: -32,
-])).quant_(8).stop;
-)
-
-(
-Pdef(\huzi, ~de.feja <> Pbind(*[
- midinote: ~co.clap,
- dur: 32/3 * Pwrand([
- Pseq(1!3, 1),
- Pseq(0.5!6, 1),
- ], [5, 2].normalizeSum, inf),
- db: -59,
-])).quant_(8).stop;
-)
-
-(
-Pdef(\xula, ~de.feja <> Pbind(*[
- midinote: Prand([~co.side, ~co.rim, ~co.tomfloor, ~co.tomlow, ~co.tomhigh, ~co.hatopen, ~co.cowbell, ~co.ride, ~co.ccrash, ~co.ride2, ~co.splash, ~co.hatsemiopen], inf),
- dur: 4 * Prand([2, 3, 4], inf),
- db: -37,
-])).quant_(8).stop;
-)
-
-(
-Pdef(\rulu, ~de.dufe <> Pbind(
- \midinote, ~pnotes.trace,
- \dur, ~pdurs/2,
- \legato, ~plegatos,
- \amp, ~pdecibel/127,
-)).quant_(8).stop;
-)
-
-(
-Pdef(\dipo, ~de.dufe <> Pbind(
- \midinote, ~pnotesLow-24,
- \dur, ~pdursLow*3/2,
- \legato, ~plegatosLow,
- \amp, ~pdecibelLow/127,
-)).quant_(8).stop;
-)
-
-(
-~curNoteLow = 60;
-
-~pnotesLow = Pfunc({
- var direction, step, upWeight, downWeight, chorus, curFreq;
- upWeight = 1;
- downWeight = 1;
- curFreq = ~curNoteLow.midicps;
- if (curFreq > ~freqHigh, {downWeight = curFreq/~freqHigh;});
- if (curFreq < ~freqLow, {upWeight = ~freqLow/curFreq;});
- direction = [-1, 1].wchoose([downWeight**3, upWeight**3].normalizeSum);
- step = ~steps.wchoose(~intervalWeights.normalizeSum);
- ~curNoteLow = ~curNoteLow + (step * direction);
- chorus = ~chorus.wchoose(~chorusWeights.normalizeSum);
- [~curNoteLow, ~curNoteLow+chorus];
-});
-
-~pdursLow = Pfunc({
- var dur;
- dur = ~durs.wchoose(~durWeights.normalizeSum);
- dur;
-});
-
-~plegatosLow = Pfunc({
- var legato;
- legato = ~legatos.wchoose(~legatoWeights.normalizeSum);
- legato;
-});
-
-~pdecibelLow = Pfunc({
- var decibel;
- decibel = ~decibels.wchoose(~decibelWeights.normalizeSum);
- decibel;
-});
-)
-
-(
-Pdef(\heri, ~de.dufe <> Pbind(
- \midinote, ~pnotesMid-12,
- \dur, ~pdursMid,
- \legato, ~plegatosMid,
- \amp, ~pdecibelMid/127,
-)).quant_(8).stop;
-)
-
-(
-~curNoteMid = 60;
-
-~pnotesMid = Pfunc({
- var direction, step, upWeight, downWeight, chorus, curFreq;
- upWeight = 1;
- downWeight = 1;
- curFreq = ~curNoteMid.midicps;
- if (curFreq > ~freqHigh, {downWeight = curFreq/~freqHigh;});
- if (curFreq < ~freqLow, {upWeight = ~freqLow/curFreq;});
- direction = [-1, 1].wchoose([downWeight**3, upWeight**3].normalizeSum);
- step = ~steps.wchoose(~intervalWeights.normalizeSum);
- ~curNoteMid = ~curNoteMid + (step * direction);
- chorus = ~chorus.wchoose(~chorusWeights.normalizeSum);
- [~curNoteMid, ~curNoteMid+chorus];
-});
-
-~pdursMid = Pfunc({
- var dur;
- dur = ~durs.wchoose(~durWeights.normalizeSum);
- dur;
-});
-
-~plegatosMid = Pfunc({
- var legato;
- legato = ~legatos.wchoose(~legatoWeights.normalizeSum);
- legato;
-});
-
-~pdecibelMid = Pfunc({
- var decibel;
- decibel = ~decibels.wchoose(~decibelWeights.normalizeSum);
- decibel;
-});
-)
-
+++ /dev/null
-// Init
-// TODO: move into classes or startup
-
-(
-~co = Environment[
- // drumkit midi mappings
- \bass -> 36,
- \side -> 37,
- \snare -> 38,
- \clap -> 39,
- \rim -> 40,
- \tomfloor -> 41,
- \hatclosed -> 42,
- \tomlow -> 43,
- \hatpedal -> 44,
- \tomhigh -> 45,
- \hatopen -> 46,
- \cowbell -> 47,
- \ride -> 48,
- \ccrash -> 49,
- \ride2 -> 50,
- \splash -> 51,
- \hatsemiopen -> 52,
- \bell -> 53,
-];
-~co.know = true;
-
-//=== MIDI setup
-MIDIClient.init;
-MIDIIn.connectAll;
-MIDIClient.destinations.do({ arg item;
- switch (item.device,
- "amsynth",
- { ~co.outAmsynth = MIDIOut(0, item.uid); },
- "Hydrogen",
- { ~co.outHydrogen = MIDIOut(0, item.uid); },
- "LinuxSampler",
- { ~co.outLinuxSampler = MIDIOut(0, item.uid); }
- );
-});
-
-//=== Beat patterns
-~bi = Environment[
- // plain dnb
- \koxa -> Pbind(
- \midinote,
- Pseq([~co.bass, ~co.snare], 2),
- \dur,
- Pseq([1, 1.5 , 0.5, 1]),
- ),
-];
-~bi.know = true;
-
-//=== Device patterns
-~de = Environment[
- // amsynth
- \sowu -> Pbind(
- \type, \midi,
- \midiout, ~co.outAmsynth,
- \midicmd, \noteOn,
- \chan, 1,
- ),
-
- // Hydrogen
- \feja -> Pbind(
- \type, \midi,
- \midiout, ~co.outHydrogen,
- \midicmd, \noteOn,
- \chan, 1,
- ),
-
- // linuxsampler
- \dufe -> Pbind(
- \type, \midi,
- \midiout, ~co.outLinuxSampler,
- \midicmd, \noteOn,
- \chan, 1,
- ),
-];
-~de.know = true;
-
-"Ҙыԃегы кёԋю жуҫище дёҏеке".postln;
-)
-
-// input
-
-(
-SynthDef(\mixer, {|in=0, out=0, amp=1|
- var sig = SoundIn.ar([in, in+1], amp);
- Out.ar(out, sig)
-}).add;
-
-SynthDef(\echo, {|in=0, out=0|
- var sig, rev;
- sig = In.ar(in, 2);
- rev = JPverb.ar(sig, t60: 1.0, damp: 0.0, size: 1.0, earlyDiff: 0.707, modDepth: 0.1, modFreq: 2.0, low: 1.0, mid: 1.0, high: 1.0, lowcut: 500.0, highcut: 2000.0);
- Out.ar(out, sig+rev);
-}).add;
-)
-
-~sources = Group.new;
-~effects = Group.new(addAction: \addToTail);
-
-~sourceBus = Bus.audio(s, 2);
-
-//~micInput = Synth(\mixer, [in: 0,
-~drumInput = Synth(\mixer, [in: 2], ~sources);
-~pianoInput = Synth(\mixer, [in: 4], ~sources);
-~amsynthinput = Synth(\mixer, [in: 6], ~sources);
-~sources.set(\out, ~sourceBus);
-
-~echo = Synth.new(\echo, [in: ~sourceBus], ~effects);
-
-// beats
-
-TempoClock.tempo = 2;
-
-(
-Pdef(\qixu, Pbind(*[
- midinote: ~co.bass,
- dur: Pseq([4, 4, 4, 2, 1, 1].normalizeSum*4, inf),
- db: -7,
-]) <> ~de.feja).quant_(4).stop;
-)
-
-(
-Pdef(\rodi, Pbind(*[
- midinote: Prand([~co.snare, ~co.rim], inf),
- dur: Pseq([Rest(0.2), 4, 4, 4, 2, 1, 0.8]/4, inf),
- db: Pwhite(-20, -15, inf),
-]) <> ~de.feja).quant_(4).stop;
-)
-
-(
-Pdef(\cubu, Pbind(*[
- midinote: Prand([~co.hatclosed, ~co.hatpedal], inf),
- dur: Prewrite(1, [
- 1: [1, 2, 3],
- 2: [3, 2, 1],
- 3: [1, 2, 1],
- ], 6)*3/16,
- db: Pwhite(-20, -17, inf),
-]) <> ~de.feja).quant_(4).stop;
-)
-
-(
-Pdef(\gofu, Pbind(*[
- midinote: Prand([53, 60, 67, 74], inf)+Prand([12], inf),
- dur: Prewrite(2, [
- 1: [1, 2, 3],
- 2: [3, 2, 1],
- 3: [1, 2, 1],
- ], 7)*3/16,
- db: Pwhite(-7, -10, inf),
- legato: Phprand(0.5, 0.9, inf),
-]) <> ~de.dufe).quant_(4).stop;
-)
\ No newline at end of file
+++ /dev/null
-
-TempoClock.tempo = 1.5;
-
-(
-Pdef(\ritm, Pmono(\liwe, *[
- dur: Pwrand([
- Pseq([1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([1, 1, 1, 1, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([4, 2, 2, 2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([3, 3, 2, 3, 2, 3].normalizeSum*4, 1),
- Pseq([3, 3, 2, 2, 3, 3].normalizeSum*4, 1),
- Pseq([3, 3, 2, 3, 3, 2].normalizeSum*4, 1),
- Pseq([2, 1, 2, 1, 4, 2, 2, 2].normalizeSum*4, 1),
- Pseq([3, 3, 2, 2, 1, 1, 1/2, 1/2, 1/2, 1/2, 2].normalizeSum*4, 1),
- ], [5, 2, 1, 1, 2, 2, 2, 1, 1].normalizeSum, inf),
- db: -21,
- pan: Pwhite(-0.5, 0.5),
- t_trig: Pwrand([1, 0], [15, 1], inf),
- tension: 0.006/(Pkey(\dur)**0.4)*Pwhite(0.95, 1.05),
- loss: Plprand(0.9999, 0.99995, inf),
-])).quant_(4).stop;
-)
-
-(
-Pdef(\ritm2, Pmono(\qoba, *[
- dur: Pwrand([
- Pseq([1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([1, 1, 1, 1, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([4, 2, 2, 2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([3, 3, 2, 3, 2, 3].normalizeSum*4, 1),
- Pseq([3, 3, 2, 2, 3, 3].normalizeSum*4, 1),
- Pseq([3, 3, 2, 3, 3, 2].normalizeSum*4, 1),
- Pseq([2, 1, 2, 1, 4, 2, 2, 2].normalizeSum*4, 1),
- Pseq([3, 3, 2, 2, 1, 1, 1/2, 1/2, 1/2, 1/2, 2].normalizeSum*4, 1),
- ], [5, 2, 1, 1, 2, 2, 2, 1, 1].normalizeSum, inf),
- db: 15,
- pan: Pwhite(-0.5, 0.5),
- trig: Pwrand([1, 0], [15, 1], inf),
- accent: 0.3,
- freq: Pexprand(40, 80),
- tone: 0.01,
- decay: 0.2,
- attackfm: 0.15,
- selffm: 0.6,
-])).quant_(4).stop;
-)
-
-(
-Pdef(\ritm3, Pmono(\buti, *[
- dur: Pwrand([
- Pseq([1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([1, 1, 1, 1, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([4, 2, 2, 2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([3, 3, 2, 3, 2, 3].normalizeSum*4, 1),
- Pseq([3, 3, 2, 2, 3, 3].normalizeSum*4, 1),
- Pseq([3, 3, 2, 3, 3, 2].normalizeSum*4, 1),
- Pseq([2, 1, 2, 1, 4, 2, 2, 2].normalizeSum*4, 1),
- Pseq([3, 3, 2, 2, 1, 1, 1/2, 1/2, 1/2, 1/2, 2].normalizeSum*4, 1),
- ], [5, 2, 1, 1, 2, 2, 2, 1, 1].normalizeSum, inf),
- timingOffset: 1/2,
- db: -20,
- pan: Pwhite(-0.5, 0.5),
- trig: Pwrand([1, 0], [15, 1], inf),
- accent: 0.5,
- freq: Pexprand(40, 160),
- tone: 0.1,
- decay: Pwhite(0.1, 0.5),
- snappy: Pwhite(0.1, 0.9),
-])).quant_(4).stop;
-)
-
-(
-Ndef(\stormofkicks, {
- var trig = Impulse.kr(8);
- var sig = AnalogBassDrum.ar(
- trig,
- infsustain: 0.0,
- accent: 0.25,
- freq: TExpRand.kr(40,120, trig),
- tone: 0.0,//TRand.kr(0.5,1.0,trig),
- decay: 0.15,
- attackfm: 0.11,//TRand.kr(0.1,1.0,trig),
- selffm:TRand.kr(0.1,0.9,trig)
- );
-
- Pan2.ar(sig, TRand.kr(-1.0,1.0,trig));
-}).play;
-)
-
-{ Impulse.ar(5, 0.0, 0.5, 0) }.play
-
-(
-Pdef(\ritmbase, Pbind(*[
- type: \set,
- id: ~m.nodeID,
- \args, #[\t_trig, \tension, \loss, \amp],
- dur: Pseq([1, 1, 1, 1].normalizeSum*4, inf),
- db: -25,
- t_trig: 1,
- tension: 0.004,
- loss: 0.99995,
- timingOffset: 0.01,
-])).quant_(4).stop;
-)
-
-(
-{ var excitation = EnvGen.kr(Env.perc,
- MouseButton.kr(0, 1, 0),
- timeScale: 0.1, doneAction: 0
- ) * PinkNoise.ar(0.4);
- var tension = MouseX.kr(0.01, 0.1);
- var loss = MouseY.kr(0.999999, 0.999, 1);
- MembraneCircle.ar(excitation, tension, loss)!2;
-}.play;
-)
-
+++ /dev/null
-(
-SynthDef(\sisudi, {|out=0, gate=1, freq=440, amp=1, cut=800, rez=0.8,
- modFreqMin=7, modFreqMax=12, modAmp=0.01, release=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.asr(releaseTime: release), gate, doneAction: 2);
- sig = Pan2.ar(sig, Rand(-0.3, 0.3));
- Out.ar(out, sig * amp);
-}).add;
-
-SynthDef(\sileto, { |freq = 440, sustain = 1, amp=1, out=0|
- var sig = 0;
- var num = 26;
- var partial = 0;
- num.do({
- var pfact = ExpRand(1, 16);
- partial = SinOsc.ar(freq * pfact, Rand(0, 2pi)) / num / pfact;
- partial = partial * EnvGen.kr(Env.perc(0.03, Rand(sustain/5, sustain)));
- partial = Pan2.ar(partial, Rand(-0.5, 0.5));
- sig = sig + partial;
- });
- sig = sig * Line.kr(1, 1, sustain+0.1, doneAction: 2);
- Out.ar(out, sig*amp);
-}).add;
-
-SynthDef(\sipope, {|out=0, gate=1, freq=440, amp=1|
- var sig = 0;
- var num = 30;
- num.do({
- sig = sig + (LFPulse.ar(freq, Rand(0, 0.01), SinOsc.kr(SinOsc.kr(Rand(2, 8), 0, 2, 2), Rand(0, 2pi), 0.5, 0.5)) / num);
- });
- sig = sig * EnvGen.kr(Env.asr(0.03, 0.3, 1.8), gate, doneAction: Done.freeSelf);
- sig = Pan2.ar(sig, Rand(-0.2, 0.2), amp);
- Out.ar(out, sig);
-}).add;
-)
-
-~mix = MidiMix();
-
-(
-~mix.rot1_{|v|
- TempoClock.tempo = TempoClock.tempo * (1.01**v);
- TempoClock.tempo.postln;
-};
-)
-
-TempoClock.tempo = 89 / 60;
-
-~necoGr = Group.new();
-
-~efGr = Group.new(addAction: \addToTail);
-
-~efBus = Bus.audio(numChannels: 2);
-
-(
-Pdef(\neco, Pbind(*[
- instrument: \sisudi,
- db: Pwhite(-20, -15, inf)-26,
- octave: Prand([2, 3, 4], inf),
- note: Pxrand([0, 4, 9], inf),
- legato: 0.4,
- dur: Prand([1, 2, 3, 4]/4, inf),
- timingOffset: 0.0,
- group: ~necoGr,
-])).quant_(4).stop;
-)
-
-(
-Pdef(\dodi, Pbind(*[
- instrument: \sileto,
- db: Pwhite(-20, -15, inf),
- octave: Prand([2, 3, 4], inf),
- note: Pxrand([0, 4, 9], inf),
- legato: 0.7,
- dur: Prand([1], inf),
- timingOffset: 0.5,
- group: ~necoGr,
- out: ~efBus,
-])).quant_(4).stop;
-)
-
-(
-Pdef(\nadi, Pbind(*[
- instrument: \sipope,
- db: Pwhite(-20, -15, inf)-10,
- octave: Prand([2, 3, 4], inf),
- note: Pxrand([0, 4, 9], inf),
- legato: Pwhite(0.2, 0.8),
- dur: Prand([1, 2, 3, 4, 6]/2, inf),
- timingOffset: 0,
- group: ~necoGr,
- out: ~efBus,
-])).quant_(4).stop;
-)
-
-(
-SynthDef(\reverb, { | amp=1, in, out=0, mix=0.33, t60= 1.0, damp= 0.0, size= 1.0, earlyDiff= 0.707, modDepth= 0.1, modFreq= 2.0, low= 1.0, mid= 1.0, high= 1.0, lowcut= 500.0, highcut= 2000.0 |
- var sig, rev;
- sig = In.ar(in, 2);
- rev = JPverb.ar(sig, t60, damp, size, earlyDiff, modDepth, modFreq, low, mid, high, lowcut, highcut);
- sig = sig + (rev*mix);
- Out.ar(out, sig*amp);
-}).add;
-)
-
-~reverb = Synth(\reverb, [in: ~efBus], ~efGr);
-~reverb.free;
-
-(
-~mix.again_{|v|
- ~reverb.set(\mix, v);
- v.postln;
-};
-)
-
-(
-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(\paketo, Pbind(
- \instrument, Pseq([\siruse], inf),
- \octave, [2, 3, 4],
- \note, Pxrand([0, 2], inf),
- \dur, Pseq([3, 3, 2].normalizeSum, inf),
- \timingOffset, [0, 1/5, 2/5],
- \legato, [1, 4/5, 3/5]*0.2,
- \db, Pseq([-2], inf),
- \out, ~efBus,
- \group, ~necoGr,
-)).quant_(1).stop;
-)
\ No newline at end of file
+++ /dev/null
-TempoClock.tempo = 1;
-
-(
-Pdef(\bass1, Pbind(*[
- instrument: \dytu,
- release: 2.0,
- dur: 1 * 2,
- db: -12,
- octave: 2,
- cut: 200,
- rez: 0.9,
- note: Pseq([4, 4, 7], inf),
-])).quant_(3).stop;
-)
-
-(
-Pdef(\bass2, Pbind(*[
- instrument: \dytu,
- release: 1.0,
- dur: Pseq([2, 1, 1, 2].normalizeSum * 3, inf),
- db: -12,
- octave: 3,
- note: Pseq([4, 9, 5, 4], inf),
- cut: 400,
- rez: 0.9,
-])).quant_(3).stop;
-)
-
-(
-Pdef(\mid1, Pbind(*[
- instrument: \dytu,
- release: Pseq([0.6, 0.7, 1.0], inf),
- dur: Pseq([2, 3, 3].normalizeSum * 3, inf),
- db: -14,
- octave: 4,
- note: Pseq([9, 4, 0], inf),
- cut: 600,
- rez: 0.7,
-])).quant_(3).stop;
-)
-
-(
-Pdef(\mid2, Pbind(*[
- instrument: \dyti,
- release: 0.3,
- legato: 0.5,
- dur: Pseq([1, 1+(1/9), 1-(1/9)], inf),
- db: -27,
- octave: 5,
- note: Pseq([2, 2, 4, 4, 4, 2, 2, 2, 4, 9, 7, 2], inf),
- cut: 800,
- rez: 0.6,
-])).quant_(3).stop;
-)
-
-(
-Pdef(\mid3, Pbind(*[
- instrument: \dyti,
- release: 0.9,
- legato: 0.1,
- dur: Pseq([3, 3, 1, 3, 2].normalizeSum * 3 / 2, inf),
- db: -30,
- octave: 6,
- note: Pxrand([2, 4, 5, 7], inf),
- cut: 1000,
- rez: 0.5,
-])).quant_(3).stop;
-)
-
-(
-Pdef(\hi1, Pbind(*[
- instrument: \dytu,
- release: Pwhite(0.2, 0.4, inf),
- dur: Pseq([2, 2, 1, 3].normalizeSum * 3 / 8, inf),
- strum: 1/27,
- db: -41,
- octave: 7,
- note: Pxrand([2, 4, 5, 7], inf) + [0, 2, 5],
- cut: 1200,
- rez: 0.4,
-])).quant_(3).stop;
-)
-
-(
-Pdef(\hi2, Pbind(*[
- instrument: \dyti,
- release: 0.3,
- legato: 0.9,
- dur: Pseq([2, 1, 2, 1].normalizeSum * 3, inf),
- db: -42,
- octave: 8,
- note: Pxrand([0, 5, 7, 9], inf),
- cut: 1400,
- rez: 0.4,
-])).quant_(3).stop;
-)
-
-(
-Pdef(\hi3, Pbind(*[
- instrument: \dyti,
- release: 0.1,
- legato: 0.5,
- dur: Pseq([2, 1, 2, 1].normalizeSum * 3 / 4, inf),
- db: -31,
- octave: 9,
- note: Pxrand([0, 5, 7, 9], inf),
- cut: 1600,
- rez: 0.3,
-])).quant_(3).stop;
-)
-
-
-
+++ /dev/null
-~push = MidiPush();
-~push.midiout.latency_(0.2);
-
-~kedi = MidiRemote25SL();
-
-(
-~kedi.tempo_{|v|
- TempoClock.tempo = v / 60;
- v.postln;
-};
-
-TempoClock.play({|beats, time, clock|
- ~push.syncTempo_(true);
-}, 1);
-)
-
-// infinite pattern
-// ###
-// ###
-(
-~screen = Array2D.new(8, 8);
-8.do{|i|
- 8.do{|j|
- ~screen[i, j] = 1.rand;
- };
-};
-
-~draw = {|arr|
- 8.do{|i|
- 8.do{|j|
- ~push.ledPad(i, j, arr[i, j]*3);
- }
- };
-};
-)
-
-~draw.value(~screen);
-
-(
-~conway = IdentityDictionary[
- \arr -> Array2D.new(8, 8),
- \time -> 0,
- \init -> {|zi|
- 8.do{|i|
- 8.do{|j|
- zi.arr[i, j] = 0;
- };
- };
- },
- \get -> {|zi, i, j|
- i = i % 8;
- j = j % 8;
- zi.arr[i, j];
- },
- \nextGen -> {|zi|
- var arrcopy = zi.arr.deepCopy;
- 8.do{|i|
- 8.do{|j|
- var cur, sum;
- cur = zi.get(i, j);
- sum = 0;
- (-1..1).do{|k|
- (-1..1).do{|l|
- sum = sum + zi.get(i+k, j+l);
- };
- };
- sum = sum - cur;
- if (cur == 1) {
- if ((sum < 2) || (sum > 3)) {
- arrcopy[i, j] = 0;
- };
- } {
- if (sum == 3) {
- arrcopy[i, j] = 1;
- };
- };
- };
- };
- zi.arr = arrcopy;
- zi.time = zi.time + 1;
- }
-];
-~conway.know = true;
-~conway.init;
-)
-
-~conway.arr[1, 1] = 1;
-~conway.arr[2, 2] = 1;
-~conway.arr[1, 2] = 1;
-~conway.arr.postln;
-~conway.nextGen;
-
-(
-~eventGen = {|i, j, sum|
- var ev = nil;
- if (7.rand < 2) {
- ev = (
- instrument: [\dyti].choose,
- midinote: 24+(i*5)+(j*2),
- amp: 3/sum/(i+5),
- legato: 0.2,
- timingOffset: 3.rand/3// + 0.15
- )
- };
- ev;
-};
-)
-
-~sum = 0;
-
-~routine.stop;
-
-(
-~conway.init;
-~conway.arr[2, 0] = 1;
-~conway.arr[2, 1] = 1;
-~conway.arr[2, 2] = 1;
-~conway.arr[3, 2] = 1;
-~conway.arr[3, 3] = 1;
-~conway.arr[3, 4] = 1;
-/*
-8.do{|i|
-8.do{|j|
-~conway.arr[i, j] = 2.rand;
-};
-};
-*/
-~routine = {
- true.while{
- ~sum = ~conway.arr.sum;
- ~draw.value(~conway.arr);
- 8.do{|i|
- 8.do{|j|
- if (~conway.arr[i, j] == 1) {
- ~eventGen.value(i, j, ~sum).play;
- };
- };
- };
- 1.wait;
- ~conway.nextGen;
- };
-}.fork(quant: 1);
-)
-
-(
-~push.pad_{|d, v, c, r|
- ~conway.arr[r, c] = 1;
- ~push.ledPad(r, c, ~conway.arr[r, c]*3);
-};
-)
-
-~push.ledButton(\play, \brightBlink);
-
-(
-Pdef(\ritm, Pmono(\liwe, *[
- dur: Pwrand([
- Pseq([1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([1, 1, 1, 1, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([4, 2, 2, 2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([3, 3, 2, 3, 2, 3].normalizeSum*4, 1),
- Pseq([3, 3, 2, 2, 3, 3].normalizeSum*4, 1),
- Pseq([3, 3, 2, 3, 3, 2].normalizeSum*4, 1),
- Pseq([2, 1, 2, 1, 4, 2, 2, 2].normalizeSum*4, 1),
- Pseq([3, 3, 2, 2, 1, 1, 1/2, 1/2, 1/2, 1/2, 2].normalizeSum*4, 1),
- ], [5, 2, 1, 1, 2, 2, 2, 1, 1].normalizeSum, inf),
- db: -21,
- pan: Pwhite(-0.5, 0.5),
- t_trig: Pwrand([1, 0], [15, 1], inf),
- tension: 0.006/(Pkey(\dur)**0.4)*Pwhite(0.95, 1.05),
- loss: Plprand(0.9999, 0.99995, inf),
-])).quant_(4).stop;
-)
-
-(
-Pdef(\ritm2, Pmono(\qoba, *[
- dur: Pwrand([
- Pseq([1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([1, 1, 1, 1, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([4, 2, 2, 2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([3, 3, 2, 3, 2, 3].normalizeSum*4, 1),
- Pseq([3, 3, 2, 2, 3, 3].normalizeSum*4, 1),
- Pseq([3, 3, 2, 3, 3, 2].normalizeSum*4, 1),
- Pseq([2, 1, 2, 1, 4, 2, 2, 2].normalizeSum*4, 1),
- Pseq([3, 3, 2, 2, 1, 1, 1/2, 1/2, 1/2, 1/2, 2].normalizeSum*4, 1),
- ], [5, 2, 1, 1, 2, 2, 2, 1, 1].normalizeSum, inf),
- db: 15,
- pan: Pwhite(-0.5, 0.5),
- trig: Pwrand([1, 0], [15, 1], inf),
- accent: 0.3,
- freq: Pexprand(40, 80),
- tone: 0.01,
- decay: 0.2,
- attackfm: 0.15,
- selffm: 0.6,
-])).quant_(4).stop;
-)
-
-(
-Pdef(\ritm3, Pmono(\buti, *[
- dur: Pwrand([
- Pseq([1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([1, 1, 1, 1, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([4, 2, 2, 2, 2, 1, 1, 1, 1].normalizeSum*4, 1),
- Pseq([3, 3, 2, 3, 2, 3].normalizeSum*4, 1),
- Pseq([3, 3, 2, 2, 3, 3].normalizeSum*4, 1),
- Pseq([3, 3, 2, 3, 3, 2].normalizeSum*4, 1),
- Pseq([2, 1, 2, 1, 4, 2, 2, 2].normalizeSum*4, 1),
- Pseq([3, 3, 2, 2, 1, 1, 1/2, 1/2, 1/2, 1/2, 2].normalizeSum*4, 1),
- ], [5, 2, 1, 1, 2, 2, 2, 1, 1].normalizeSum, inf),
- timingOffset: 1/2,
- db: -20,
- pan: Pwhite(-0.5, 0.5),
- trig: Pwrand([1, 0], [15, 1], inf),
- accent: 0.5,
- freq: Pexprand(40, 160),
- tone: 0.1,
- decay: Pwhite(0.1, 0.5),
- snappy: Pwhite(0.1, 0.9),
-])).quant_(4).stop;
-)
+++ /dev/null
-// Ableton push handler
-// by Eugene Zuelum
-//
-// see https://github.com/Ableton/push-interface for info about ABI:
-// https://github.com/Ableton/push-interface/blob/master/doc/AbletonPush2MIDIDisplayInterface.asc
-
-(
-~bcrFactory = {
- var controler = Environment[
- \version -> "33.7.3.6",
-
- \channel -> 0,
- ];
-
- controler.know = true;
-
- MIDIdef.cc(\bcr2000defaultTurn, { |...args|
- controler.turn(*args);
- }, (1..110), controler.channel, 2621440);
-
- "Ԃиџуту готов к использованию 😊".postln;
-
- controler;
-};
-)
-
-//============================================================================= Testing
-
-/* Test incoming MIDI messages from push
-(
-MIDIdef.cc(\testcc, {|...args|
-(["cc"] ++ args).postln;
-});
-MIDIdef.noteOn(\testnoteon, {|...args|
-(["note on"] ++ args).postln;
-});
-MIDIdef.noteOff(\testnoteoff, {|...args|
-(["note off"] ++ args).postln;
-});
-MIDIdef.touch(\testtouch, {|...args|
-(["touch"] ++ args).postln;
-});
-MIDIdef.polytouch(\testpolytouch, {|...args|
-(["polytouch"] ++ args).postln;
-});
-MIDIdef.bend(\testbend, {|...args|
-(["bend"] ++ args).postln;
-});
-MIDIdef.sysex(\testsysex, {|...args|
-(["sysex"] ++ args).postln;
-});
-)
-*/
+++ /dev/null
-
-
-~sekick = Sampler(\kik);
-
-~sekick.startRec;
-~sekick.stopRec;
-
-~sekick.playSample;
-~sekick.shiftPos(0.05);
-
-~procBus = Bus.audio(s, 2);
-
-(
-Pdef(\kik, ~sekick.makeSynthBind <> Pbind(*[
- dur: 1,
- octave: 4,
- db: -15,
- legato: 5,
- sendGate: false,
- out: ~procBus,
-])).quant_(4).stop;
-)
-
-(
-SynthDef(\sexi, {| in, out=0 |
- var sig;
- sig = In.ar(in, 2);
- //sig = sig + CombC.ar(sig, 5.0, 1/6, 2.1);
- //sig = sig * 0.7;
- //sig = sig * Pulse.ar(Pulse.ar(Pulse.ar(171).range(2, 401)).range(0, 6703));
- //sig = sig + DelayC.ar(CombC.ar(sig, 5.0, 1/13, 1.0), 0.1, LFNoise2.ar(151).range(0, 0.09));
- //sig = sig*0.5 + Pulse.ar(LFNoise2.ar(32).range(400, 800), mul: LFNoise2.ar(16).range(0.01, 0.02));
- sig = LPF.ar(sig, LFNoise2.ar(16).range(2000, 16000));
- Out.ar(out, sig);
-}).add;
-
-{
- ~procSynth.free;
- ~procSynth = Synth(\sexi, [
- in: ~procBus,
- ], s, \addToTail);
-}.defer(0.1);
-)
\ No newline at end of file
+++ /dev/null
-~beri = ~bcrFactory.value;
-
-(
-~melmaker = Environment[
- \current
- \makemelody ->
- {
-
- }
-];
-~melmaker.know = true;
-
-)
-
-(
-SynthDef(\pulsetone,
- { arg out = 0, freq = 440, sustain = 0.05, gate=1, amp=1;
- var env, sig;
- sig = Pulse.ar(freq, 0.5, amp);
- sig = LPF.ar(sig, 4000);
- env = EnvGen.kr(Env.asr(0.01, 0.8, 0.05), gate, doneAction: Done.freeSelf);
- sig = sig * env;
- sig = Pan2.ar(sig, Rand(-0.6, 0.6));
- Out.ar(out, sig);
-}).add;
-)
-
-});
-
-}, {});
-
-(
-~curFreq = 110;
-~steps = (0..15);
-~intervalWeights = [1]++(0!15);
-~freqHigh = 1000;
-~freqLow = 200;
-
-~durs = (1..8);
-~durWeights = (0!7) ++ [1];
-
-~legatos = (1..8)/8;
-~legatoWeights = (0!7) ++ [1];
-
-~decibels = (0..7) * -2;
-~decibelWeights = [1] ++ (0!7);
-
-~chorus = (0..15);
-~chorusWeights = [1]++(0!15);
-
-/*~chooseWeighted = {|values, weights|
- values.
-};*/
-)
-
-(
-~beri.turn = {|zi, val, num|
- num.postln;
- if (num <= 16, {
- ~intervalWeights[num-1] = val;
- ("interval "++~steps[num-1]++" weight changed to "++val).postln;
- });
- if ((num >= 17) && (num <= 32), {
- ~chorusWeights[num-17] = val;
- ("chorus "++~chorus[num-17]++" weight changed to "++val).postln;
- });
- if ((num >= 81) && (num <= 88), {
- ~durWeights[num-81] = val;
- ("duration "++~durs[num-81]++" weight changed to "++val).postln;
- });
- if ((num >= 89) && (num <= 96), {
- ~legatoWeights[num-89] = val;
- ("legato "++~legatos[num-89]++" weight changed to "++val).postln;
- });
- if ((num >= 97) && (num <= 104), {
- ~decibelWeights[num-97] = val;
- ("decibel "++~decibels[num-97]++" weight changed to "++val).postln;
- });
- ~pnotes = Pfunc({
- var direction, step, upWeight, downWeight, chorus;
- upWeight = 1;
- downWeight = 1;
- if (~curFreq > ~freqHigh, {downWeight = ~curFreq/~freqHigh;});
- if (~curFreq < ~freqLow, {upWeight = ~freqLow/~curFreq;});
- //[downWeight, upWeight].postln;
- direction = [-1, 1].wchoose([downWeight**3, upWeight**3].normalizeSum);
- //direction.postln;
- step = ~steps.wchoose(~intervalWeights.normalizeSum);
- ~curFreq = ~curFreq * (direction*step).midiratio;
- chorus = ~chorus.wchoose(~chorusWeights.normalizeSum);
- //("new chorus: "++chorus).postln;
- [~curFreq, ~curFreq*chorus.midiratio];
- });
-
- ~pdurs = Pfunc({
- var dur;
- dur = ~durs.wchoose(~durWeights.normalizeSum);
- //("new duration: "++dur).postln;
- dur;
- });
-
- ~plegatos = Pfunc({
- var legato;
- legato = ~legatos.wchoose(~legatoWeights.normalizeSum);
- //("new legato: "++legato).postln;
- legato;
- });
-
- ~pdecibel = Pfunc({
- var decibel;
- decibel = ~decibels.wchoose(~decibelWeights.normalizeSum);
- //("new decibel: "++decibel).postln;
- decibel;
- });
-
- ~melody = ~se.makeSynthBind <> Pbind(
- \instrument, \sinetone,
- \freq, ~pnotes,
- \dur, ~pdurs,
- \legato, ~plegatos,
- \db, -10+~pdecibel,
- );
- Pdef(\melody, ~melody).quant_(1).play;
-};
-)
-
-Pdef(\melody).stop;
-
-~se.shiftPos(0.05);
-~se.playSample
-
-a = ~pnotes.asStream;
-a.next
-
-TempoClock.tempo = 1;
-
-// with beat
-
-(
-~curFreq = 220;
-~steps = [0, 7, 5, 12];
-~intervalWeights = [1, 5, 2, 1];
-~freqHigh = 800;
-~freqLow = 300;
-
-~durs = [1, 2, 3, 4, 8];
-~durWeights = [1, 2, 0, 1, 0];
-
-~legatos = [0.2, 0.3, 0.4, 0.9];
-~legatoWeights = [1, 4, 4, 3];
-
-~decibels = [-20, -55, -62];
-~decibelWeights = [0, 43, 28];
-
-~chorus = [5, 7, 9, 12];
-~chorusWeights = [1, 2, 1, 5];
-
-~pnotes = Pfunc({
- var direction, step, upWeight, downWeight, chorus;
- upWeight = 1;
- downWeight = 1;
- if (~curFreq > ~freqHigh, {downWeight = ~curFreq/~freqHigh;});
- if (~curFreq < ~freqLow, {upWeight = ~freqLow/~curFreq;});
- direction = [-1, 1].wchoose([downWeight**3, upWeight**3].normalizeSum);
- step = ~steps.wchoose(~intervalWeights.normalizeSum);
- ~curFreq = ~curFreq * (direction*step).midiratio;
- chorus = ~chorus.wchoose(~chorusWeights.normalizeSum);
- [~curFreq, ~curFreq*chorus.midiratio];
-});
-
-~pdurs = Pfunc({
- var dur;
- dur = ~durs.wchoose(~durWeights.normalizeSum);
- dur;
-});
-
-~plegatos = Pfunc({
- var legato;
- legato = ~legatos.wchoose(~legatoWeights.normalizeSum);
- legato;
-});
-
-~pdecibel = Pfunc({
- var decibel;
- decibel = ~decibels.wchoose(~decibelWeights.normalizeSum);
- decibel;
-});
-)
-
-(
-SynthDef(\beat,
- { arg out = 0, amp=1;
- var env, sig;
- sig = BrownNoise.ar();
- sig = sig + LFPulse.ar(50, width: LFSaw.ar(1, 0.5), mul: 0.4);
- sig = LPF.ar(sig, 300);
- env = EnvGen.kr(Env.perc(0.001, 0.4), doneAction: Done.freeSelf);
- sig = sig * env * amp;
- Out.ar(out, sig!2)
-}).add;
-)
-
-(
-SynthDef(\hat,
- { arg out = 0, amp=1;
- var env, sig;
- sig = PinkNoise.ar();
- sig = sig + LFPulse.ar(200, width: LFSaw.ar(1, 0.5), mul: 0.2);
- sig = LPF.ar(sig, 14000);
- env = EnvGen.kr(Env.perc(0.001, 0.1), doneAction: Done.freeSelf);
- sig = sig * env * amp;
- Out.ar(out, sig!2)
-}).add;
-)
-
-(
-SynthDef(\reverb, { |in, out = 0, mix=0|
- var sig, wet;
- sig = In.ar(in, 2);
- wet = CombC.ar(sig, 5, 3/8, 6/8, mix);
- Out.ar(out, sig+wet)
-}).add;
-)
-
-(
-~melody = Pbind(
- \instrument, \pulsetone,
- \freq, ~pnotes,
- \dur, ~pdurs,
- \legato, ~plegatos,
- \db, -20+~pdecibel,
- \out, ~busOne,
-);
-Pdef(\melody, ~melody).quant_(8).stop;
-)
-
-(
-Pdef(\beat1, Pbind(
- \instrument, \beat,
- \dur, 8,
- \db, -2,
- \out, ~busOne,
-)).quant_(8).stop;
-)
-
-(
-Pdef(\beat2, Pbind(
- \instrument, \hat,
- \dur, Pwrand([
- Pseq([8], 1),
- Pseq(4!2, 1),
- Pseq(2!4, 1),
- Pseq(1!8, 1),
- ], [1, 4, 2, 1].normalizeSum, inf),
- \db, -26,
- \out, ~busOne,
-)).quant_(8).stop;
-)
-
-~busOne = Bus.audio(s, 2);
-~groupReverb = Group.new(s, \addToTail);
-
-~reverbSynth.free;
-~reverbSynth = Synth(\reverb, [\in, ~busOne, \out, 0], ~groupReverb);
-~reverbSynth.set(\mix, 0.9);
\ No newline at end of file
+++ /dev/null
-(
-~mix = MidiMix();
-~se = Sampler();
-)
-
-(
-~mix.cue_ {|down|
- if (down) {
- ~se.startRec();
- ~mix.led(\cue, \on);
- } {
- ~se.stopRec();
- ~mix.led(\cue, \off);
- };
-};
-
-~mix.play_ {|down|
- if (down) {
- ~se.playSample();
- ~mix.led(\play, \on);
- } {
- ~se.stopPlay();
- ~mix.led(\play, \off);
- };
-};
-
-~fine = 0.1;
-~coarse = 0.1;
-~fineActive = false;
-
-~mix.but1_{|d|
- if (d) {
- ~fineActive = ~fineActive.not;
- ~mix.led(\but1, ~fineActive);
- };
-};
-
-~mix.rot1_{|v|
- var delta = v * ~coarse;
- if (~fineActive) {
- delta = delta * ~fine;
- };
- ~se.shiftPos(delta);
- ~se.startPos.postln;
-};
-
-// granular
-~mix.again_{|v|
- ~amp = v;
- ~gran.set(\amp, ~amp);
- "amp is %f".format(~amp).postln;
-};
-
-~mix.rotload_{|d|
- var mul = 1.1;
- if (d < 0) {mul = 1/mul; d = d.neg};
- d.do{
- ~density = ~density * mul;
- };
- ~gran.set(\density, ~density);
- "density is %".format(~density).postln;
-};
-
-~mix.rot2_{|d|
- var mul = 1.1;
- if (d < 0) {mul = 1/mul; d = d.neg};
- d.do{
- ~len = ~len * mul;
- };
- ~gran.set(\len, ~len);
- "len is %".format(~len).postln;
-};
-
-~mix.bfade_{|v|
- ~rate = v.linexp(0, 1, 1/4, 4);
- ~gran.set(\rate, ~rate);
- "rate is %".format(~rate).postln;
-};
-
-~mix.jogrot_{|d|
- var mul = 0.001;
- ~pos = ~pos + (d*mul);
- ~gran.set(\pos, ~pos);
- "pos is %".format(~pos).postln;
-};
-)
-
-(
-Pdef(\samploop, Pbind(*[
- db: -5,
- dur: 2,
- midinote: 57,
-]) <> ~se.makeSynthBind).quant_(2).stop;
-)
-
-(
-SynthDef(\granular, {|out=0, amp=1, buf=0, density=10, len=0.1, rate=1, pos=0|
- var sig;
- sig = GrainBuf.ar(1, Dust.ar(density), len, buf, rate, pos+LFNoise2.ar().range(0, len/1000), 4, 0, -1, 1024, amp);
- Out.ar(out, sig!2);
-}).add;
-)
-
-(
-~amp = 1;
-~density = 10;
-~len = 0.1;
-~rate = 1;
-~pos = 0;
-~gran = Synth(\granular, [
- amp: ~amp,
- buf: ~se.buf,
- density: ~density,
- len: ~len,
- rate: ~rate,
- pos: ~pos
-]);
-)
-
-~gran.free;
\ No newline at end of file
+++ /dev/null
-~ke = MidiRemote25SL(\kedifu);
-~mi = MidiMix101(\mix);
-
-(
-SynthDef(\zuFader, {|in, amp=1.0, mix=0.0, room=0.5, damp=0.5, out=0|
- var sig;
- sig = In.ar(in, 2);
- sig = FreeVerb2.ar(sig[0], sig[1], mix, room, damp, amp);
- Out.ar(out, sig);
-}).add;
-)
-
-(
-// Multitrack class
-/*
-~trackFactory = {
- (
- name: \mumy,
- def:
- )
-};
-*/
-
-~trackerFactory = {
- (
- tracks: [\lonu, \fose, \ziba, \pepo, \kaco, \xehi, \puso, \nuhu],
- groups: Array(8),
- buses: Array(8),
- faders: Array(8),
-
- init: {|self|
- self.sourceGroup = Group();
- self.faderGroup = Group.after(self.sourceGroup);
- self.kedifu = MidiRemote25SL(\kedifuTracker, reveal: false);
- self.sasihu = MidiMix101(\sasihuTracker, reveal: false);
- self.selected = 0;
- self.tracks.do{|k, i|
- var group, bus, fader;
- Pdef(k).endless;
- self[k] = Pdef(k);
- self[(k ++ \_).asSymbol] = {|self, f| Pdef(k, f)};
- group = Group(self.sourceGroup);
- self.groups.add(group);
- bus = Bus.audio(numChannels: 2);
- self.buses.add(bus);
- Pdef(k).set(\group, group, \out, bus);
- fader = Synth(\zuFader, [in: bus, out: 0], self.faderGroup);
- self.faders.add(fader);
- };
- self.kedifu.fader_{|v, n|
- self.faders[n].bindRange(\amp, -60.dbamp, 0.dbamp).value(v);
- };
- self.kedifu.lowrot_{|v, n|
- self.faders[n].bindRange(\mix, 0, 1).value(v);
- };
- self.kedifu.butlr_{|v, n|
- if (v) {
- self.selected = n;
- self.sasihu.afade = self.faders[self.selected].bindRange(\room, 0, 1);
- self.sasihu.bfade = self.faders[self.selected].bindRange(\damp, 0, 1);
- "% selected\n".postf(self.tracks[self.selected]);
- };
- };
-
- self
- },
- )
-};
-)
-
-// test
-
-(
-~tracker = ~trackerFactory.value.init;
-
-~tracker.lonu_{
- Pbind(*[
- instrument: \naje,
- db: Pwhite(-9, -6!2),
- dur: Prand((1!43)++(2!14)++(3!51)++(4!31), inf)/4,
- pan: Pwhite(-0.7, 0.7!2, inf),
- scale: Scale.nahawand,
- octave: Pseq([2, 2, 2, 3, 3, 2, 3, 4, 3, 4], inf) + [2, 6],
- degree: Pseq([0, 4, 5, 7, 6, 1], inf),
- legato: Pwhite(0.8, 1.3!2, inf),
- cut: Pwhite(600, 900!2),
- rez: Pwhite(0.7, 0.9!2),
- modFreqMin: Pwhite(6, 8!2),
- modFreqMax: Pwhite(11, 13!2),
- modAmp: Pwhite(0.01, 0.02!2),
- ])
-}.quant_(7).play;
-
-~tracker.fose_{
- Pbind(*[
- instrument: \leto,
- db: -1,
- dur: Prand([1, 2, 3], inf)/2,
- pan: Pwhite(-0.4, 0.4, inf),
- scale: Scale.nahawand,
- octave: Pxrand([3, 4, 5, 6, 7], inf),
- degree: [0, 4],
- legato: Pwhite(0.5, 0.9, inf),
- ])
-}.quant_(7).play;
-
-~tracker.ziba_{
- Pbind(*[
- instrument: \zuqy,
- db: -5,
- dur: Prand([1, 2, 3, 4], inf)/4,
- pan: Pwhite(-0.4, 0.4, inf),
- scale: Scale.nahawand,
- octave: Pxrand([2], inf),
- degree: Prand((0..12), inf),
- legato: Pwhite(0.2, 0.7, inf),
- distort: 150.0,
- ])
-}.quant_(7).play;
-
-~tracker.pepo_{
- Pbind(*[
- instrument: \xaxa,
- db: -5,
- dur: Prand([1, 2, 3, 4], inf)/1,
- pan: Pwhite(-0.4, 0.4, inf),
- scale: Scale.nahawand,
- octave: Pxrand([2], inf),
- degree: Prand((0..12), inf),
- legato: Pwhite(0.3, 0.6, inf),
- feedbackAmp: 0.2,
- feedbackRate: 3,
- detuneAmp: 0.1,
- detuneRate: 2,
- ])
-}.quant_(7).play;
-
-~tracker.kaco_{
- Pmono(\liwe, *[
- db: -10,
- trig: 1,
- dur: Pseq([1, 2, 1, 2, 3, 2, 1, 2], inf)/4,
- pan: Pwhite(-0.1, 0.1, inf),
- tension: 0.001 + (0.017 * Pkey(\dur)),
- loss: 0.99992,
- impact: 0.1,
- ])
-}.quant_(7).play;
-
-~tracker.xehi_{
- Pbind(*[
- instrument: \neta,
- db: -19,
- dur: Pseq([1, 2, 1, 1, 1, 0.5, 1/4, 1/8, 1/8], inf),
- scale: Scale.nahawand,
- octave: Pxrand([Pseq(2!3), Pseq(3!3), Pseq(4!3)], inf),
- degree: Pxrand([0, 2, 4, 5, 7], inf) + [0, 2, 4],
- legato: Pwhite(0.2, 0.6, inf),
- ])
-}.quant_(7).play;
-)
\ No newline at end of file
+++ /dev/null
-(
-//======== Busses
-// speakers
-~spik = 0;
-
-// headphones
-~phon = 2;
-
-// recording
-~bare = Bus.audio(s, 2);
-
-// effect
-~bafe = Bus.audio(s, 2);
-
-a = { [2r10010, 2r101011, 2r11100].choose.postln };
-b = a >> 2;
-b.value.asBinaryDigits.join;
-
-
-//======== Groups
-// sources
-~guso = Group.new(s);
-
-// recording
-~gu
-
-~gure = Group.new(~guSources, \addAfter);
-
-~tempo
-)
\ No newline at end of file
+++ /dev/null
-//=============================================================================
-// test midi
-//=============================================================================
-(
-~kedi = MidiRemote25SL();
-~push = MidiPush();
-~peda = MidiPedals();
-)
-
-(
-Pdef(\test, Pbind(*[
- dur: 1,
- db: -17,
-])).quant_(1).play;
-)
-
-(
-TempoClock.play({|beats, time, clock|
- ~push.syncTempo_(false);
- [beats, time, clock].postln;
-}, 1);
-)
-
-(
-~kedi.tempo_{|v|
- TempoClock.tempo = v / 60;
- v.postln;
-};
-)
-
-~push.ledPad(0, 0, color: -60);
-~push.ledPadOff;
-~push.ledButlo(2, color: 5, light: 3, mode: 0);
-~push.ledButup(2, \off, true, \always);
-~push.ledButton(\play, \off);
-~push.ledButton(\d14t, \lime, true);
-
-//=============================================================================
-
-(
-~same = Sampler();
-~kedi = MidiRemote25SL();
-~push = MidiPush();
-~peda = MidiPedals();
-~samtrig = MidiSampler(~push, ~peda, ~same, false);
-~keys = KeySynth(~kedi, ~same.synthdefName, 1, true, {~same.makeSynthArgs});
-~pads = PadSynth(~push, ~same.synthdefName, 1, true, {~same.makeSynthArgs});
-)
-
-~keys.amp = 3;
-
-//=========================== scale experiments
-
-(
-//(note: 9, octave: 5).play;
-~se2.startRec;
-)
-~se2.stopRec;
-
-~se2.shiftPos(0.05);
-~se2.duration = ~se.duration - 1;
-~se2.playSample;
-Scale
-Tuning.directory
-(0..12).collect(_ * (3 ** (1/13)))
-~tun = Tuning.new((0..12).collect(_ * (12*(3 ** (1/13)).log2)), 3, "tritave");
-~scale = Scale.chromatic(~tun);
-
-(
-Pdef(\sampe, ~se.makeSynthBind <> Pbind(
- \scale, ~scale,
- \octave, 5,
- \note, Pseq([[0, -7]]++(9!8), inf),
- \dur, 3,
- \db, -10,
-)).quant_(9).stop;
-)
-(
-Pdef(\sampo, ~se.makeSynthBind <> Pbind(
- \scale, ~scale,
- \octave, 5,
- \note, Pxrand([2, 5, 8, 11], inf),
- \dur, 1,
- \db, -20,
- \timingOffset, 1/3,
-)).quant_(9).stop;
-)
-(
-Pdef(\sampi, ~se.makeSynthBind <> Pbind(
- \scale, ~scale,
- \octave, 7,
- \note, Pxrand((1,3..12), inf),
- \dur, 1,
- \db, -30,
- \timingOffset, 1/6,
-)).quant_(9).stop;
-)
-
-TempoClock.tempo = 2;
-(
-Pdef(\teste, Pbind(
- \dur, 1
-)).stop;
-)
-~se2 = ~samplerFactory.value;
-(
-Pdef(\samia, ~se.makeSynthBind <> Pbind(
- \scale, ~scale,
- \octave, 5,
- \note, Pseq((0..12)++(11..1) +.t [0, 7], inf),
- \dur, 4,
- \db, -1,
- \timingOffset, 0,
-)).quant_(4).stop;
-)
-
-(
-Pdef(\samei, ~se2.makeSynthBind <> Pbind(
- \scale, ~scale,
- \octave, 5,
- \note, Pseq((0..12)++(11..1) +.t [0, 3], inf),
- \dur, 3,
- \db, -15,
- \timingOffset, 0,
-)).quant_(4).stop;
-)
-
-{SinOsc.ar(440, mul: 0.2)}.play
-
-(
-s.waitForBoot{
- SSampler(\reel).load([Quarks.folder ++ "/SuperSampler/Testcode/Sounds/Reel Palindruome_44.1kHz_int16.aiff"]);
-}
-)
-
-//=============================================================================
-[ 0, 1, 3, 5, 7, 8, 10 ]+2
-~kedi = MidiRemote25SL();
-~kedi2 = MidiRemote25SL(\kedi2);
-
-~monokeys = KeySynthRelative(~kedi);
-~monokeys.synthName = \dyti;
-~monokeys.bendRadius = 0.2;
-~monokeys.centerKey = 67;
-~monokeys.intervals = #[2, 5, 7];
-
-~monokeys.params[\modAmp] = 0.0;
-(
-~kedi.press_{|v|
- var val = v * 0.02;
- ~monokeys.group.set(\modAmp, val);
- ~monokeys.params[\modAmp] = val;
-};
-)
-
-~monokeys2 = KeySynthRelative(~kedi2, centerKey: 52, intervals: #[2, 3]);
-~monokeys2.amp = 2;
-~monokeys2.synthName = \pope;
-~monokeys2.bendRadius = 0.2;
-~monokeys.intervals = #[2, 5, 7];
-
-//=============================================================================
-
-~kedi = MidiRemote25SL();
-[ 0, 2, 8, 10, 14, 18, 20 ]/2
-[ 0.0, 2.0, 4.0, 5.0, 7.0, 8.0, 11.0 ].do{|e, i| };
-
-~geshude = Scale([0, 2, 4, 5, 7, 9, 10], 12, tuning: Tuning.et12);
-~integral = Scale([0, 2, 3, 7, 8, 10], 12, tuning: Tuning.et12);
-
-todi: Scale([ 0, 1, 3, 6, 7, 8, 11 ], 12, Tuning.et12)
-
-(
-~keys = KeySynth(~kedi, \dyti, 1, true, nil, 0.2, nil, false);
-~keys.amp = 0.5;
-~keys.synthName = \dyti;
-~keys.onlyWhite = true;
-~keys.scale = Scale.todi;
-~keys.params[\modAmp] = 0.0;
-~kedi.press_{|v|
- var val = v * 0.02;
- ~keys.group.set(\modAmp, val);
- ~keys.params[\modAmp] = val;
-};
-)
-
-[ D, E, F, G, A, A#, C# ]
-
-Scale.nahawand
\ No newline at end of file
+++ /dev/null
-(
-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;
-
-//====
-
-(
-SynthDef(\eoau, { |out=0, amp=1, freq=440, gate=1|
- var modFreq, sig, env;
- env = EnvGen.ar(Env.adsr(releaseTime: 0.2), gate, doneAction: 2);
- modFreq = Pulse.ar((freq**(1/2))*env, mul: env*freq/4, add: freq);
- sig = Saw.ar(modFreq) * Pulse.ar(modFreq) * SinOsc.ar(freq) * amp;
- sig = sig * env;
- sig = Pan2.ar(sig, Rand(-0.5, 0.5));
- Out.ar(out, sig);
-}).add;
-)
-
-TempoClock.tempo = 90 / 60;
-
-(
-Pdef(\asui, Pbind(
- \instrument, \eoau,
- \dur, Pseq([1, 1].normalizeSum / 4, inf),
- \db, -1,
- \octave, 2,
- \note, 0,
- \legato, Pwhite(0.1, 0.2),
-)).quant_(4).stop;
-)
-
-(
-Pdef(\sodi, Pbind(
- \instrument, \eoau,
- \dur, Pseq([1, 1, 1].normalizeSum * 4, inf),
- \db, -22,
- \octave, Prand([5, 6], inf),
- \note, Prand([
- Pseq([9, 7, 19, 12, 7, 4, 2], 1),
- Pseq([7, 4, 7, 2], 1),
- ], inf),
- \legato, Pwhite(2.8, 4.2),
-)).quant_(4).stop;
-)
-
-(
-Pdef(\osud, Pbind(
- \instrument, \eoau,
- \dur, Pseq((1!7).normalizeSum/4, inf),
- \db, -55,
- \octave, 7,
- \note, Prand([9, 7, 16, 12, 7, 4], inf),
- \legato, 0.5,
-)).quant_(4).stop;
-)
-
-(
-Pdef(\saau, Pbind(
- \instrument, \eoau,
- \dur, Pgeom(1, 0.9, 50),
- \db, -25,
- \octave, 4,
- \note, Prand([2, 5, 9, 12], inf),
- \legato, 1,
-)).quant_(4).stop;
-)
+++ /dev/null
-~se = ~samplerFactory.value;
-(
-//(note: 9, octave: 5).play;
-~se.startRec;
-)
-~se.stopRec;
-
-~se.shiftPos(0.05);
-~se.duration = ~se.duration + 0.2;
-~se.playSample;
-
-(
-Pdef(\stae, Pbind(
- \octave, Pxrand([3, 4], inf),
- \note, Prand([0, 2, 4], inf),
- \dur, Pwrand([
- Pseq([1], 1),
- Pseq(0.5!2, 1),
- Pseq(0.25!4, 1),
- ], [1, 1, 1].normalizeSum, inf),
- \db, -3,
- \duration, Pwhite(0.1, 0.2),
-) <> ~se.makeSynthBind).quant_(4).stop;
-)
-
-(
-Pdef(\steio, Pbind(
- \octave, 5,
- \note, Prand([0, 2, 4, 7, 9], inf),
- \dur, Pwrand([
- Pseq([3, 3, 2]/2, 1),
- ], [1].normalizeSum, inf),
- \db, -15,
- \duration, Pwhite(0.5, 2),
- \startpos, Pwhite(1, 2.0),
-) <> ~se.makeSynthBind).quant_(4).stop;
-)
-
-TempoClock.tempo = 2;
\ No newline at end of file