This commit is contained in:
FoAM 2018-05-21 07:46:48 +00:00
parent b72f1d397f
commit 5b1e76138b
1 changed files with 45 additions and 0 deletions

45
ephemera-loop.sc Normal file
View File

@ -0,0 +1,45 @@
///// // / / / / / / /
//
// 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