sstteerreeoo
This commit is contained in:
parent
0086bbedb4
commit
dfa7bdbf6e
2 changed files with 121 additions and 1 deletions
120
ephemera-2CH.sc
Normal file
120
ephemera-2CH.sc
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
///// // / / / / / / /
|
||||||
|
//
|
||||||
|
// supercollider tests
|
||||||
|
//
|
||||||
|
////// / /
|
||||||
|
|
||||||
|
|
||||||
|
"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;
|
||||||
|
|
||||||
|
// time of day - see AppClock for scheduling
|
||||||
|
|
||||||
|
~now=Date.gmtime;
|
||||||
|
|
||||||
|
// dont trust the clock if it's n 1970 (not ntp synced)
|
||||||
|
if ( ~now.year == 1970,
|
||||||
|
{"previously".postln;},
|
||||||
|
{"post 1970".postln;}
|
||||||
|
);
|
||||||
|
|
||||||
|
~now.hour.postln;
|
||||||
|
|
||||||
|
|
||||||
|
~prefix = Platform.userHomeDir ++ "/snd/";
|
||||||
|
|
||||||
|
~background = {
|
||||||
|
|
||||||
|
"background >> ".post;
|
||||||
|
|
||||||
|
// list of soundfiles
|
||||||
|
~sources = [
|
||||||
|
"ephemera-20180516.wav"
|
||||||
|
];
|
||||||
|
|
||||||
|
// select random element from the list
|
||||||
|
~file = ~sources.choose;
|
||||||
|
~file.postln;
|
||||||
|
|
||||||
|
// cue stereo file from disk then play
|
||||||
|
b=Buffer.cueSoundFile (server: s, path: ~prefix++~file, numChannels: 2); ~play1.value(b);
|
||||||
|
};
|
||||||
|
|
||||||
|
~foreground = {
|
||||||
|
|
||||||
|
"foreground >> ".post;
|
||||||
|
|
||||||
|
// list of soundfiles
|
||||||
|
~sources = [
|
||||||
|
"26-multilayered-conversations-01.wav",
|
||||||
|
"26-multilayered-conversations-02.wav",
|
||||||
|
"39-incomprehensible-restaurtant-chatter-02.wav",
|
||||||
|
"39-incomprehensible-restaurtant-chatter-03.wav",
|
||||||
|
"39-incomprehensible-restaurtant-chatter-04.wav",
|
||||||
|
"26-party-chatter-02.wav",
|
||||||
|
"26-party-chatter-03.wav",
|
||||||
|
"26-party-chatter-04.wav",
|
||||||
|
"06-uw-pebbles-urchins-waves.wav",
|
||||||
|
"17-uw-waves-crashing-on-pebble-beach-slow.wav"
|
||||||
|
];
|
||||||
|
|
||||||
|
// select random element from the list
|
||||||
|
~file = ~sources.choose;
|
||||||
|
~file.postln;
|
||||||
|
|
||||||
|
// read file then play buffer
|
||||||
|
Buffer.read (server: s, path: ~prefix++~file, action: ~play2);
|
||||||
|
};
|
||||||
|
|
||||||
|
~play1 = { arg b1;
|
||||||
|
Routine {
|
||||||
|
"~play [bg - ".post; b1.path.post; "]".postln;
|
||||||
|
|
||||||
|
{(DiskIn.ar(2, b1, loop: 0) * 0.1).dup }.play.waitForFree;
|
||||||
|
// free buffer once done?
|
||||||
|
|
||||||
|
"freed [bg - ".post; b1.path.post; "]".postln;
|
||||||
|
b1.free;
|
||||||
|
~background.value;
|
||||||
|
}.play;
|
||||||
|
};
|
||||||
|
|
||||||
|
~play2 = { arg b2;
|
||||||
|
Routine {
|
||||||
|
"~play [fg - ".post; b2.path.post; "]".postln;
|
||||||
|
|
||||||
|
{(PlayBuf.ar(1, b2, rate: 1, loop: 0, doneAction: 2) * 0.1).dup }.play.waitForFree;
|
||||||
|
// free buffer once done?
|
||||||
|
|
||||||
|
"freed [fg - ".post; b2.path.post; "]".postln;
|
||||||
|
b2.free;
|
||||||
|
~foreground.value;
|
||||||
|
}.play;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
s.waitForBoot {
|
||||||
|
"booted...".postln;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
j = 0;
|
||||||
|
p = 1; // how many background layers?
|
||||||
|
q = 0; // how many foreground layers?
|
||||||
|
|
||||||
|
while ( { i < p }, { i = i + 1; ~background.value;});
|
||||||
|
while ( { j < q }, { j = j + 1; ~foreground.value;});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// 167/31 -> 175/31 -> 168/31
|
2
setup.sh
2
setup.sh
|
@ -21,6 +21,6 @@ echo "ephemeral: sclang starting..."
|
||||||
|
|
||||||
#runuser -l foam -c 'screen -S test -m -d /usr/local/bin/sclang /home/foam/ephemeral-garden/sc3-test.sc >> /home/foam/ephemeral-garden/test.log 2>&1'
|
#runuser -l foam -c 'screen -S test -m -d /usr/local/bin/sclang /home/foam/ephemeral-garden/sc3-test.sc >> /home/foam/ephemeral-garden/test.log 2>&1'
|
||||||
|
|
||||||
/usr/local/bin/sclang /home/foam/ephemeral-garden/sc3-test.sc 2>&1 >> /home/foam/ephemeral-garden/test.log
|
/usr/local/bin/sclang /home/foam/ephemeral-garden/ephemera-2CH.sc 2>&1 >> /home/foam/ephemeral-garden/test.log
|
||||||
|
|
||||||
echo "ephemeral: sclang spawned..."
|
echo "ephemeral: sclang spawned..."
|
||||||
|
|
Loading…
Reference in a new issue