HOWTO - change Sound effects & background Music in races

Modding & customizing ThunderWheels.
If you have a HowTo or a tutorial post it here.

User avatar
luis
Developer
Posts: 178
Joined: Fri Aug 24, 2007 1:27 pm

HOWTO - change Sound effects & background Music in races

Postby luis » Fri Sep 28, 2007 6:07 am

Document date: 2007.09.28 - 10am Central European Summer Time (CEST) +0200 UTC
ThunderWheels version: Demo 0.1
Before editing anything make backups! And be carefull with the new values you use!




*** Sound effects - Vehicles ***

Sound effects in vehicles are configured in the same config file used for the physics, so go to the folder:

Code: Select all

(your drive:\program files\)ThunderWheels\media\cars


There you'll find some .cfg files, they are named using the following rule: nameofthecar.cfg so if you want to tune up the WildcatMonster car just open and edit: wildcatmonster.cfg, to do that use any text editor... for example Notepad++ (works very well and it's free!).
.cfg files are used in almost everything in ThunderWheels, they are just INI files with the clasic format:
'key = value' pair and the special character '#' to mark lines as comments.

Well, by now you should have that file opened in front of your face and asking yourself what the heck are those parameters and values....
Don worry, i'll explain them now...

See the section [sound] it should looks like this:

Code: Select all

[sound]
#
# <-- remember, this is a comment
#
engine_sound_file           = engine_set_a_2.wav
engine_max_throttle_pitch   = 2.0
engine_min_throttle_pitch   = 0.25
engine_pitch_multiplier     = 3.0
engine_max_throttle_gain    = 0.75
engine_min_throttle_gain    = 0.5
engine_distance             = 40.0
skid_sound_file             = skid_0.wav
skid_max_gain               = 0.15
skid_multiplier             = 0.1
skid_distance               = 30.0


Ok, i'll go one by one explaining the posible values and the meaning, as usual lets begin with the first one:

Code: Select all

engine_sound_file = engine_set_a_2.wav

Meaning: This is the sound file used to make the engine sound. It will be played in continuous loop.
Possible values: any sound file with .wav or .ogg extension or leave it empty if you dont want any sound effect.
The game will look for the file in this folder:
(your drive:\program files\)ThunderWheels\media\sound\effects

Restrictions: the filename cannot contain spaces.

Code: Select all

engine_max_throttle_pitch   = 2.0
engine_min_throttle_pitch   = 0.25

Meaning: The pitch is a variation in the frecuency of the sound effect, it is expressed as a factor, so having 1.0 means 100% of the original frecuency (no change) 0.5 means 50% of the original frecuency and so on... The min value will be used when the player isn't pressing the throttle key, and the max value when the user press the throttle key (the player is accelerating the vehicle).
Restrictions: values have to be in the range (0.0, k] where k is a positive real number.
Tip: take in count that more difference between min and max values produces more frecuency range so you get better effect.

Code: Select all

engine_pitch_multiplier = 3.0

Meaning: The pitch applied to the effect is calculated with the current speed of the vehicle and the maximum speed allowed for that vehicle. The pich will be always in the range of: [engine_min_throttle_pitch, engine_max_throttle_pitch]
*BUT* this parameter lets you modify how fast the 'engine_max_throttle_pitch' value will be applied as the current pitch.
So, for higher values the engine will sound at full load even if the car has a low speed.
Restrictions: values have to be in the range (0.0, k] where k is a positive real number.

Code: Select all

engine_max_throttle_gain    = 0.75
engine_min_throttle_gain    = 0.5

Meaning: The gain is also a factor but it controls the amplitud or the volume level of the effect.
The min value will be applied when the engine is in 'ralenti' and the max when the players press the throttle key (accelerates the vehicle).
Restrictions: values have to be in the range [0.0, k] where k is a positive real number.

Code: Select all

engine_distance             = 40.0

Meaning: This is the distance in meters used for distance attenuation calculations. For small values the sound effect will be almost unheard if the listener is far away.
But since ThunderWheels uses surround sound the lower the value, the better the spatial effect for the listener.
Restrictions: values have to be in the range (0.0, k] where k is a positive real number.

Code: Select all

skid_sound_file             = skid_0.wav

(skid is the sound effect used when the vehicle is sliding)
Same as: engine_sound_file, leave it empty if you dont want the effect.

Code: Select all

skid_max_gain               = 0.15

Meaning: The maximum gain applied to the sound effect.
Restrictions: values have to be in the range [0.0, k] where k is a positive real number.

Code: Select all

skid_multiplier             = 0.1

Meaning: The gain applied to the sound effect is calculated with the longitudalImpulse & lateralImpulse average in the wheels of the vehicle, this multiplier lets you modify how fast this sound effect gets heard using the skid_max_gain.
Restrictions: values have to be in the range (0.0, k] where k is a positive real number.

Code: Select all

skid_distance               = 30.0

Same as engine_distance.

