--- /dev/null
+(
+// initialization
+ServerTree.removeAll;
+
+~tempo = 94;
+~bpb = 4;
+
+ServerTree.add({
+ "Init vars:".postln;
+ (
+ tempo: TempoClock.tempo_(~tempo / 60).tempo,
+ beatsPerBar: TempoClock.schedAbs(TempoClock.nextBar, {
+ thisThread.clock.beatsPerBar_(~bpb)
+ }).beatsPerBar
+ ).postln;
+});
+)
--- /dev/null
+(
+~loop = Pbind(*[
+ instrument:
+]);
+
+~song = Ptpar([
+ 0, ~loop,
+], inf);
+
+Pdef(\song, ~song).quant_(~bpb).play;
+)
+// send to ableton
+~ableton.allNotesOff(0);
+~ableton = MIDIOut.newByName("IAC Driver", "Bus 2").latency_(s.latency);
+
+
+(
+~gamma = [0, 2, 4, 5, 7, 9, 11, 12].scramble;
+~drums = (36..51).scramble;
+~beat = ~makeBeat.(7, dur: 8, db: 0);
+Pdef(\pobitopy, Pbind(*[
+ type: \midi,
+ midiout: ~ableton,
+ chan: 0,
+ midicmd: \noteOn,
+ midinote: Pshuf(~gamma.wrapExtend(~beat.size)+24, inf),
+ #[\dur, \dummy3, \db, \dummy1, \dummy2]: Pseq(
+ ~beat, inf,
+ ),
+ hasGate: true,
+])).quant_(4).play;
+)
+
+Pdef(\pobitopy).stop;
\ No newline at end of file
--- /dev/null
+(
+SynthDef(\zuqufucu, {|
+ out = 0,
+ sustain = 0.5,
+ freq = 440,
+ amp = 1,
+ cut = 800,
+ rez = 0.8,
+ modFreqMin = 7,
+ modFreqMax = 12,
+ modAmp = 0.01
+ |
+ var sig = 0;
+ var modFreq = SinOsc.kr(Rand(modFreqMin, modFreqMax), 0, modAmp, 1);
+ sig = sig + Pulse.ar(freq * modFreq);
+ sig = RLPF.ar(sig, cut.lag(0.01), rez.lag(0.01));
+ sig = sig * EnvGen.ar(Env.perc(sustain*0.1, releaseTime: sustain*0.9), doneAction: 2);
+ sig = Pan2.ar(sig, Rand(-0.3, 0.3));
+ Out.ar(out, sig * amp);
+}).add;
+)
\ No newline at end of file