// Хыпёдё
-// instrument
+// values
+(
+~numReverbs = 5;
+)
+
+// instruments
+
+(
+// amplification coefficients for samples
+~hahomo = (
+ name: "Хахомо",
+ params: [(
+ name: \bu,
+ mul: 0.5,
+ ), (
+ name: \me,
+ mul: 10,
+ ), (
+ name: \mo,
+ mul: 6,
+ ), (
+ name: \nu,
+ mul: 3,
+ ), (
+ name: \da,
+ mul: 3,
+ ), (
+ name: \do,
+ mul: 2,
+ ), (
+ name: \tu,
+ mul: 5,
+ ), (
+ name: \by,
+ mul: 1,
+ ), (
+ name: \bo,
+ mul: 1.5,
+ ), (
+ name: \be,
+ mul: 1.5,
+ ), (
+ name: \ma,
+ mul: 1,
+ ), (
+ name: \my,
+ mul: 1,
+ )];
+);
+)
+
+(
~hahomoInstruments = ~makeSampleSynths.(
~hahomo.name,
~hahomo.params
);
+)
+
+// effects
+
+(
+~createGroupsBusses = {
+ ~instrumentGroup = Group(s);
+ ~effectGroup = Group.after(~instrumentGroup);
+ ~mixerGroup = Group.after(~effectGroup);
+
+ ~mainBus = Bus.audio(s, 2);
+ ~mainMixer = Synth(\fader, (
+ in: ~mainBus,
+ out: a.h,
+ amp: 1.0,
+ ).asPairs, ~mixerGroup);
+
+ ~jpverbs = Array();
+ ~reverbBuses = Array();
+ ~numReverbs.do{
+ ~reverbBuses = ~reverbBuses.add(Bus.audio(s, 2));
+ ~jpverbs = ~jpverbs.add(Synth(\qahe, (
+ mix: 0.1.rrand(0.8),
+ t60: 1.0.rrand(10.0),
+ damp: 0.0.rrand(1.0),
+ size: 1.0.rrand(4.0),
+ earlyDiff: 0.5.rrand(0.9),
+ modDepth: 0.0.rrand(0.05),
+ modFreq: 2.0.rrand(15.0),
+ low: 0.7.rrand(1.0),
+ mid: 0.7.rrand(1.0),
+ high: 0.7.rrand(1.0),
+ lowcut: 500.0,
+ highcut: 2000.0,
+ in: ~reverbBuses.last,
+ out: ~mainBus,
+ ).asPairs, ~effectGroup));
+ };
+};
+ServerTree.add(~createGroupsBusses);
+ServerTree.add{s.plotTree};
+)
// test
Pdef(\buben, Pbind(*[
instrument: Prand([\bu, \bo, \be, \by], inf),
db: -6,
- dur: Pn(Pseq(2.split(3)++2.split(4), 4), inf),
+ dur: Pn(Pseq(2.split(3)++2.split(4), 4), 1),
pan: Pwhite(-0.4, 0.4),
- out: a.h,
-])).quant_(4).stop;
+ out: ~reverbBuses[1],
+])).quant_(4).play;
)
(
db: -12,
dur: Pn(Pseq(2.split(4)++2.split(5), 4), 1),
pan: Pwhite(-0.7, 0.7),
- out: a.h,
+ out: Prand(~reverbBuses, inf),
])).quant_(4).play;
)
(
Pdef(\bass, Pbind(*[
instrument: Prand([\da, \da], inf),
- db: -12,
+ db: -18,
dur: Pn(Pseq(2.split(2)++2.split(3), 4), 1),
pan: Pwhite(-0.5, 0.5),
- out: a.h,
+ out: Prand(~reverbBuses, inf),
])).quant_(4).play;
)
db: -15,
dur: Pn(Pseq(4.split(5), 4), 1),
pan: Pwhite(-0.5, 0.5),
- out: a.h,
+ out: Prand(~reverbBuses, inf),
])).quant_(4).play;
)
(
Pdef(\melody, Pbind(*[
instrument: \dyti,
- db: -17,
+ db: -23,
octave: Prand([4, 5, 6], inf)+[0, 2],
- degree: Pseq([0, 2, 4, 2, 1, 5], inf),
- dur: Pseq([3, 3, 2].split(4)/2, 1),
- release: TempoClock.tempo.reciprocal*2,
- legato: 0.2,
- cut: Pexprand(400, 800),
+ degree: Pseq([6, 5, 4, 6, 1, 3], inf),
+ dur: Pseq([3, 3, 2].split(4), 1),
+ release: Pwhite(0.5, 1.2)*TempoClock.tempo.reciprocal*1.6,
+ legato: Pwhite(0.6, 0.7),
+ cut: Pexprand(400, 3200),
rez: Pwhite(0.6, 0.9),
+ modFreqMin: 4,
+ modFreqMax: 11,
+ modAmp: Pwhite(0.005, 0.01),
pan: Pwhite(-0.2, 0.2) * [-1, 1],
- out: a.h,
+ out: ~reverbBuses[0],
+])).quant_(4).play;
+)
+
+(
+Pdef(\melodytwo, Pbind(*[
+ instrument: \pope,
+ db: -16,
+ octave: Prand([5, 6, 7], inf)+[0, 1],
+ degree: Pseq([6, 4, 3, 6, 2, 5], inf),
+ dur: Pseq([3, 3, 2].split(4), 1),
+ release: Pwhite(0.5, 1.2)*TempoClock.tempo.reciprocal*1.5,
+ legato: Pwhite(0.2, 0.4),
+ pan: Pwhite(-0.4, 0.4) * [-1, 1],
+ out: ~reverbBuses[2],
+])).quant_(4).play;
+)
+
+(
+Pdef(\melodythree, Pbind(*[
+ instrument: \bino,
+ db: -23,
+ octave: Prand([3, 4, 5], inf),
+ degree: Pseq((0..7), inf),
+ dur: Pseq([3, 3, 2]/8, 1),
+ release: Pwhite(0.5, 1.2)*TempoClock.tempo.reciprocal*1.5,
+ legato: Pwhite(0.5, 0.8),
+ modFreq: 220,
+ maxIndex: 4,
+ pan: Pwhite(-0.4, 0.4),
+ out: ~reverbBuses[3],
])).quant_(4).play;
)
(
Pdef(\pad, Pbind(*[
instrument: \neta,
- db: -17,
- octave: 3,
+ db: -22,
+ octave: 2,
degree: Pseq([0, 2, 4, 2, 1, 5], inf),
dur: Pseq([3, 3, 2].split(2)/2, 1),
legato: 0.8,
pan: Pwhite(-0.2, 0.2) * [-1, 1],
- out: a.h,
+ out: ~reverbBuses[0],
])).quant_(4).play;
)
(
Pdef(\metal, Pbind(*[
instrument: \leto,
- db: -11,
- octave: Prand([6, 7, 8, 9], inf),
- degree: Pseq([0, 2, 4, 2, 1, 5], inf),
+ db: -15,
+ octave: Prand([8, 9], inf),
+ degree: Pxrand([0, 2, 4, 2, 1, 5], inf),
dur: Pseq([3, 3, 2].split(3)/2, 1),
legato: Pwhite(0.8, 1.2),
pan: Pwhite(-0.7, 0.7) * [-1, 1],
- out: a.h,
+ out: ~reverbBuses[0],
])).quant_(4).play;
)
attackfm: 0.3,
selffm: 0.75,
dur: Pseq(1.split(1)++1.split(2)++2.split(3), 1),
- db: Pwhite(5, 8),
- out: a.h,
+ db: Pwhite(5, 8)-3,
+ out: ~mainBus,
])).quant_(4).play;
)
loss: Pexprand(0.9999, 0.99999),
impact: 0.1,
dur: Pseq(1.split(1)++1.split(2)++2.split(3), 1),
- db: -9,
- out: a.h,
+ db: -24,
+ out: ~mainBus,
])).quant_(4).play;
)
-s.record(bus: a.h);
+(
+Pdef(\marimba0, Pbind(*[
+ instrument: Prand(~synthNames, inf),
+ octave: Prand([3], inf),
+ degree: Pxrand([0, 2, 4, 6, 1, 5], inf),
+ attack: TempoClock.tempo.reciprocal*0.01,
+ release: TempoClock.tempo.reciprocal*1.0,
+ dur: Pseq(4.split(4), 1),
+ pan: Pwhite(-0.5, 0.5),
+ out: Prand(~reverbBuses, inf),
+ db: -8,
+])).quant_(4).play;
+
+Pdef(\marimba1, Pbind(*[
+ instrument: Prand(~synthNames, inf),
+ octave: Prand([4], inf),
+ degree: Pxrand([0, 2, 4, 2, 6, 5], inf),
+ attack: TempoClock.tempo.reciprocal*0.01,
+ release: TempoClock.tempo.reciprocal*1.0,
+ dur: Pseq(4.split(5), 1),
+ pan: Pwhite(-0.5, 0.5),
+ out: Prand(~reverbBuses, inf),
+ db: -10,
+])).quant_(4).play;
+
+Pdef(\marimba2, Pbind(*[
+ instrument: Prand(~synthNames, inf),
+ octave: Prand([5], inf),
+ degree: Pxrand([6, 2, 4, 2, 1, 6], inf),
+ attack: TempoClock.tempo.reciprocal*0.01,
+ release: TempoClock.tempo.reciprocal*1.0,
+ dur: Pseq(4.split(5), 1),
+ pan: Pwhite(-0.5, 0.5),
+ out: Prand(~reverbBuses, inf),
+ db: -13,
+])).quant_(4).play;
+
+Pdef(\marimba3, Pbind(*[
+ instrument: Prand(~synthNames, inf),
+ octave: Prand([6], inf),
+ degree: Pxrand([1, 2, 6, 6, 1, 6], inf),
+ attack: TempoClock.tempo.reciprocal*0.01,
+ release: TempoClock.tempo.reciprocal*1.0,
+ dur: Pseq(4.split(6), 1),
+ pan: Pwhite(-0.5, 0.5),
+ out: Prand(~reverbBuses, inf),
+ db: -16,
+])).quant_(4).play;
+
+Pdef(\marimba4, Pbind(*[
+ instrument: Prand(~synthNames, inf),
+ octave: Prand([7], inf),
+ degree: Pxrand([6, 2, 4, 6, 5, 6], inf),
+ attack: TempoClock.tempo.reciprocal*0.01,
+ release: TempoClock.tempo.reciprocal*1.0,
+ dur: Pseq(4.split(6), 1),
+ pan: Pwhite(-0.5, 0.5),
+ out: Prand(~reverbBuses, inf),
+ db: -19,
+])).quant_(4).play;
+)
+
+(
+Pdef(\marimba0).play;
+Pdef(\marimba1).play;
+Pdef(\marimba2).play;
+Pdef(\marimba3).play;
+Pdef(\marimba4).play;
+)
+
+(
+Pdef(\marimba0).stop;
+Pdef(\marimba1).stop;
+Pdef(\marimba2).stop;
+Pdef(\marimba3).stop;
+Pdef(\marimba4).stop;
+)
+
+// mixer TODO: create another file for mixer
+
+~mainMixer.set(\amp, -6.dbamp);
+
+// recording
+
+(
+s.record(bus: ~mainBus);
+)
s.stopRecording;
\ No newline at end of file