[SCCode] CallingFile.sc

EverydaySound > Wikis > [SCCode] CallingFile.sc

This is a Supercollider Class file that can call a .scd file from the same directory as the current file.

I call several files at the beginning and everytime I need to write the same code, so that I wrote a little class file to make it easier.

Here is the code:

CallingFile : Process {
 *new{
 arg name="";
 var file="";
 if (file=="", {file=thisProcess.nowExecutingPath.dirname},{});
 ^(file ++ "/" ++ name).loadPaths;
 }
}
//example :
//CallingFile("fileName.scd");

Save the code as “CallingFile.sc” and put it into the extensions folder.