From 5ead0a6ef648e801268a0d151ac7f295f98513e0 Mon Sep 17 00:00:00 2001 From: FoAM Date: Tue, 17 Apr 2018 13:53:57 +0000 Subject: [PATCH 1/8] supercollider test --- sc3-test.sc | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/sc3-test.sc b/sc3-test.sc index f524041..6481647 100644 --- a/sc3-test.sc +++ b/sc3-test.sc @@ -1,2 +1,30 @@ +///// // / / / / / / / +// +// supercollider tests +// +////// / / + +"e p h e m e r a l g a r d e n".postln; + +( +// sc server +Server.local.boot; +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; +) + +~snd = "/home/foam/snd/31-dawn-chorus-11m36--01.wav"; + +b = Buffer.read(s,~snd); + +a = { (PlayBuf.ar(1, b, rate: 1, loop: 1) * 0.1).dup }.play; + +//a.free; + +//b.free; + -"/// // / / / // /".postln; \ No newline at end of file From cec4f3d3f910fdd68a4ee6b75d88ac89dfbe2f77 Mon Sep 17 00:00:00 2001 From: FoAM Date: Tue, 17 Apr 2018 13:58:08 +0000 Subject: [PATCH 2/8] supercollider test --- sc3-test.sc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sc3-test.sc b/sc3-test.sc index 6481647..c9245d7 100644 --- a/sc3-test.sc +++ b/sc3-test.sc @@ -25,6 +25,4 @@ a = { (PlayBuf.ar(1, b, rate: 1, loop: 1) * 0.1).dup }.play; //a.free; -//b.free; - - +//b.free; \ No newline at end of file From 77edd242d1f5460b7f31a85135128214c192abca Mon Sep 17 00:00:00 2001 From: FoAM Date: Thu, 26 Apr 2018 17:40:40 +0000 Subject: [PATCH 3/8] headless tests --- pergola.service | 17 +++++++++++++++++ pre-setup.sh | 7 +++++++ sample-player.rb | 11 +++++------ sc3-test.sc | 29 ++++++++++++++++++++++------- setup.sh | 26 ++++++++++++++++++++++++++ 5 files changed, 77 insertions(+), 13 deletions(-) create mode 100644 pergola.service create mode 100755 pre-setup.sh create mode 100755 setup.sh diff --git a/pergola.service b/pergola.service new file mode 100644 index 0000000..3c6282a --- /dev/null +++ b/pergola.service @@ -0,0 +1,17 @@ +[Unit] +Description=Supercollisions under a pergola +#After=multi-user.target sound.target dbus.service +After=dbus.service + +[Service] +Type=simple +User=foam +Group=audio +ExecStart=/home/foam/ephemeral-garden/pre-setup.sh +StandardOutput=syslog+console +StandardError=syslog+console + +[Install] +Alias=cloud-pergola.service +#Requires=sound.target + diff --git a/pre-setup.sh b/pre-setup.sh new file mode 100755 index 0000000..cc549b8 --- /dev/null +++ b/pre-setup.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# to be run as root to setup/start/sclang +#runuser -l foam -c 'screen -S test -m -d /home/foam/ephemeral-garden/setup.sh' + +# to be run from user 'foam' crontab +screen -S test -m -d /home/foam/ephemeral-garden/setup.sh diff --git a/sample-player.rb b/sample-player.rb index 29c0b17..e2537ed 100644 --- a/sample-player.rb +++ b/sample-player.rb @@ -1,9 +1,8 @@ # -*- mode: enh-ruby; coding: utf-8; -*- -play 72 -sleep 1 - -snd = "~/snd/" -sample snd, "29", rrand_i(1,2), amp: 1.5 -sample snd, "31", rrand_i(1,2), lpf: 70, amp: 1.5 +snd = "/home/foam/snd/" +loop do + sample snd, "29", rrand_i(1,2), amp: 1.5 + #sample snd, "29", rrand_i(1,2), lpf: 70, amp: 1.5 +end diff --git a/sc3-test.sc b/sc3-test.sc index c9245d7..1d9ad88 100644 --- a/sc3-test.sc +++ b/sc3-test.sc @@ -4,25 +4,40 @@ // ////// / / + "e p h e m e r a l g a r d e n".postln; -( + // sc server -Server.local.boot; 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; -~snd = "/home/foam/snd/31-dawn-chorus-11m36--01.wav"; +"...".post; -b = Buffer.read(s,~snd); +s.waitForBoot { + Routine { + + ~snd = "/home/foam/snd/31-dawn-chorus-11m36--01.wav"; + + "...".post; -a = { (PlayBuf.ar(1, b, rate: 1, loop: 1) * 0.1).dup }.play; + b = Buffer.read(s,~snd); + + 1.wait; + + "...>>".post; + a = { (PlayBuf.ar(1, b, rate: 1, loop: 1) * 0.1).dup }.play; + + }.play; +}; + +"<<...".post; //a.free; -//b.free; \ No newline at end of file +//b.free; diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..fed5900 --- /dev/null +++ b/setup.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# via -> http://sc3howto.blogspot.be/2015/04/how-to-keep-installation-running-on.html + +export DISPLAY=:0 +#export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus +#export XDG_RUNTIME_DIR=/run/user/1001 +export JACK_NO_AUDIO_RESERVATION=1 + +port=57110 + +echo "ephemeral: ------------------------------------------------------------" +echo "ephemeral: `/bin/date`" +echo "ephemeral: as user `whoami`" +#echo "ephemeral: with env -> `env`" +echo "ephemeral: waiting..." + +sleep 5 + +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' + +/usr/local/bin/sclang /home/foam/ephemeral-garden/sc3-test.sc 2>&1 >> /home/foam/ephemeral-garden/test.log + +echo "ephemeral: sclang spawned..." From 95f23a7bf5108674901d11162ed63c7a0b29704b Mon Sep 17 00:00:00 2001 From: FoAM Date: Thu, 26 Apr 2018 17:43:50 +0000 Subject: [PATCH 4/8] sounds --- README.md | 1 - pergola.service | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 619fa67..5dda0af 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,3 @@ "The Ephemeral Garden evokes the sense of convivial gatherings under a pergola. The murmur of conversation, complemented with the sound of animate matter. Growing plants, crackling wood, expanding rocks, crawling insects and the invisible signals emanating from all-pervasive electronic devices. Human and non-human voices intermingle. An ambience that is thick and alive, filled with liminal whispers otherwise unheard. Field recordings and synthetic sounds combine to create a continuously changing atmosphere. Beings come and go, the noise rises and subsides. The garden awakens with daylight, buzzes with activity throughout the day, then quietens at dusk. Its character adapting to the changing of seasons..." https://fo.am/pergola/ - diff --git a/pergola.service b/pergola.service index 3c6282a..678178c 100644 --- a/pergola.service +++ b/pergola.service @@ -1,7 +1,7 @@ [Unit] Description=Supercollisions under a pergola -#After=multi-user.target sound.target dbus.service -After=dbus.service +#After=multi-user.target sound.target +After=sound.target [Service] Type=simple From 890f0675f86786f1a1b8c448dd23ef9ed7c7c6ac Mon Sep 17 00:00:00 2001 From: FoAM Date: Thu, 26 Apr 2018 17:50:13 +0000 Subject: [PATCH 5/8] services --- pergola.service | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pergola.service b/pergola.service index 678178c..c0253e2 100644 --- a/pergola.service +++ b/pergola.service @@ -1,7 +1,6 @@ [Unit] Description=Supercollisions under a pergola -#After=multi-user.target sound.target -After=sound.target +After=multi-user.target sound.target [Service] Type=simple @@ -13,5 +12,4 @@ StandardError=syslog+console [Install] Alias=cloud-pergola.service -#Requires=sound.target - +Requires=sound.target From 19e60e5669aff7785897b5c9a0fa240b734b241d Mon Sep 17 00:00:00 2001 From: FoAM Date: Sun, 29 Apr 2018 10:16:28 +0000 Subject: [PATCH 6/8] crontabulation --- .gitignore | 1 + crontab.txt | 33 +++++++++++++++++++++++++++++++++ evening.sh | 5 +++++ morning.sh | 5 +++++ 4 files changed, 44 insertions(+) create mode 100644 .gitignore create mode 100644 crontab.txt create mode 100644 evening.sh create mode 100644 morning.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/crontab.txt b/crontab.txt new file mode 100644 index 0000000..9e90deb --- /dev/null +++ b/crontab.txt @@ -0,0 +1,33 @@ +# Edit this file to introduce tasks to be run by cron. +# +# Each task to run has to be defined through a single line +# indicating with different fields when the task will be run +# and what command to run for the task +# +# To define the time you can provide concrete values for +# minute (m), hour (h), day of month (dom), month (mon), +# and day of week (dow) or use '*' in these fields (for 'any').# +# Notice that tasks will be started based on the cron's system +# daemon's notion of time and timezones. +# +# Output of the crontab jobs (including errors) is sent through +# email to the user the crontab file belongs to (unless redirected). +# +# For example, you can run a backup of all your user accounts +# at 5 a.m every week with: +# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ +# +# For more information see the manual pages of crontab(5) and cron(8) +# +# m h dom mon dow command + +# in foam's crontab. check timezone and clock sync + +# */5 * * * * /home/foam/ephemeral-garden/check.sh >> /home/foam/ephemeral-garden/test.log 2>&1 +* 07 * * * /home/foam/ephemeral-garden/morning.sh >> /home/foam/ephemeral-garden/test.log 2>&1 +* 22 * * * /home/foam/ephemeral-garden/evening.sh >> /home/foam/ephemeral-garden/test.log 2>&1 + +# in root's crontab. check timing +# 0 4 * * * /sbin/shutdown -r now + + diff --git a/evening.sh b/evening.sh new file mode 100644 index 0000000..5cd4a75 --- /dev/null +++ b/evening.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# evening. clean up and stop processes + +echo "evening: `date`" diff --git a/morning.sh b/morning.sh new file mode 100644 index 0000000..acda7b4 --- /dev/null +++ b/morning.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +# morning. set up and start processes + +echo "morning: `date`" From 6cc0dab3cb726bef76072051c3a94e12dcb7be02 Mon Sep 17 00:00:00 2001 From: FoAM Date: Wed, 9 May 2018 22:44:44 +0000 Subject: [PATCH 7/8] simple file player --- ephemera.sc | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 ephemera.sc diff --git a/ephemera.sc b/ephemera.sc new file mode 100644 index 0000000..c2fe77f --- /dev/null +++ b/ephemera.sc @@ -0,0 +1,136 @@ +///// // / / / / / / / +// +// 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; + + +~background = { + + "background >> ".post; + + // list of soundfiles + ~sources = [ + "/home/pi/snd/39-incomprehensible-restaurtant-chatter-02.wav", + "/home/pi/snd/39-incomprehensible-restaurtant-chatter-03.wav", + "/home/pi/snd/39-incomprehensible-restaurtant-chatter-04.wav", + "/home/pi/snd/46-afternoon-chorus-02.wav", + "/home/pi/snd/46-afternoon-chorus-03.wav", + "/home/pi/snd/46-afternoon-chorus-04.wav", + ]; + + // select random element from the list + ~file = ~sources.choose; + ~file.postln; + + // read file then play buffer + Buffer.read (server: s, path: ~file, action: ~play1); +}; + +~foreground = { + + "foreground >> ".post; + + // list of soundfiles + ~sources = [ + "/home/pi/snd/26-multilayered-conversations-01.wav", + "/home/pi/snd/26-multilayered-conversations-02.wav", + "/home/pi/snd/39-incomprehensible-restaurtant-chatter-02.wav", + "/home/pi/snd/39-incomprehensible-restaurtant-chatter-03.wav", + "/home/pi/snd/39-incomprehensible-restaurtant-chatter-04.wav", + "/home/pi/snd/26-party-chatter-02.wav", + "/home/pi/snd/26-party-chatter-03.wav", + "/home/pi/snd/26-party-chatter-04.wav", + "/home/pi/snd/06-uw-pebbles-urchins-waves.wav", + "/home/pi/snd/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: ~file, action: ~play2); +}; + +~play1 = { arg b1; + Routine { + "~play [bg - ".post; b1.path.post; "]".postln; + + {(PlayBuf.ar(1, b1, rate: 1, loop: 0, doneAction: 2) * 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 = 2; // how many background layers? + q = 3; // 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 + + +// via http://danielnouri.org/docs/SuperColliderHelp/Tutorials/Getting-Started/Buffers.html +// Streaming a File in From Disk + + +// In some cases, for instance when working with very large files, you might not want to load a sound completely into memory. Instead, you can stream it in from disk a bit at a time, using the UGen DiskIn, and Buffer's 'cueSoundFile' method: + + // ( + // SynthDef("tutorial-Buffer-cue",{ arg out=0,bufnum; + // Out.ar(out, + // DiskIn.ar( 1, bufnum ) + // ) + + // }).send(s); + // ) + + + // b = Buffer.cueSoundFile(s,"sounds/a11wlk01-44_1.aiff", 0, 1); + // y = Synth.new("tutorial-Buffer-cue", [\bufnum,b.bufnum], s); + + // b.free; y.free; + + +// This is not as flexible as PlayBuf (no rate control), but can save memory. \ No newline at end of file From 0ec048f65bdeb7f6cc3921add9ec71ae79969f77 Mon Sep 17 00:00:00 2001 From: FoAM Date: Thu, 10 May 2018 14:18:53 +0000 Subject: [PATCH 8/8] pergolate --- ephemera.sc | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/ephemera.sc b/ephemera.sc index c2fe77f..0c23a95 100644 --- a/ephemera.sc +++ b/ephemera.sc @@ -26,12 +26,12 @@ s.boot; // list of soundfiles ~sources = [ - "/home/pi/snd/39-incomprehensible-restaurtant-chatter-02.wav", - "/home/pi/snd/39-incomprehensible-restaurtant-chatter-03.wav", - "/home/pi/snd/39-incomprehensible-restaurtant-chatter-04.wav", - "/home/pi/snd/46-afternoon-chorus-02.wav", - "/home/pi/snd/46-afternoon-chorus-03.wav", - "/home/pi/snd/46-afternoon-chorus-04.wav", + "/home/foam/snd/39-incomprehensible-restaurtant-chatter-02.wav", + "/home/foam/snd/39-incomprehensible-restaurtant-chatter-03.wav", + "/home/foam/snd/39-incomprehensible-restaurtant-chatter-04.wav", + "/home/foam/snd/46-afternoon-chorus-02.wav", + "/home/foam/snd/46-afternoon-chorus-03.wav", + "/home/foam/snd/46-afternoon-chorus-04.wav", ]; // select random element from the list @@ -48,16 +48,16 @@ s.boot; // list of soundfiles ~sources = [ - "/home/pi/snd/26-multilayered-conversations-01.wav", - "/home/pi/snd/26-multilayered-conversations-02.wav", - "/home/pi/snd/39-incomprehensible-restaurtant-chatter-02.wav", - "/home/pi/snd/39-incomprehensible-restaurtant-chatter-03.wav", - "/home/pi/snd/39-incomprehensible-restaurtant-chatter-04.wav", - "/home/pi/snd/26-party-chatter-02.wav", - "/home/pi/snd/26-party-chatter-03.wav", - "/home/pi/snd/26-party-chatter-04.wav", - "/home/pi/snd/06-uw-pebbles-urchins-waves.wav", - "/home/pi/snd/17-uw-waves-crashing-on-pebble-beach-slow.wav" + "/home/foam/snd/26-multilayered-conversations-01.wav", + "/home/foam/snd/26-multilayered-conversations-02.wav", + "/home/foam/snd/39-incomprehensible-restaurtant-chatter-02.wav", + "/home/foam/snd/39-incomprehensible-restaurtant-chatter-03.wav", + "/home/foam/snd/39-incomprehensible-restaurtant-chatter-04.wav", + "/home/foam/snd/26-party-chatter-02.wav", + "/home/foam/snd/26-party-chatter-03.wav", + "/home/foam/snd/26-party-chatter-04.wav", + "/home/foam/snd/06-uw-pebbles-urchins-waves.wav", + "/home/foam/snd/17-uw-waves-crashing-on-pebble-beach-slow.wav" ]; // select random element from the list @@ -76,7 +76,7 @@ s.boot; // free buffer once done? "freed [bg - ".post; b1.path.post; "]".postln; - b1.free + b1.free; ~background.value; }.play; };