Writing your own Scene file
Last updated
Last updated
Writing a Scene file is a relatively straightforward process. This guide takes a tutorial-like approach and guides you through creating your own Scene file from scratch. For more advanced operations, you may instead want to read the , which dives into greater detail.
First, create a file ending in .sds. For example, 7.1Surround.sds
. In this file, start by adding the following line:
You can replace 1.4 with the version of the specification you want to use, by referring to .
This tells Spatial Creator that the file is a Scene file and that it is using version 1.2 of the specification. Indicating the version helps Spatial Creator know how to process the file.
To make your file easier to read, you may also add comments, start with '
(apostrophe). These are completely ignored by Spatial Creator when reading your Scene file.
Scene files contain Scene instructions. They consist of an action and (optionally) parameters to use with it, similar to a function in a programming language.
The contains the list of all the supported instructions.
You start your Scene file by writing two instructions that indicate (respectively) the format of the output audio and the layout of the different channels to use.
For the audio format, you use the instruction, specifying (in this order) the number of channels, the bit depth and the sample rate. In our example, you would do something like this:
Here is how you would configure a 16 channel audio encoded at 24 bit 192 kHz:
This allows for a great amount of customization, as you will be able to use these channels however you want, therefore adapting to the audio system you may have.
The channel layout indicates the physical position of your audio channels. For example, while a 7.0 surround system a 6.1 surround system both have 7 channels, they do not make use of these channels in the same way. Usually, you would use one of the predefined constants, such as:
In conclusion, while this information is not required, many surround systems, both physical and virtual (e.g. Dolby Atmos) make use of this information, so it is important to add it.
Spatial Creator uses machine learning to separate a song into multiple "stems" (instruments) so that you can mix them and associate them with different channels.
The go-to configuration is to generate all the stems using the default model, which is done using:
But you can also only generate 2 stems, one for a specific instrument you want, and another for the rest of the audio. For example, if you only want to separate vocals from the rest of the song:
In our 7.1 surround example, to map vocals to the center channel, you can do:
We used 50% volume because the volume of each channel (left and right) will add up to 100%. Note that this also allows you to adjust the balance, for example:
Will make the left part of the original song's vocals louder. Note that
As of now, you can only use the channel number, meaning you will have to know how each channel is being used.
This, of course, remains entirely optional and is not required to produce correct output.
Finally, after you are done processing everything, you need to export the processed audio into a file. You can choose the format you want, such as AAC or FLAC. You can also apply an output filter to change your sound. To use FLAC without any output filter, you would do something like:
is a constant, which means that Spatial Creator will automatically replace it with its corresponding value, which is 8
in our case. If you would like to use an arbitrary number of channels, you can also do this by simply using a number instead.
However, you might have a more complex audio setup, in which case you may need to specify your channel layout manually. To do this, you will have to specify a for each of your channels. In our example, instead of LAYOUT_7_1
, you can use:
If you want a simpler separation that only gives you vocals and the rest of the song, you can also use :
If you are only going to work with stereo audio, you can use to not separate anything and just get both stereo channels in the "other" stem:
Mappings are used to associate a stem of your song to a specific surround channel, and also adjust its volume ("gain"). To do that, you use the instruction, specifying (in this order) the stem, which channel to map it to, and the volume as a percentage (1
being 100%).
Does not work, because Spatial Creator does not know how you want to mix the vocals stem. This stem is, by default, stereo, and mixing it down into mono might not be what you want. This would give us an "Stem 1 is stereo and cannot be mapped to a channel.", meaning we have to use one of the mono stems ( or ) to configure mappings.
Distance is an (optional) effect you can add between two audio tracks to create an effect of distance on them, making them sound like they are farther away. This is simply done using the instruction and mentioning the two channels to create distance between:
If you are unsure which format to use, we recommend you use as it is the most compatible, even though it does not offer any compression. It is also important to keep in mind.
That's it! You have created your own Scene file. Using it is the same process as using a built-in Scene file, which we have already discussed on .