headless tests

This commit is contained in:
FoAM 2018-04-26 17:40:40 +00:00
parent cec4f3d3f9
commit 77edd242d1
5 changed files with 77 additions and 13 deletions

17
pergola.service Normal file
View file

@ -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

7
pre-setup.sh Executable file
View file

@ -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

View file

@ -1,9 +1,8 @@
# -*- mode: enh-ruby; coding: utf-8; -*- # -*- mode: enh-ruby; coding: utf-8; -*-
play 72 snd = "/home/foam/snd/"
sleep 1
snd = "~/snd/" loop do
sample snd, "29", rrand_i(1,2), amp: 1.5 sample snd, "29", rrand_i(1,2), amp: 1.5
sample snd, "31", rrand_i(1,2), lpf: 70, amp: 1.5 #sample snd, "29", rrand_i(1,2), lpf: 70, amp: 1.5
end

View file

@ -4,25 +4,40 @@
// //
////// / / ////// / /
"e p h e m e r a l g a r d e n".postln; "e p h e m e r a l g a r d e n".postln;
(
// sc server // sc server
Server.local.boot;
s = Server.local; s = Server.local;
//s.options.memSize = 1024 * 1024; //s.options.memSize = 1024 * 1024;
//s.options.maxNodes = 1024 * 1024; //s.options.maxNodes = 1024 * 1024;
//s.options.numBuffers = 1024 * 1024 * 1024; //s.options.numBuffers = 1024 * 1024 * 1024;
//s.latency = 0.05; //s.latency = 0.05;
s.options.sampleRate = 44100; s.options.sampleRate = 44100;
) s.boot;
"...".post;
s.waitForBoot {
Routine {
~snd = "/home/foam/snd/31-dawn-chorus-11m36--01.wav"; ~snd = "/home/foam/snd/31-dawn-chorus-11m36--01.wav";
"...".post;
b = Buffer.read(s,~snd); b = Buffer.read(s,~snd);
1.wait;
"...>>".post;
a = { (PlayBuf.ar(1, b, rate: 1, loop: 1) * 0.1).dup }.play; a = { (PlayBuf.ar(1, b, rate: 1, loop: 1) * 0.1).dup }.play;
}.play;
};
"<<...".post;
//a.free; //a.free;
//b.free; //b.free;

26
setup.sh Executable file
View file

@ -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..."