racer home

Car sounds

 

Home Vrrrrroooom!


Dolphinity Organiser - free planning, project management and organizing software for all your action lists

Introduction

Car sounds are immensely important to a car. A car that sounds like one enhances the experience greatly.

For more information on car settings, check out the car physics reference guide.

You can specify a number of samples for the car. The files will be searched in the car's directory, and data/audio if the file isn't found locally in the car directory. Typical types of sounds are:

Racer v0.5.1 brought a big audio update, and as a result the audio properties of a car are now stored in a single audio subtree. Each type of audio is not just a single sample, but a set of samples (called an audio set). Depending on the audio set, different inputs determine how these samples are played back. For example, the engine sounds are mixed based on engine RPM, the throttle pedal and engine braking. The skid set is however used according to a skid amount. The precise way this is done is determined in the software.

The rest of this section explains the v0.5.2+ audio system.

Volumes are determined in 4 steps (apart from your system's audio board volume settings): each audio set has a master volume, which is used to downmix different audio sets (for example, if the skid sound is too loud in comparison to the engine, you might reduce the audio.skid.volume parameter).
Inside each set, all samples have a sample volume, defaulting to 1. An example would be audio.accelerate_in.smp0.volume=0.9. This volume is used to downmix samples within a single audioset, in case for example one engine sample is a bit louder in comparison to other engine samples in the same audioset.

Most audio sets are continuous sounds; like the engine, the sample loops on and on. Currently only the damper sound is a one-shot set; this means that the sample is triggered just once (not looping).

For continuous sounds, each sample is mixed based on an input value. For the engine sound this is the engine RPM for example. This is used to fluently go from one sample (for example sampled at 2000rpm) to the next (samples at 5000rpm perhaps), without switching hard from one to the other. This gives a more gradual change in sound. See min/max/natural below (attack/decay is used to ramp the volume up and down).
Lastly (also internal to the software) a dynamic volume is used to determine if an audioset should be on or off. If the engine is off for example, all dynamic volumes for the engine audiosets are set to 0. If the engine is on, this volume goes up to a maximum of 1, depending on for example throttle (that's handled in the software).
This gives you an end volume formula that is: playbackVolume=masterVolume*sampleVolume*mixVolume*dynamicVolume.

Each set can contain a maximum of 10 samples. Here's an overview of car-specific audio sets (example are given further down):

Group Set (audio.<setname>) Sample determined by Notes (NYI=not yet implemented)
Engine accelerate_in RPM Inside car
  decelerate_in RPM Inside car
  accelerate_out* RPM Outside car
  decelerate_out RPM Outside car
  throttle_on random NYI, Turbo woosh...
  throttle_off random Blow off sounds (backfire)
  reverse_in RPM NYI, Driving in R (reverse gears are often more crude, so make more noise)
  reverse_out RPM NYI, Driving in R outside car
Car brake brake control and car velocity Brake squeal. The input is brakes*carVelocity where brakes=0..1 and carVelocity is the car velocity in m/s.
  bottom_out random NYI, Suspension bottoms out
  damper (v0.9.0RC6) damper vertical velocity One-shot sample set. See the section on damper sounds below.
  gearwhine driveline rotational velocity

The driveline rotation sound. It's based on a rotational velocity (rad/s), where you can expect values between 0 (standing still) and around 500 (driving fast).

This audio set is used when the driveline is loaded (accelerating).

  gearwhine_off driveline rotational velocity (v0.8.1+) This gearwhine is selected when the car decelerates. If not gearwhine_off sound is specified, all gearwhine sounds will be defined from the 'gearwhine' audioset above.
  skid slip amount

The old method used a lateral and longitudinal sound: skid.sample=lateral skid, skid.sample2=longitudinal skid. This is not recommended anymore (but it still takes priority in v

v0.8.1 changed this to a full skid audio set, where you can use multiple samples based on a 'skid amount' internal variable. This skid amount varies from around 0 to 1 in normal sliding, values 1..10 for really skidding.

This allows you to add a 'scrubbing' sound for mild skidding, then progressing to screeching and screaming as the slip amount goes up.

Skid samples are not pitch-bended (in contrast to engine samples).

  skid_lat slip amount

Since v0.9.0RC9 the old lateral & longitudinal sounds are supported again through audio sets. The old method (described above) uses single samples, so is less limited.

The input to this audio set is the lateral skid amount, around 0..2, where 1 is skidding, 2 is severe skidding. Use in combination with skid_lon (see below).

  skid_lon slip amount (longitudinally) The companion audio set for skid_lat. See the skid_lat description for details. v0.9.0RC9+.
  understeeroversteer Under- or oversteer amount. See the example. Alpha function which may change (or be removed) in future versions. This is an alternative skid method.
Environment wind car velocity vs wind velocity Wind sounds can add greatly to realistic sounds for most car.
  collide impact velocity NYI - crash samples will be handled globally (not per-car) and are differentiated in car-track and car-car samples.

* accelerate_out is the most important engine sound. The sets concerning the engine that are not defined will fall back to use accelerate_out to avoid silence.

Surface sounds (defined in racer.ini). Note that most sets will only have 1 sample, which might be good enough for most surfaces.

Surface Set Sample determined by Notes
Road audio.road Car velocity Default surface
Gravel audio.gravel Car velocity  

 

The engine sound is divided into 4 separate sets:

Every set will have a number of samples, each sample having a number of properties, indicating when it is to be used. Normally, most samples will be turned off. The maximum number of samples is currently set at 10, so you can have a smooth transition for every situation (accelerating or not, inside or outside of the car). An example audio fragment:

audio
{
acc_all
{
attack=100 decay=100 } accelerate_out { ; Master volume for this set (0..1) volume=0.9 smp0~audio.acc_all { ; Volume for this sample; this sample was a bit loud compared to smp1 volume=0.9 sample=low_revs.wav min=0 max=2000 ; The engine in the sample was running 1000rpm natural=1000 } smp1~audio.acc_all { sample=med_revs.wav min=2000 max=4000 natural=3000 } } wind
{
; Pitch determination; slightly rises with car velocity
pitch_scale=0.2
pitch_offset=50
smp0
{
sample=wind.wav
; Speeds in m/s; in this case just 1 sample from 0..200m/s
min=0
max=200 ; The wind was blowing 50m/s when recorded
natural=50
}
}
}

Each sample (smp<x> trees) explained in more detail:

Input values (that modify either pitch or volume) vary like this:

Every sound set has a number of properties:

Example: skid sounds in v0.8.2+

An example of the skid sound system as defined from v0.8.2 onwards. The explanation follows below.
audio
{
...
  skid
  {
    ; Master volume for this set
    volume=1
    ; Acceleration; outside of the car
    smp0
    {
      volume=1.0
      sample=slipping.wav
      min=0.1
      max=0.6
      attack=0.09
      decay=1.0
    }
    smp1
    {
      volume=1.0
      sample=squealing.wav
      min=0.3
      max=20
      attack=0.2
      decay=0
    }
 }

The skid volume is determined through a normalized 'skid' amount, which goes roughly from 0 (no skid) to 1 (skidding) to 10 or more (severe skidding).

Skid sounds using understeer/oversteer in v0.9.0RC6

This version added a somewhat experimental option to generate sound based on the amount of understeer/oversteer of the car. The amount can be seen in the Ctrl-9 ('debug 9' in console terms) under "Under/oversteer Pure".
Typical values will range from -5 (lots of understeer) to +5 (oversteer). As the numbers become negative for understeer, here's an example to start from for this audioset. Notice the understeer sample using decay=5 and the oversteer attack using 2. The understeer sound will be less harsh, more of a grumble, whereas the oversteer sound should be more of a squealing sound.
audio
{
...
  understeer_oversteer
{
; Based on amount of understeer/oversteer
volume=1.0
smp0
{
volume=1.0
sample=understeer.wav
min=-50
max=-5
attack=0
decay=5
}
smp1
{
volume=1.0
sample=oversteer.wav
min=2
max=50
attack=2
decay=0
}
} }

Damper sounds (v0.9.0RC6+)

The damper audio set is slightly different from most audio sets, since it consists of one-shot samples. This means the samples are just triggered once, instead of looping. The sound triggered is based on the damper velocity (in m/s). No attack or decay is required (or desired); the samples must neatly fit into eachother (meaning smp0.max is the same as smp1.min, and onwards, smp1.max is the same as smp2.min).

Also note that the order is significant; the 'slow' samples (lower min/max values) must be specified first. This to ensure that Racer picks the right sample when faced with a certain damper velocity.
An example extract from car.ini's audio tree is shown below:

audio
{
...
  damper
{
; Based on damper velocity
volume=1.0
; Minimum time between sample triggers (ms)
time_between=200
smp0
{
sample=damper1.wav
min=0.12
max=0.2
}
smp1
{
sample=damper2.wav
min=0.2
max=0.3
}
smp2
{
sample=damper3.wav
min=0.3
max=1.0
}
}
}


Gearwhine sounds in v0.9.0RC6+

There are 2 audio sets for gear whine; on-throttle and off-throttle. The frequency parameter is the driveline rotational velocity (in radians/sec). Here is an example:
audio
{
...
  gearwhine
{
volume=1
pitch_scale=0.5
pitch_offset=100
smp0~audio.acc_all
{
volume=1.0
sample=gearwhine_on.wav
min=1
max=1000
natural=600
}
}
gearwhine_off
{
volume=1
pitch_scale=0.5
pitch_offset=100
smp0~audio.acc_all
{
volume=1.0
sample=gearwhine_off.wav
min=1
max=1000
natural=600
}
} }

Wind sounds in v0.9.0RC6+

The wind is driven by the wind velocity (currenty this is equal to the car velocity). Note that the first sample in the example below uses min=25 and attack=33, which really means that even a negative velocity would make wind audible. The velocity is always absolute though, so always greater than zero.
audio
{
...
  wind
{
volume=5
pitch_scale=0
pitch_offset=50
smp0
{
sample=wind1.wav
min=25
max=26
attack=33
decay=33
natural=80
}
smp1
{
sample=wind2.wav
min=50
max=51
attack=33
decay=33
natural=80
}
smp2
{
sample=wind3.wav
min=75
max=76
attack=33
decay=33
natural=80
}
} }

Brake sounds

The brake sound should be a subtle sound that triggers when you press the brakes. An example is shown below. Notice the natural=44100 value, which is a bit of legacy hardcode.
audio
{
...
  brake
{
volume=1
smp0~audio.acc_all
{
volume=1.0
sample=brake_squeal.wav
min=0
max=100000
natural=44100
}
} }

Throttle off (valve blow off) sounds

This sound is generated now & then when letting go from the throttle pedal. The procedure for triggering this sound is currently quite hardcoded.
audio
{
...
  throttle_off
{
; Master volume for this set
volume=1.0
smp0
{
sample=deltawaste.wav
}
} }

Indicator sound (simple)

Some sounds don't use entire sets, but are just 1 sample. These use a slightly simpler layout in the car.ini file. An example for the indicator sound:
audio
{
...
  indicator
{
volume=1.0
sample=indicator.wav
} }

Shift sounds (simple)

There are 2 shift sounds; the shift initiating (shiftin), and the shift completing (shiftout).
audio
{
...
  shiftin
{
volume=1.0
sample=gear_in.wav
} shiftout
{
volume=1.0
sample=gear_out.wav
}
}

Gearbox shift warning sound (simple)

This sound can be actived at specific RPM's for each gear, to indicate to the driver that he/she should shift towards a higher gear. A simple sample such as a pulse or triangle wave should suffice. The specific gear settings are documented in the gearbox page.
audio
{
...
  warn_rpm
{
sample=warn_rpm.wav
} }

Engine starter sound

Currently this sound is hardcoded to be loaded as 'starter.wav' in the car directory (you cannot modify the filename). The starter sound is automatically triggered when starting the engine (throttled to not replay except for every few seconds).

FMOD Studio sounds

Racer v0.9.0RC11 moved from FMOD Ex to FMOD Studio (v1.05.02). In FMOD's Event Editor, the sound designer is given more options to design a sound, exposing only a few parameters to the Racer engine.

To use an FMOD Studio file in Racer (currently only the engine sound is really supported), follow these steps:

audio
{
...
  accelerate_out
{
bank=audio/my_engine_sound.bank
event=event:/Car/Engine
}
}

The event should define at least the following parameters: rpm and load. The rpm will be a value from 0..10,000 for example, and load will range from 0 (no load) to 1 (full load).

Here is a list of all the relevant parameters for the different types of sound:

Group Parameters
Engine rpm (0..maximum engine rpm), load (0..1)
Gearwhine driveline_vel (in rad/s)
Skid ?

 



Dolphinity Organiser - free planning, project management and organizing software for all your action lists

(last updated February 5, 2015 )