Skip to content

1.2.4 ‐ Background Music

Z-H-Sun edited this page Jul 8, 2024 · 2 revisions

Features

  • In the original version of TSW, the BGM function is very user-hostile, which is probably why it is disabled by default. For example,

    • The game process will freeze whenever the BGM ends and/or starts, e.g., at certain events that require map refreshing (like going up/downstairs and using Orb of Flight / Warp/Ascent/Descent Wings);
    • The BGM will stop and replay from the beginning whenever you arrive at a new floor. A more reasonable design is to play the BGM continuously until the BGM changes. In addition, there are other scenarios where the timing of playing BGM is weird and inconsistent;
    • BGM change is abrupt, without fading out effect;
    • If the interval between two sound effects (e.g., battle, obtaining an item, etc.) is too short (when you use the High speed game setting), the second sound might not be played.

    Therefore, this modifier app is developed to replace the buggy built-in BGM function, which has solved all the problems above.

  • In the original version of TSW, there is a bug that TSW will disregard your current BGM setting and mistakenly turn on BGM when you load a data that was saved when BGM was on. This bug can be fixed with this modifier app's Enhance BGM playback function.

  • Added one BGM from TSW 3D Ver. for the phantom floor. The original MIDI BGMs were played and recorded using Timidity++ and OmegaGMGS2 sound font, which makes the music sound more catchy than the Windows built-in MIDI timbre.

Usage

  • When tswKai3 detects the start of the TSW game process, it will, by default, take over the playback of the game's background music. No additional operations are required.

    • If you want to change this default behavior, please refer to the Advanced Options section;
    • If you want to disable/re-enable the BGM enhancement function, press F8 to show the "Config (Dynamic)" dialog box, and then click on the Enhance BGM play item.
  • If you want to toggle on/off the background music, simply press F3 (or, click on the "Options -> Background Music On" menu item in the TSW game). This function does not depend on the tswKai3 modifier. As long as you are running any TSW from the all-in-one package, this operation can be done without launching this modifier.

Note

When this modifier starts taking over game background music, the BGM will be automatically turn on; when this enhancement function is disabled, the game's BGM will automatically stop.

However, it is not recommended to rely on this method for toggling on/off the game's BGM; it is best achieved through F3 or the menu item.

Tip

When the game BGM is taken over by this modifier, you can press F3 during the prologue (the 5-second-long animation on startup of the game) to both turn off the BGM and skip the prologue animation.

Troubleshooting

  • When the BGM enhancement function is enabled (including default enabling at startup), if the following error message pops up, "The path for the mp3 BGM files is invalid," please check if the MP3 files shown in the picture above is located in the BGM subdirectory relative to tswKai3.exe. Alternatively, you can manually set the path for the MP3 BGM files according to the Advanced Options section. Finally, re-enable the Enhance BGM play item in the "Config (Dynamic)" dialog box.

  • In case of lag (which is rare):

    • If the game lags every time the background music replays, it might be because you are running on an old, slow PC with poor performance, which requires extra time for reading and decoding MP3 files. In this case, press F3 (or, untick the "Options -> Background Music On" menu item in the TSW game) to turn off the background music.
    • If the game lags every time you open a door, go up/downstairs, and battle (and the sound effects are noticeably cut off), it might be because the built-in speaker sound card of your laptop brand has poor performance (possibly due to energy saving considerations). In this case, simply plugging in external speakers or headphones can solve the problem; or, untick the "Options -> Wav Sound On" menu item of the TSW game to turn off the sound effects.
  • If you encounter any problems, please follow the instructions provided by this modifier app. If the problem persists, please submit an issue here.

Advanced Options

Warning

Please read the General Guidelines for Advanced Options first. In particular, misconfiguration will cause uncontrolled or undefined behaviors of this app.

I have read the warning message above and choose to continue...

Below lists the relevant settings involved in this chapter. For the settings of other submodules, please refer to their own corresponding chapters.

  • Modify the default enabled state of the Enhance BGM playback function:

    Uncomment this line to disable the function by default: $BGMtakeOver = false

  • Modify the path for the MP3 BGM files:

    Note: Please make sure that the path is within 240 bytes.

    • For example, here the path will be changed to %userprofile%\Downloads\BGM: #$BGMpath = File.join(ENV['userprofile'], 'Downloads\BGM')
    • If the variable above is set to be nil, it means the BGM subdirectory will be searched under the current path and the app path: #$BGMpath = nil
    • If the variable above is set to be nil, the following line modifies the subdirectory name (default BGM): BGM_DIRNAME = 'mp3'
  • Modify the BGM fading out effect:

    By default, the BGM fades out in 10 steps (1 step means stop immediately and no fading), each spanning 150 msec.

    If you desire a finer or faster fading out effect, the number of steps and the interval between steps, respectively, can be tuned in the following lines: #BGM_FADE_STEPS = 20; #BGM_FADE_INTERVAL = 25

Clone this wiki locally