Scintillator ScinthDef File Format:
Filter:
Scintillator/Reference (extension) | Quarks > Scintillator > Developer Documentation

Scintillator ScinthDef File Format
ExtensionExtension

Description of ScinthDef file format used by Scintillator synth server.

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:

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.

keyYAML typenotes
namestringname of the ScinthDef, used as primary means of identification
shapedictionaryA map describing the geometry to render the ScinthDef with
optionsdictionaryA optional map describing rendering options for the ScinthDef
parameterslistAn optional key, if the ScinthDef has parameters, will be parameter dictionaries in an ordered list
tweenslistAn optional key, an ordered list of tween dictionaries
vgenslistthe 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.

keyvalues
polygonMode
fillThe default, fills the polygons completely.
lineOutlines the polygons only.
pointDraws the vertices as points only.

Parameter Dictionary Spec

Specifies the parameters that can be modifed by OSC commands such as /scin_n_set while Scinth instances of this ScinthDef are running.

keyYAML typenotes
namestringName of the parameter.
defaultValuefloatThe default value of the parameter.

Tween Dictionary Spec

As Scintillator precomputes tween curves at ScinthDef time and saves them into textures, tweens are specified separately from VGens. This ordered list of dictionary entries allows VGens to specify tween curves as inputs by choosing an index.

keyYAML typenotes
levelslistA list of either individual float elements or sublists of 1, 2, or 4 float elements, describing tween targets.
durationslistA list of individual float elements, of the same length as levels less 1, giving durations of segments in seconds.
curvesint or listDetermines the shape of the envelope segments. If one string is provided all segments are assigned that shape, or can be a list of the same length as durations that specifies individual shapes for each segment. For the list of currently supported shapes see the ScinTween documentation.
sampleRatefloatSpecified as samples per second, controls how often the entire tweening function should be sampled
dimensionintA number, either 1, 2, or 4, describing the dimension of the level values
loopbooleanOn optional key, default false. If present describes if the tween should loop on its values.

VGen Dictionary Spec

Individual VGens are specified as YAML dictionaries and have the following keys:

keyYAML typenotes
classNamestringname of the VGen class, must match the name of a VGen configured on the server
ratestringone of frame, shape, or pixel
samplerdictionaryOnly required for sampling VGens. Specifies sampler parameters.
tweendictionaryOnly present when a Tween input is present, specifies the index of the Tween to use.
inputslistinput YAML dictionaries in an ordered list. May be absent if VGen has no inputs.
outputslistoutput 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 VSampler parameters.

keyYAML typenotes
imageintegerDepending on imageArgType, either an image buffer number or the index of the parameter expected to contain the image buffer number.
imageArgTypestringEither constant, in which case image must be a valid image buffer number, or parameter, in which case image must be a valid parameter index.
minFilterModestringOptional. Either linear or nearest. Default is linear.
magFilterModestringOptional. Either linear or nearest. Default is linear.
enableAnisotropicFilteringbooleanOptional. Default is true.
addressModeUstringOptional. One of repeat, mirroredRepeat, clampToEdge, or clampToBorder. Default is clampToBorder.
addressModeVstringOptional. One of repeat, mirroredRepeat, clampToEdge, or clampToBorder. Default is clampToBorder.
clampBorderColorstringOptional. Ignored unless addressMode is clampToBorder, in which case it is one of transparentBlack, black, or white. Default is transparentBlack.

Tween

A VGen that requires a bound Tween for sampling should specify the tween index of the VGen to bind using the tween dictionary.

keyYAML typenotes
indexintegerThe index of specific Tween in the ScinthDef tweens table to use.

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:

keyYAML typenotes
namestringAn optional string, provided for readability
dimensionintegerThe dimensionality of the input
typestringAn 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:

typeformat
vgen
keyYAML typenotes
vgenIndexintThe index of the VGen providing output to this input
outputIndexintThe output index on that VGen

constant
keyYAML typenotes
valuefloatAll constants will be treated as floating point numbers

parameter
keyYAML typenotes
indexintThe parameter index to use.

VGen Output Dictionary Spec

Output entries specify dimensions on each output.

keyYAML typenotes
dimensionintegerThe dimension of this output.

Example

We execute the following code:

And ScinthDef produces the following: