Writing your own Scene file

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 specification reference itself, which dives into greater detail.

1. Creating the file

First, create a file ending in .sds. For example, 7.1Surround.sds. In this file, start by adding the following line:

%Srdr-1.4

You can replace 1.4 with the version of the specification you want to use, by referring to the support listing.

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.

2. Scene instructions

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 Scene specification reference contains the list of all the supported instructions.

3. Basic configuration

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.

3.1. Output audio format

For the audio format, you use the Chs 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:

Chs: CHANNELS_7_1; 16; 44100

CHANNELS_7_1 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.

Here is how you would configure a 16 channel audio encoded at 24 bit 192 kHz:

Chs: 16; 24; 192000

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.

3.2. Channel layout

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:

Lay: LAYOUT_7_1

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 label name for each of your channels. In our example, instead of LAYOUT_7_1, you can use:

Lay: FL; FR; FC; LFE; BL; BR; SL; SR

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.

4. Stem separation

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:

Sep: STEMS_ALL; MODEL_DEFAULT

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:

Sep: STEMS_VOCALS; MODEL_DEFAULT

If you want a simpler separation that only gives you vocals and the rest of the song, you can also use STEMS_SIMPLE:

Sep: STEMS_SIMPLE

If you are only going to work with stereo audio, you can use STEMS_COPY to not separate anything and just get both stereo channels in the "other" stem:

Sep: STEMS_COPY

5. Mappings

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 Map instruction, specifying (in this order) the stem, which channel to map it to, and the volume as a percentage (1 being 100%).

In our 7.1 surround example, to map vocals to the center channel, you can do:

Map: STEMS_VOCALS_L; CH_7_1_FC; 0.5
Map: STEMS_VOCALS_R; CH_7_1_FC; 0.5

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:

Map: STEMS_VOCALS_L; CH_7_1_FC; 0.75
Map: STEMS_VOCALS_R; CH_7_1_FC; 0.25

Will make the left part of the original song's vocals louder. Note that

Map: STEMS_VOCALS; CH_7_1_FC; 1

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 (STEMS_VOCALS_L or STEMS_VOCALS_R) to configure mappings.

As of now, you can only use the channel number, meaning you will have to know how each channel is being used.

6. Adding distance

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 Dis instruction and mentioning the two channels to create distance between:

Dis: CH_7_1_BL; CH_7_1_BR

This, of course, remains entirely optional and is not required to produce correct output.

7. Output format and filters

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:

Out: OUTPUT_FLAC; OUTFILT_NONE

If you are unsure which format to use, we recommend you use OUTPUT_WAV as it is the most compatible, even though it does not offer any compression. It is also important to keep the limitations of each output format in mind.

8. Wrapping up

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 the quick start guide.

Last updated