First off, here are the new sound samples in a regular zip file: http://mxsimulator.com/junk/sndsrc-2011-07-23.zip
The three new file types are:
.sw
This is just a raw 16 bit mono sound file. (16 bit signed little endian)
.soundtable
This defines the table of patches used to generate the engine sound.
The header has this format:
Code: Select all
SOUNDTABLE rpm_count torque_count
rpm1
rpm2
rpm3
... (repeated up to rpm_count)
torque1
torque2
... (repeated up to torque_count)
rpm1 rpm2 etc and torque1 torque2 etc are the RPM and torque levels where the upcoming patches will be played. The torques aren't actual torques. For the torque values, 0 represents negative torque/engine braking, and 1 represents loaded. The negative torque and loaded torque values can be set in the .braap file with the lowtorque and hightorque settings.
After that, the patches are defined in rpm order. E.g. first torque1 .. torqueN for rpm1, then torque1 .. torqueN for rpm2 etc.
Each patch definition looks like this:
Code: Select all
-1 pulse_count patch_filename
Here's a complete example. This defines 3 RPM levels and 2 torque levels.
"idleoff.sw" would be played at 1000 RPM during negative torque loads.
"idleon.sw" would be played at 1000 RPM during positive torque loads.
"midoff.sw" would be played at 3000 RPM during negative torque loads.
"midon.sw" would be played at 3000 RPM during positive torque loads.
"highoff.sw" would be played at 9000 RPM during negative torque loads.
"highon.sw" would be played at 9000 RPM during positive torque loads.
Code: Select all
SOUNDTABLE 3 2
1000
3000
9000
0.25
0.75
-1 1 @simplesound/idleoff.sw
-1 1 @simplesound/idleon.sw
-1 1 @simplesound/midoff.sw
-1 1 @simplesound/midon.sw
-1 1 @simplesound/highoff.sw
-1 1 @simplesound/highon.sw
This is the same as the old .pipeinfo files except there are some new options -
minrpm which sets the minimum RPM the sound will be played at. E.g. minrpm 1500
lowtorque which sets the negative torque value. E.g. lowtorque -4.0
hightorque which sets the loaded torque value. E.g. hightorque 4.0
soundtable which sets the sound table. E.g. soundtable my125.soundtable
What? Not complicated enough?
In addition to that, you can add a table that remaps the cycle count before a multi cycle patch definition. This can help make sounds be less repetitive without using huge files.
Normally, the game will decide which cycle to play by taking the engine's cycle count modulo the number of cycles in the patch. If the patch has a cycle remapping table, it will use the table to decide the cycle count. Here's an example.
Say you have a patch with two cycles in it, and the second one has a pop from a backfire in it. With a standard patch definition like this:
Code: Select all
-1 2 @popper.sw
Giving you a backfire every other cycle.
If you add an 8 entry remap table like this:
Code: Select all
0 0 0 0 0 0 0 1
-1 2 @popper.sw
If you do this, make sure there's a zero crossing at the cycle you cut at. You'll get ugly pops otherwise.