Sclang Startup File:
Reference | Language

Sclang Startup File

The sclang startup file

Once the class library is finished compiling the interpreter looks for a file at Platform.userConfigDir +/+ "startup.scd" and if such a file exists, executes any code within it (this happens within Main: -startup). By creating a file in this location you can make user specific customizations.

~/.config/SuperCollider/startup.scd, according to the xdg base directory specification
~/Library/Application Support/SuperCollider/startup.scd
C:\\SuperCollider\\startup.scd (or similar, depending on the location of the SuperCollider installation)

A common example would be to alter the options of the local and internal Servers:

// placing the following code in the file will cause these modifications to be made
// at startup (see also: ServerOptions)

Server.local.options.numOutputBusChannels = 4;    // change number of input and output channels
Server.local.options.numInputBusChannels = 4;
Server.internal.options.numOutputBusChannels = 4;
Server.internal.options.numInputBusChannels = 4;

Server.local.options.device = "Built-in Audio";    // use a specific soundcard
Server.local.options.device = "MOTU Traveler";
Server.local.options.device = "TASCAM US-122";
Server.local.options.device = "Jack Router";
Server.local.options.device = nil;                // use the system default soundcard

Server.local.options.blockSize = 128; // increase block size (default is 64)
Server.internal.options.blockSize = 128;

Server.local.options.sampleRate = 96000; // increase sampling rate (if your hardware supports it)
Server.internal.options.sampleRate = 96000;
Server.internal.options.sampleRate = nil;    // use the currently selected samplerate of the soundcard

// change the standard archive path to a custom one:
Archive.archiveDir = "~/scwork".standardizePath;

// hook up jack ports to audio channels

Naturally the file must contain only valid SC expressions.