Skip to content

Instantly share code, notes, and snippets.

@ALOUT
Created June 11, 2014 07:10
Show Gist options
  • Save ALOUT/694e5fc5adb12e2dd706 to your computer and use it in GitHub Desktop.
Save ALOUT/694e5fc5adb12e2dd706 to your computer and use it in GitHub Desktop.
タスクベース(大枠シーケンサ)
(
SynthDef("testSynth", {|amp=1.0, freq=440, decay=0.2|
var out;
out = SinOsc.ar(freq);
out = out * Line.kr(amp, 0, decay, doneAction:2);
out = out + DelayC.ar(out, 10.0,1.2, 1.0);
out = Pan2.ar(out);
out = out * 1.5;
Out.ar(0, out);
}).send(s);
SynthDef(\FreeVerb2x2, {|outbus, mix = 0.25, room = 0.15, damp = 0.5, amp = 1.0|
var signal;
signal = In.ar(outbus, 2);
ReplaceOut.ar(outbus,FreeVerb2.ar(signal[0],signal[1],mix, room, damp, amp));
}
).send(s);
SynthDef(\compressor, {
var in,compressed;
in = In.ar(0,2);
compressed = Compander.ar(in, in, 0.3, 1, 1/8, 0.002, 0.01);
ReplaceOut.ar(0, compressed * 4);
}).send(s);
)
(
Server.default = Server.internal; s = Server.default;Server.default.options.memSize = 512 * 512;
~bpm = 135;
~clock = TempoClock(~bpm/60);
~swing = 0.75;
~count = 0;
~bar = 0;
~task = Task({
inf.do{
var wait;
("[bar:" ++ ~bar ++ "] [Cnt:" ++ ~count ++ "]" ).postln;
wait = 1/4;
if(~count%2==0){wait=(~swing*2)*wait}{wait=(1-~swing*2)*wait};
s.makeBundle(s.latency, {
});
~count = ~count + 1;
if(~count >= 64){~count = 0; ~bar = ~bar + 1;};
wait.wait;
};
},~clock).start;
~comp = Synth(\compressor, addAction: \addToTail);
~rev = Synth(\FreeVerb2x2, [\outbus, 0,\damp,0.6,\mix,0.65,\room,100.2], addAction:\addToTail);
)
s.scope(bufsize:20000);
~task.stop
~task.start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment