Scintillator ScinthDef File Format
See also: VGen ScinthDef Synth-Definition-File-Format
This is the documentation for the file format used to describe a Video synth, called a ScinthDef, to the Scintillator synth server, scinsynth. The development file format is in YAML, making for easier human readability and debugging. However, despite the difference in format from SuperCollider SynthDef files, the ScinthDef files mostly follow the same structure so should look conceptually familiar. The primary differences are:
-
YAML can provide the length of a list of objects and so we omit sizes of lists as separate fields.
-
Constants are defined inline, instead of at the header block at the top of the file.
File Format
Top-Level Dictionary Spec
A ScinthDef file contains one or more YAML documents. Each document roughly follows the SuperCollider SynthDef structure except for that Constants are not identified verbatim but are rather provided directly in the input spec, in keeping with the desire to allow ScinthDef files to be human-readable, as well as the fact that the shader generation code inside of the synth does not require the constants to be separated out.
key |
YAML type |
notes |
|
string |
name of the ScinthDef, used as primary means of identification |
|
dictionary |
A map describing the geometry to render the ScinthDef with |
|
dictionary |
A optional map describing rendering options for the ScinthDef |
|
list |
An optional key, if the ScinthDef has parameters, will be Parameter YAML dictionaries in an ordered list |
|
list |
the VGen YAML dictionaries in an ordered list |
Shape Dictionary Spec
The sole required key for the shape dictionary is the name
key, with the rest of the keys being dependent on the specific shape specified. Currently the only supported shape is the Quad, which takes two optional additional keys, widthEdges
and heightEdges
. Both have default values of 1 and indicate how many edges the quad should tesselate into.
Options Dictionary Spec
If ommitted the ScinthDef will use defaults for all values. The pairs of keys and values supported are detailed here. These are the same keys and values supported in the ScinthDef options
dictionary.
key |
values | ||||||
|
|
Parameter Dictionary Spec
key |
YAML type |
notes |
|
string |
Name of the parameter. |
|
float |
The default value of the parameter. |
VGen Dictionary Spec
Individual VGens are specified as YAML dictionaries and have the following keys:
key |
YAML type |
notes |
|
string |
name of the VGen class, must match the name of a VGen configured on the server |
|
string |
one of |
|
dictionary |
Only required for sampling VGens. Specifies sampler parameters. |
|
list |
input YAML dictionaries in an ordered list. May be absent if VGen has no inputs. |
|
list |
output YAML dictionaries in an ordered list |
VGen Sampler Dictionary Spec
Sampling VGens must include the sampler dictionary, which contains configuration data for the image sampler. For more details see the documentation on Sampler parameters.
key |
YAML type |
notes |
|
integer |
Depending on |
|
string |
Either |
|
string |
Optional. Either |
|
string |
Optional. Either |
|
boolean |
Optional. Default is |
|
string |
Optional. One of |
|
string |
Optional. One of |
|
string |
Optional. Ignored unless |
VGen Input Dictionary Spec
Inputs to VGens are polymorphic, and takes on a different structure depending on what kind of input is specified in the type
field. All input dictionaries supply the type
key as well as an optional name
field:
key |
YAML type |
notes |
|
string |
An optional string, provided for readability |
|
integer |
The dimensionality of the input |
|
string |
An enumerated type, for possible values see below |
The rest of the keys in the Input dictionary are a function of type and are detailed here:
type |
format | |||||||||
|
| |||||||||
|
| |||||||||
|
|
VGen Output Dictionary Spec
Output entries specify dimensions on each output.
key |
YAML type |
notes |
|
integer |
The dimension of this output. |
Example
We execute the following code:
(
~k = ScinthDef.new(\foo, {
BWOut.pr(VSinOsc.pr(200.0, 0.0, 0.9, 0.2));
});
~k.asYAML.postln;
)
And ScinthDef produces the following:
name: foo
shape:
name: Quad
widthEdges: 1
heightEdges: 1
vgens:
- className: VSinOsc
rate: pixel
inputs:
- type: constant
dimension: 1
value: 200.0
- type: constant
dimension: 1
value: 0.0
- type: constant
dimension: 1
value: 0.9
- type: constant
dimension: 1
value: 0.2
outputs:
- dimension: 1
- className: BWOut
rate: pixel
inputs:
- type: vgen
vgenIndex: 0
outputIndex: 0
dimension: 1
outputs:
- dimension: 4