August 21, 2021, 6:50pm
I’m trying to make supercollider run onto my Raspberry PI.
I followed a step-by-step guide to install it from source ( supercollider/README_RASPBERRY_PI.md at develop · supercollider/supercollider · GitHub)
So, now I can go with
sclang /path/to/my/file/file.scd, and I can hear the audio.
I was wondering if it’s possible to somehow change the content for
file.scd and let
sclang get the changes and reproduce it? I tried by entering
nano and changing it but it does not seems to work.
August 31, 2021, 12:35pm
What your are trying to do is not possible as you try.
The simplest thing you can do is to plug sclang to a fifo and bind it’s input to a file you’re editing.
Not sure of the syntax, but in bash it’s definitely possible
August 31, 2021, 1:14pm
Thanks for reply! Do you have any example on how to create this fifo on bash? Maybe I can investigate from that command.
so you want to change the content of the file while SC is running and load it again?
If so, as an alternative to the pipe, you could have a routine running inside sclang that periodically reloads the file and executes its contents, see
Let us know if you need help with that.
August 31, 2021, 5:41pm
Thanks! I see there’s a method that read a file, so it’s possible to make something like
previous = current;
current = readFile(fname);
execute the file content;
Inside of the file I’m passing to sclang?
Except you don’t have to separate reading and executing, unless you have a reason to –
"..".load will do both for you.
If you only want to do this when the file has changed, you can use
File.mtime to compare the modification time with the last time you loaded
PS: either way, you should definitely have your while loop in a routine and wait a bit each iteration. Otherwise your system will be fully occupied with checking the file thousands of times per second : )
August 31, 2021, 8:08pm
OK, its just memory, and I don’t have any bash near me
For the fifo, you create it with
in one terminal:
while true; do sclang < nameOfYourFIFO ; done
and in another terminal
cat aFile > nameOfYourFIFO
echo "().play" > nameOfYourFIFO