Compiling scd files from command line scsynth

Hi, so I’ve been messing with external synths in sonic pi, got compiling them working from the gui supercollider IDE program, but I was wondering: how I can build these synthdefs from the commandline supercollider server that comes with sonic pi?
Ideally I want to make a batch file that iterates through all the .scd files in a directory and compiles them, but I can’t make heads or tails of the scserver tool, and all the supercollider documentation I can find seems to be focused on the gui IDE.

I was wondering if the scgui tool comes with the bundles supercollider server that is packaged with SonicPI…

I may be wrong, but AFAIK compiling a synth definitely requires the GUI/client side app, and then the compiled synth definition is run by the server.
Ie, scsynth.exe only knows how to take compiled synthdefs and run them.
There are no Supercollider GUI/client side binaries included with Sonic Pi.

As to automating the process of compiling a bunch of synthdefs, it may be possible, but I’ve never explored it myself. It would definitely be possible from the SC GUI, but I wouldn’t know about the command line without doing more research :man_shrugging:

Happy for others to chime in if they know something I don’t…

1 Like

Ah yeah, on digging deeper looks like to run from the commandline you need to run it through the sclang executable.
sclang fileWithDefInIt.scd

It would be cool if Sonic pi could ship with that executable, maybe have a default “customsynth” folder with a compile synths menu option that appears with external synths enabled. Also then you could define the writeDefFile path relatively so new synths could just be copied into the folder without having to worry about editing them for your path.

Wouldn’t be too hard to add, I’d offer to give it a try myself, but might be out of the scope of what sonic-pi’s primary focus/vision is.

1 Like

It’s an interesting thought to be sure, worth a discussion. (Also, re the custom synths folder, I had imagined something along those lines for my work to enable easy sharing and handling of custom synths).