Hey guys!
So with the release of TPF, I felt it necessary instead of posting in the TF threads, that I bring it to the TPF threads.
Anyway, as to seeing some TF mods add in a braking or wheel squealing sound and bell sound at certain speed.. like the GO Transit mod. From 0-32 MPH/ 32-0 MPH the train played the bell file. At about 0-15/ 15-0 MPH the train played the squealing sounds.
Does any modder have any ideas regarding adding these sounds in TPF?
I've figured out how to add in my own whistle/horn sounds, and also the fact that they have to be mono files, for that matter im guessing all files have to be mono.
So what I'm currently working on is adding a custom 4-4-0 bell sound to play when the train reaches certain speeds as to simulate entering stations, or leaving stations.
I also wanted to add in the squeal when the train takes off from a dead stop. The trains already play a squealing sound when braking, can this be changed to reflect both sides of speed acceleration and not just deceleration? Looking into the files so far it seems that some of the sound functions use the soundeffectsutil.lua. For Chuffs, clacks, and brakes. Would I have to add in something to this LUA? Thing is I want to give the majority of locomotives their own sounds.. the 4-4-0 or a steam loco bell is different from a modern day diesel bell. I wouldn't want the same bell playing for all locos.
Also want to start looking into changing the curvature of the tracks that trigger wheel squeal as the train goes into a curve.
Any ideas? I'm a complete noob to this. If I can figure this out here I can work on all other locos!
I currently have the file set this way
local soundeffectsutil = require "soundeffectsutil"
function data()
return {
tracks = {
{ name = "vehicle/Train_4-4-0/idle.wav", refDist = 25.0 },
{ name = "vehicle/Train_4-4-0/fast.wav", refDist = 25.0 },
{ name = "vehicle/Train_4-4-0/wheels_ringing2.wav", refDist = 25.0 },
{ name = "vehicle/Train_4-4-0/_brakes.wav", refDist = 25.0 },
},
events = {
horn = { names = { "vehicle/Train_4-4-0/4-4-0_Whistle.wav" }, refDist = 50.0 },
chuffs = {
names = {
"vehicle/Train_4-4-0/chuff_1.wav",
"vehicle/Train_4-4-0/chuff_2.wav",
"vehicle/Train_4-4-0/chuff_3.wav",
"vehicle/Train_4-4-0/chuff_4.wav",
"vehicle/Train_4-4-0/chuff_5.wav",
"vehicle/Train_4-4-0/chuff_6.wav",
"vehicle/Train_4-4-0/chuff_7.wav",
"vehicle/Train_4-4-0/chuff_8.wav",
"vehicle/Train_4-4-0/chuff_9.wav",
"vehicle/Train_4-4-0/chuff_10.wav"
},
refDist = 25.0
}
}, {
clip = "vehicle/Train_4-4-0/4-4-0_bell.wav",
gainCurve = {
nodes = {
{ 0.0, 0.0 },
{ 0.01, 1.0 },
{ 0.2, 0.8 },
{ 0.21, 0.0 },
{ 1.0, 0.0 },
}
},
pitchCurve = {
nodes = {
{ 0.0, 0.0 },
{ 0.01, 1.0 },
{ 1.0, 1.0 },
},
refDist = 25.0,
}
},
updateFn = function (input)
local chuffsFastFreq = 12.0
local refWeight = 45.0
local chuffs = soundeffectsutil.chuffs(input.speed, input.chuffStep, chuffsFastFreq, input.weight, refWeight)
return {
tracks = {
chuffs.idleTrack,
chuffs.fastTrack,
soundeffectsutil.squeal(input.speed, input.sideForce, input.maxSideForce),
soundeffectsutil.brake(input.speed, input.brakeDecel, 0.8)
},
events = {
horn = { gain = 1.0, pitch = 1.0 },
chuffs = chuffs.event
}
}
end
}
end