Almost every sound file has a different volume level, so if you want to tune up the sound levels (the gain) for a vehicle my advice is to tune up the paremeters in this order:
1- engine_max_throttle_gain, engine_min_throttle_gain and leave an empty value for skid_sound_file (to supress the noise comming from that source).
2- if the 1 isn't enough try changing engine_distance.






*** Background music - Race ***

Background music configured in the main configfile, this file is written from the GUI so you *must* edit the file *before* running the game!
go and edit:

Code: Select all

(your drive:\program files\)ThunderWheels\config\thunderwheels.cfg

The things you can edit in this file are:

Code: Select all

sound_collisioncarcar = BATHIT1.WAV
sound_collisioncarcar_distance = 10.0
sound_collisioncarcar_gain = 0.75
sound_tracks = Born_To_Be_Wild_mono.ogg WhoMadeWho.ogg Thunderstruck2.ogg
sound_tracks_distance = 100.0
sound_tracks_gain = 1.0
tracks = la_falda pecos tanti

Having read the sound effects documentation (see above) you have enough information to edit and modify any sound_collisioncarcar_XXXXXX value ;)
If not, go and read this post from the beginning.

Ok, i'll try to explain it briefly.... see this:

Code: Select all

sound_tracks = Born_To_Be_Wild_mono.ogg WhoMadeWho.ogg Thunderstruck2.ogg
tracks = la_falda pecos tanti

The value for 'tracks' is a list of track names, for Demo 0.1 there are only those three tracks to run. Each track name cannot contain spaces (same for soundfiles) and each name must be separated with a space.
They will be loaded in the same order as they are listed.
The value for 'sound_tracks' has the same logic as 'tracks', the restriction here is that the sound files used as background music HAS TO BE IN OGG FORMAT! it cannot be a .WAV.

If you run three tracks you have to put three sound files, if you dont want music for one or all tracks just write None. For example:

Code: Select all

sound_tracks = Born_To_Be_Wild_mono.ogg None Thunderstruck2.ogg
tracks = la_falda pecos tanti

The above configuration will make run the tracks (by tracks i mean circuits):
la_falda with Born_To_Be_Wild_mono.ogg
pecos with no music
tanti with Thunderstruck2.ogg

The last thing to say:

Code: Select all

sound_tracks_gain = 1.0

Will set the gain for *all* the music files loaded in the tracks ;)


Well, if you're still reading this, you deserve a reward! specially for the effort required to understand my english :P .... Feel free to post and ask questions.
.

Doyle

Re: HOWTO - change Sound effects & background Music in races

Postby Doyle » Fri Oct 09, 2009 10:03 am

The post really amazing and very much informative.I will also try to implement it.And yeah buddy i also want reward for reading the complete post.

stray_soul
regular face
Posts: 26
Joined: Sun Mar 25, 2012 11:48 am

Re: HOWTO - change Sound effects & background Music in races

Postby stray_soul » Tue Aug 28, 2012 12:05 pm

sound_tracks parameter reset after starting game
{sound_tracks = blabla.ogg; blablabla.ogg} after starting game {sound_tracks = InRace_mezcla192.ogg}

User avatar
luis
Developer
Posts: 178
Joined: Fri Aug 24, 2007 1:27 pm

Re: HOWTO - change Sound effects & background Music in races

Postby luis » Wed Aug 29, 2012 12:59 pm

I shouldn't...
those files exists in the disk ? I mean, blabla.ogg exists ?

stray_soul
regular face
Posts: 26
Joined: Sun Mar 25, 2012 11:48 am

Re: HOWTO - change Sound effects & background Music in races

Postby stray_soul » Wed Aug 29, 2012 2:51 pm

ThunderWheels\media\sound\music\bla.ogg

User avatar
luis
Developer
Posts: 178
Joined: Fri Aug 24, 2007 1:27 pm

Re: HOWTO - change Sound effects & background Music in races

Postby luis » Wed Sep 05, 2012 7:46 am

straysoul i didn't forget your question, I just didn't have the time to see it
I'll try to answer ASAP. I know the background music could be better ;)

stray_soul
regular face
Posts: 26
Joined: Sun Mar 25, 2012 11:48 am

Re: HOWTO - change Sound effects & background Music in races

Postby stray_soul » Wed Sep 05, 2012 1:24 pm

luis wrote:I just didn't have the time to see it

I understand this, and just waitin

User avatar
luis
Developer
Posts: 178
Joined: Fri Aug 24, 2007 1:27 pm

Re: HOWTO - change Sound effects & background Music in races

Postby luis » Fri Sep 14, 2012 6:32 am

stray_soul wrote:
luis wrote:I just didn't have the time to see it

I understand this, and just waitin

verified, it is a bug... the only way will be to overwrite that file with the one you really want to listen....
Will be fixed in the next version ;)


Return to “HOWTOs - Tutorials - General documentation”

Who is online

Users browsing this forum: No registered users and 1 guest