Hi There,
I was reading around here in the forum and discovered a couple of questions relating to organising a multiple file project. I also have this situation.
I found a discussion on using "..../files/*.sc{d}".loadPaths
or loadRelatives and also a tip in using compileFile
from Interpreter | SuperCollider 3.12.2 Help
However I have a bunch of class files that don’t get compiled using any of those methods. My solution has been a Makefile that copies all my classes to the Extensions directory and then starts my main program.
I would like to have a solution that does not require copying my files into the extensions folder, is there one? Something along the lines of an include or import that we all know from other languages.
For local development, for me it’s fine to use a Makefile however for distribution of larger codebases, I find it’s not an ideal solution.
I’m not using the SC IDE, instead this is Emacs-with-terminal-window development!
I’m sorry if this is a duplication of another question
Cheers,
Gregorius
Yes. SuperCollider->Preferences->Interpreter->Include. Add any folders there that you want compile and they will do so at compile time.
UGens are trickier, but not impossible. I added the following to my “startup.scd” file (File->Open startup file):
Server.local.options.ugenPluginsPath = [
thisProcess.platform.classLibraryDir.dirname+/+"plugins",
"~/Library/Application Support/SuperCollider/Extensions/".standardizePath,
"/Users/spluta1/Documents/faust/CompiledPlugins_M1/".standardizePath, //custom path
];
This augments the standard folders with the custom path where my faust plugins are compiled to.
Sam
I missed the emacs thing. I think you can do this by editing the sclang_conf.yaml file directly. Mine looks something like this:
includePaths:
- /Users/spluta1/Library/Application Support/SuperCollider/downloaded-quarks/SafetyNet
- /Users/spluta1/Library/Application Support/SuperCollider/downloaded-quarks/Singleton
- /Users/spluta1/Library/Application Support/SuperCollider/downloaded-quarks/XML
etc…
Cheers, that worked
I took the yaml config options and included a config file into my working directory:
.sclang_conf.yaml
includePaths:
- ./classes
- ./extensions
Then when I start my main code, I include the yaml as options:
sclang -l .sclang_config.yaml main.scd
Thankfully relative paths also work in the context of the yaml file