This is a SuperCollider variant of Dirt, the sound engine for the Tidal http://tidalcycles.org/ programming language by Alex McLean. Most of SuperDirt can be rewritten at runtime: you can add and modify effects, synth defs, load samples incrementally, and spatialise to any number of channels. You can use SuperCollider as usual.
Many examples can be found in the folders: hacks/
and scripts/
The examples suppose that environment variables are accessible. If you want to use ProxySpace or similar redirect environments, see below.
All startup files and examples use the environment variables, like ~dirt
. If you want to use ProxySpace or similar redirect environments, you should bind these to their respective file (which needs to be saved to disk):
Return a new instance, ready to be started
numChannels |
The number of channels of the internal bus (this is also the maximal number of output channels). |
server |
Server to play on. |
Specifies the maximum number of channels your sound files have (default is 2: stereo samples)
Convenience method that gives defaults for many situations. It configures the server and starts SuperDirt with a number of orbits. It allows you to pass a few parameters:
numChannels |
The number of channels of the SuperDirt instance (see above). |
server |
Server to play on. |
numOrbits |
number of orbits to create on startup (see: DirtOrbit). You can add or remove them later. |
port |
The port to listen on (default is 57120) |
senderAddr |
The address to listen to (a String). |
path |
A path that is used to load some sound files. This is a string, a path pointing to a number of files, which usually contains a wildcard ( |
Post a string with the tidal language parameter definitions for a number of SynthDefs. Duplicates are removed automatically. Note that these all use (Nothing)
, because defaults are defined in the SynthDef default arguments.
Example: let (freq, _) = pF "freq" (Nothing)
synthNames |
A symbol or array of symbols of the SynthDef names for which to generate the tidal code. |
excluding |
The parameter names which should be excluded. Names already defined and used internally by SuperDirt will be excluded in additinon tho these. |
A list of DirtOrbits. Orbits are the basic elements of dirt. Each has its own global effects and global settings. You can start any number of orbits any time. From tidal, you can direct sounds into an orbit by the parameter: # orbit "7"
(this sends to orbit 7, if it exists, otherwise it'll wrap to whatever is available.)
If set to true
, any sound files are not read but only their paths registered, so that they can be read when needed. This may result in a missing sound when it is played first. It is useful when computer memory is limited.
Read a number of sound file from disk and load them into the server memory. The buffer information is also kept in buffers, a dictionary. You can do this any time while running, and incrementally add more files.
Given a path like: "path/to/my/basedrum/*"
.
The dictionary will contain under the key 'basedrum'
an Array of all the Buffers from the samples found in the folder.
From tidal, they can be accessed e.g. by d1 $ sound $ "basedrum:1 basedrum:4"
, or alternatively by the n
parameter. Sample numbers below zero or above the number of samples in the folder will wrap, i.e. if you have a folder of 4 samples, 5 will play 0.
paths |
Specifies paths for sound files. This is a string, a path pointing to a number of files, which usually contains a wildcard ( Alternatively, you can pass in an Array of full paths, e.g. |
appendToExisting |
If set to true, this will keep existing dictionary keys (see above) and add the new samples to any existing ones. This allows you to load different folders with the same name. Otherwise it will only keep those existing names which are not found in the new set of samples. |
namingFunction |
Provide a function to generate your own instrument names, which you call from tidal. The function is passed the folder path (a String). By default, this function is |
Read a single folder of sound files and add all of them under 'name'
to the sample instruments. You can do this any time while running, and incrementally add more files.
folderPath |
The path for the folder. |
name |
The name of the sample instrument as it will be used in tidal. Subsequent sound files can be addressed by passing the "n" parameter, e.g. |
appendToExisting |
See: -loadSoundFiles |
Read a single sound file and add it under 'name'
to the sample instruments. You can do this any time while running, and incrementally add more files.
path |
The path for the file. |
name |
The name of the sample instrument as it will be used in tidal |
appendToExisting |
See: -loadSoundFiles |
Read a number of named folders. You can do this any time while running, and incrementally add more files.
names |
An array of symbols or strings. These are folder names and at the same time instrument names for tidal. |
path |
The path in which the folders can be found. |
appendToExisting |
See: -loadSoundFiles |
Remove sound files and free their memory.
names |
An array of sample instrument names which to remove. |
Remove all sound files and free their memory.
A list of valid sound file extensions, which can be extended (default: ["wav", "aif", "aiff", "aifc"]
). In theory, all libsndfile formats should be supported http://www.mega-nerd.com/libsndfile/#Features.
Post a list of all existing sample names, the number of variants, the range of durations, and memory requirement.
e.g.
circus (3) 0.17 - 0.52 sec (171 kB)
.
Load a number of files, usually containing SynthDefs.
path |
This is a string, a path pointing as´file or a to a number of files, which then contains a wildcard ( |
This method starts SuperDirt. It creates a number of DirtOrbits (each of which has global effects, output busses, and settings). It also opens a network connection.
port |
The port to listen on (default is 57120) |
outBusses |
An (a Array) of audio output channels: it determines how many DirtOrbits there will be. |
senderAddr |
The address to listen to (a String). |
End all audio processes and close network responder.
End all audio processes, close network responder, and free sound file resources.