Using the Sound FX in your levels - TheXTech/TheXTech GitHub Wiki

Sound FX - is a feature of TheXTech since version 1.3.6 which allows you to apply real-time sound effects on your level sections.

Currently there are two effects available:

  • SPC Echo - makes the same echo effect as the sound chip of SNES does, giving its full functionality. This effect allows you to make the sound environment closer to SNES games.
  • Reverb - the standard reverberation effect based on the FreeVerb library.

If you want to enable any of the supported environment sound effects, you will need to fill at least two sounds.ini files:

  • The first file should be placed in the episode directory. This file allows you to store episode-wide sound effects set, available to be used by any level at the episode.
  • The second file should be placed in the level data directory (the directory that has the same name as the level file). In this file, you will need to specify the list of sections and assign the desired effect by name from the first file.

Note: The sounds.ini file is also used to replace default sounds with your own. So, if you already have this file to replace default sounds at your episode, you should append the Sound FX settings into this file normally.

Note 2: This feature doesn't support for World Map currently.

sounds.ini settings file

The sounds.ini file is a general sound environment setup file that allows you to specify the list of sound files to override default effects, and also, this file allows you to set up the sound environment.

Demo structure

Structure of the level (or episode) directory

Store effect at the episode (or level)

Before you can use any environment effects, you should create (or open exist) the sounds.ini file in your episode directory. Each sound effect stored in the episode is the section of the [fx-<effect name>] formatting:

[fx-<effect name>]
fx = <effect type>     ; allowed: "echo" or "reverb"
; other settings are specific to each effect type, see full examples below

Once you added this effect entry to your episode, you can use it at any level of your episode.

Note: Where <effect name>, you should put your own unique name of the effect. Suggested to use Latin characters and numbers without spaces, minus "-" and underline "_" characters also can be used.

Example effect names: "bonusroom", "cave", "castle", "my-toilet-room", etc.

Note 2: You also can store these effects at the level-specific sounds.ini file to make these effects available for a single level only.

Assigning effect to the level section

In order to assign an environment effect to the section, you should append the section of the next format into your sounds.ini file at the level data directory:

[section-fx-<0-based Section Number>]
custom-fx = <Name of effect>

Where <0-based Section Number> is the number of the section starting from 0, and where <Name of effect> is the name of the effect entry at the episode-side sounds.ini file.

Example:

; Set the sound effect "bonusroom" at section 3 (0-based, 4 if 1-based)
[section-fx-3]
custom-fx = bonusroom

Creating new sound effects

You may want to create a new sound effect setup rather than using one of the existing examples. You will need to download the Moondust Project and use the Moondust MusPlay utility (pge_musplay) that has a flexible interface which allows you to configure your own sound FX setup and preview it in action by playing any music or sound effects in the player itself. To access these editors, you should click the player's window by the right mouse button and select the "Echo" to enable the echo effect, or "Reverb" to enable the reverb effect, and then, click the window by the right mouse button again:

context menu

and select the "Echo tuner...": or "Reverb tuner..." to show up the dialogue that allows you to configure the desired effect.

Echo tuner dialogue explained

echo tuner

Reverb tuner dialogue explained

reverb tuner

Taking the result into your levels

After you configured the effect, you can copy settings and paste them into sounds.ini after creating the header section for it:

[fx-<effect-name>]
spc-echo-off = true
; ------------------------------- ;
; !!! Paste the settings here !!! ;
; ------------------------------- ;

Note: Where <effect name>, you should put your own unique name of the effect. Suggested to use Latin characters and numbers without spaces, minus "-" and underline "_" characters also can be used.

Example effect names: "bonusroom", "cave", "castle", "my-toilet-room", etc.

Tip: If you would like to repeat the same effect as in your favourite SPC song file, drop it into the Echo tuner dialogue in order to extract its setup and apply it to the current state.

Tip 2: For better testing of the environment, open the "Setup / Multi-SFX testing" menu and run the playing of a bunch of sound files in parallel with playing music.

Example level

Download the working Sound FX example

This is a simple demo level which uses the environment sound FX and you can see it in action.

Example effects

There are example environment effects which you can store in your sounds.ini files to take them for use:

Room

[fx-bonusroom]
fx = echo
spc-echo-off = true
echo-on = 1
delay = 2
feedback = 80
main-volume-left = 127
main-volume-right = 127
echo-volume-left = 93
echo-volume-right = 93
fir-0 = 127
fir-1 = 0
fir-2 = 0
fir-3 = 0
fir-4 = 0
fir-5 = 0
fir-6 = 0
fir-7 = 0

Cave

[fx-cave]
fx = echo
spc-echo-off = true
echo-on = 1
delay = 4
feedback = 108
main-volume-left = 127
main-volume-right = 127
echo-volume-left = 21
echo-volume-right = 21
fir-0 = -1
fir-1 = 8
fir-2 = 23
fir-3 = 36
fir-4 = 36
fir-5 = 23
fir-6 = 8
fir-7 = -1

Dungeon

[fx-dungeon]
fx = echo
spc-echo-off = true
echo-on = 1
delay = 2
feedback = 50
main-volume-left = 127
main-volume-right = 127
echo-volume-left = 79
echo-volume-right = 79
fir-0 = 127
fir-1 = 0
fir-2 = 0
fir-3 = 0
fir-4 = 0
fir-5 = 0
fir-6 = 0
fir-7 = 0

Boss room

[fx-bossroom]
spc-echo-off = true
fx = echo
echo-on = 1
delay = 2
feedback = 50
main-volume-left = 96
main-volume-right = 96
echo-volume-left = 60
echo-volume-right = 60
fir-0 = 127
fir-1 = 0
fir-2 = 0
fir-3 = 0
fir-4 = 0
fir-5 = 0
fir-6 = 0
fir-7 = 0

Basic reverb

[fx-watercave]
fx = reverb
spc-echo-off = true
mode = 0
room-size = 0.7
damping = 0.42
wet-level = 0.16
dry-level = 0.5
width = 1