The sound.cfg file format

■ 목차

■ 1. 개요

The sound.cfg file allows to reference which sound files should be used, how they are called and where they are located relative to the train folder.

The sound.cfg file is a plain text file encoded in any arbitrary encoding, however, UTF-8 with a byte order mark is the preferred choice. The parsing model for numbers is Strict. The file is required to be located inside the train folder and is expected to be named sound.cfg. The file is interpreted on a per-line basis, from top to bottom.

See also the quick reference for the sound.cfg…

■ 2. Syntax

Each line in the file can be empty (or solely consist of white spaces) and will be ignored, can mark the beginning of a new section or contain key-value pairs inside a section. All key-value pairs relate to the last section opened.

A new section is opened by starting the line with an opening bracket (U+005B) and ending it with a closing bracket (U+005D). The text in-between the brackets indicates the name of the section and is case-insensitive. White spaces at the beginning and the end of the line are ignored, as well as at the beginning and the end of the name of the section. Thus, the beginning of the section has the following form:

[NameOfTheSection]

A key-value pair is indicated by giving the key, an equals sign (U+003D) and then the value. The key is case-insensitive. White spaces at the beginning and the end of the line are ignored, as well as in front and after the equals sign. Alternatively, white spaces surrounding the key and the value are ignored. Thus, a key-value pair as the following form:

NameOfTheKey = Value

You can use comments anywhere at the end of a line. A comment is started by a semicolon (U+003B). Comments, if present, are stripped away from all lines before these are processed.

■ 3. Content of the file

The first line in the file is required to be the following:

Version 1.0

Following the version line, these are the sections that can be used and their key-value pairs. In all key-value pairs, the parameter FileName corresponds to the file name of the sound to reference, relative to the train folder.


● [Run]
Index = FileName

Assigns a run sound. The non-negative integer Index represents the type of run sound to use. Route developers can choose which run sound to play for a given piece of track. Please see the page about standards for further information.

The sound is played at a pitch proportional to the speed. The recording should correspond to a speed of 90 km/h.

Position: Center

Radius: 10.0m


● [Flange]
Index = FileName

Assigns a flange sound. The non-negative integer Index represents the type of flange sound to use. Route developers can choose which flange sound to play for a given piece of track. Please see the page about standards for further information.

The sound is played at a pitch proportional to the speed. The recording should correspond to a speed of 45 km/h.

Position: Center

Radius: 10.0m


● [Motor]
Index = FileName

Assigns a motor sound. The non-negative integer Index represents the index of the motor sound that can be referenced in the #MOTOR_Xn sections of the train.dat. Please see the documentation for the train.dat for more information.

Position: Center

Radius: 10.0m


● [Switch]
Index = FileName

Assigns a switch sound- These are played once per axle when the train crosses a block containing pointwork. The non-negative integer Index represents the type of switch sound to use. Route developers can choose which flange sound to play for a given piece of track. Please see the page about standards for further information.

Position: FrontAxle / RearAxle

Radius: 5.0m


● [Brake]
BC Release High = FileName

Played occasionally when the pressure in the brake cylinder is decreased from a high value.

Position: Center

Radius: 5.0m

BC Release = FileName

Played occasionally when the pressure in the brake cylinder is decreased from a non-high value to a non-zero value.

Position: Center

Radius: 5.0m

BC Release Full = FileName

Played occasionally when the pressure in the brake cylinder is decreased to zero value.

Position: Center

Radius: 5.0m

Emergency = FileName

Played once when the emergency brakes are activated.

Position: Center

Radius: 10.0m

EmergencyRelease = FileName

Played once when the emergency brakes are released.

Position: Center

Radius: 10.0m

BP Decomp = FileName

For trains with automatic air brake, is played when the handle is moved into the SRV or EMG position. For other trains, is played when the brake notch is decreased.

Position: Center

Radius: 5.0m


● [Compressor]
Attack = FileName

Played once when the air compressor is activated.

Loop = FileName

Played in a loop for the duration the air compressor is active.

Release = FileName

Played once when the air compressor is deactivated.

Position: Center

Radius: 10.0m


● [Suspension]
Left = FileName

Played occasionally when the train sways to the left side.

Right = FileName

Played occasionally when the train sways to the right side.

Position: Left / Right

Radius: 5.0m


● [Horn]

There are two possible types of horn which may be defined via a [Horn] section- ‘Looped Horns’ and ‘Legacy Horns’

Looped Horns

A looped horn is made up of three components:
A start sound, a loop sound and an end sound.
The start sound is played once, followed by the loop sound for the duration of the keypress. When the horn key is released, the end sound will be played once.

PrimaryStart = FileName
SecondaryStart = FileName
MusicStart = FileName

Played once when the given horn is applied.

PrimaryLoop = FileName
SecondaryLoop = FileName
MusicLoop = FileName

Played in a loop whilst the given horn is active.

PrimaryEnd = FileName
SecondaryEnd = FileName
MusicEnd = FileName

Played once when the given horn is released.​

Legacy Horns

A legacy horn is made up of a single sound.

Primary = FileName

Played once whilst the primary horn is active.

Secondary = FileName

Played once whilst the secondary horn is active.

Music = FileName

Played in a continuous loop whilst the music horn is active.

Position: Front

Radius: 10.0m for Music Horns, 30.0m for all other Horns


● [Door]
Open Left = FileName

Played once when the left doors open.

Open Right = FileName

Played once when the right doors open.

Close Left = FileName

Played once when the left doors close.

Close Right = FileName

Played once when the right doors close.

Position: Left / Right

Radius: 5.0m

Note

The duration of these sound files is used to determine the opening and closing speed of the doors.

If both a Left and a Right sound is present, then both sets of doors will open / close in the average duration of the two sounds.
If a single sound is present, then both sets of doors will open / close in the duration of this sound.


● [Ats]
Index = FileName

Assigns a plugin sound. The non-negative integer Index represents the sound index. Train plugin developers can choose which sound to play. The assignment of sounds needs to be coordinated with the plugin developer.

Position: Panel

Radius: 2.0m


● [Buzzer]
Correct = FileName

Played once when the train stops at a station, but needs to correct its stop position.

Position: Panel

Radius: 2.0m


● [Pilot Lamp]
On = FileName

Played once as soon as the doors have closed and the train is ready for departure.

Off = FileName

Played once as soon as the doors start to open.

Position: Panel

Radius: 2.0m


● [Brake Handle]
Apply = FileName

Played once when the brake notch is increased to any value below the emergency brake position.

ApplyFast = FileName

Played once for each notch when the brake notch is increased in a continuous motion to any value below the emergency brake position.

Release = FileName

Played once when the brake notch is increased in a continuous motion to any value below the emergency brake position.

ReleaseFast = FileName

Played once for each notch when the brake notch is decreased in a continuous motion to any value above brake notch zero.

Min = FileName

Played once when the brake notch is decreased to brake notch zero.

Max = FileName

Played once when the emergency brakes are applied.

Position: Panel

Radius: 2.0m

Note

If the ApplyFast sound is not present, then the Apply sound will be played instead. Similarly, if ReleaseFast is not present, then Release will be played instead.


● [Master Controller]
Up = FileName

Played once when the power notch is increased to any value below the maximum power notch.

UpFast = FileName

Played once for each notch when the power notch is increased in a single continuous motion to any value below the maximum power notch.

Down = FileName

Played once when the power notch is decreased to any value above power notch 0.

DownFast = FileName

Played once for each notch when the power notch is decreased in a single continuous motion to any value above power notch 0.

Min = FileName

Played once when the power notch is decreased to brake notch zero.

Max = FileName

Played once when the power notch is increased to the maximum power notch.

Position: Panel

Radius: 2.0m

Note

If the UpFast sound is not present, then the Up sound will be played instead. Similarly, if DownFast is not present, then Down will be played instead.


● [Reverser]
On = FileName

Played once when the reverser is moved into any non-neutral position.

Off = FileName

Played once when the reverser is moved into the neutral position.

Position: Panel

Radius: 2.0m


● [Breaker]
On = FileName

Played once when power is resumed (was interrupted before). There is a series of circumstances when that can happen, for example when moving from power notch zero to power notch one, assuming the reverser is non-neutral and the brakes are released. It can also happen when the power notch is already non-zero, but the reverser or brakes previously interrupted the power. The safety systems can also interrupt power.

Off = FileName

Played once when power is interrupted or resumed. There is a series of circumstances when that can happen, for example when moving from power notch zero to power notch one, or vice versa, assuming the reverser is non-neutral and the brakes are released. The safety systems can also interrupt power.

Position: Panel

Radius: 5.0m

● [Windscreen]
RainDrop = FileName

Played when a rain drop hits the windscreen.

WetWipe = FileName

Played when the wiper moves with more than 20% of the available drops visible.

DryWipe = FileName

Played when the wiper moves with less than 20% of the available drops visible.

Switch = FileName

Played when the wiper switch is moved.

Position: Panel

Radius: 2.0m


● [Others]
Noise = FileName

Played in a loop all the time for the duration of the simulation.

Position: Center

Radius: 10.0m

Shoe = FileName

Played in a loop when the brake shoe rubs against the wheels. The sound is played at a pitch inversely proportional to the speed, and the volume of the sound decreases with increasing speeds.

Position: Center

Radius: 10.0m

Halt = FileName

Played once or in a loop (depending on the train.dat setting) when the pass alarm system warns about an approaching station stop.

Position: Panel

Radius: 2.0m