ephemeral-garden/ephemera-loop.sc

46 lines
1.1 KiB
Python
Raw Normal View History

2018-05-21 07:46:48 +00:00
///// // / / / / / / /
//
// basic soundfile looper
//
////// / /
"e p h e m e r a l g a r d e n".postln;
// sc server
s = Server.local;
//s.options.memSize = 1024 * 1024;
//s.options.maxNodes = 1024 * 1024;
//s.options.numBuffers = 1024 * 1024 * 1024;
//s.latency = 0.05;
s.options.sampleRate = 44100;
s.boot;
"...".postln;
~play1 = { arg b1;
Routine {
// quantise to 10 second boundaries
("now -> " ++ Date.gmtime ++ " -> " ++ Date.gmtime.second).postln;
(10-Date.gmtime.second.mod(10)).wait;
"sync?...".postln;
"~play [bg - ".post; b1.path.post; "]".postln;
{DiskIn.ar(2, b1, loop: 1)}.play.waitForFree;
// free buffer once done? check diskin completion state
"freed [bg - ".post; b1.path.post; "]".postln;
b1.free;
}.play;
};
s.waitForBoot {
"booted...".postln;
~file = Platform.userHomeDir ++ "/snd/" ++ "ephemera-20180520-2ch-12.wav";
// cue stereo file from disk then play
b=Buffer.cueSoundFile (server: s, path: ~file, numChannels: 2); ~play1.value(b);
};
// 167/31 -> 175/31 -> 168/31