Created
August 29, 2016 20:17
-
-
Save tedthetrumpet/3fa8c3ce9e250d3ec375bf30dad74b90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
// reset | |
Pdef.all.clear; Pdefn.all.clear; Ndef.all.clear; Buffer.freeAll; | |
// quantize changes to four beats | |
Pbindef.defaultQuant = 4; | |
Pdefn.defaultQuant = 4; | |
s.waitForBoot{ | |
// set tempo to 120 | |
TempoClock.default.tempo = 120/60; | |
// setup sample path | |
~bufs = ( "samples/".resolveRelative ++ "*").pathMatch.collect({ |i| Buffer.read(s, i)}); | |
// define synth to play back buffers | |
SynthDef(\bf, {|out = 0 buf = 0 amp = 0.1 freq = (60.midicps), pan = 0.0| | |
var sig = PlayBuf.ar(2, buf, BufRateScale.kr(buf) * freq/60.midicps, doneAction:2); | |
sig = Balance2.ar(sig[0],sig[1], pan); | |
Out.ar(out, sig * amp) | |
}).add; | |
s.sync; | |
}; | |
) | |
// useful | |
Pdef.all.asCompileString.newTextWindow | |
Ndef.all.asCompileString | |
s.meter | |
s.prepareForRecord | |
s.record | |
s.stopRecording | |
thisProcess.platform.recordingsDir.openOS | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment