ORTS sound triggers, variables and the future of OR sound management.
#51
Posted 14 November 2015 - 07:22 AM
As to the various triggers that I suggested, I'm sure that there are more that could be envisioned--I just put my list out as a starting point. I have no doubt the OR team will have lots of ideas for additional triggers and uses.
#52
Posted 14 November 2015 - 07:27 AM
disc, on 14 November 2015 - 05:41 AM, said:
Declare as e.g.:
public SmoothedData ExhaustParticles = new SmoothedData(1);
Update as e.g.:
ExhaustParticles.Update(elapsedClockSeconds, DieselEngines[0].ExhaustParticles);
Read back as ExhaustParticles.SmoothedValue
#53
Posted 14 November 2015 - 08:08 AM
disc, on 14 November 2015 - 05:41 AM, said:
So i tried some filtering, to make the the sound changes smoother. I've tried the already implemented MovingAverage filter, but that is FPS dependent, so it's not an option. The butterworth IIR filter works great, but looks too "heavy" for me, however it didn't change the update process CPU usage noticeably, but still a simpler FPS independent filter would be better. Any suggestions?
i don't think it's too bad. The fade in and fade out can be provided by the .wav sound itself, that would have a central part at constant volume between the two cue points. So in my opinion there is no need for filtering.
#54
Posted 14 November 2015 - 09:48 AM
Csantucci, on 14 November 2015 - 08:08 AM, said:
The volume of the sound depends on curve resistance, so the volume curve silences it as the resistance drops to 0, so the fade out is inaudible.
gpz, on 14 November 2015 - 07:27 AM, said:
This is perfect :)
#55
Posted 15 November 2015 - 05:14 AM
New .sms variable trigger: CurveForce (CurveForceControlled, CurveForce_Inc_Past, CurveForce_Dec_Past). The number is interpreted as Newtons. Available for all wagons/cars IF Curve dependent resistance is enabled at simulation tab.
You can see the curve resistance ingame in shift-f5 "force information".
Example:
Stream( Priority ( 5 ) Triggers( 2 Variable_Trigger ( CurveForce_Inc_Past 105 StartLoopRelease ( 1 File ( "ORflange.wav" -1 ) SelectionMethod ( SequentialSelection ) ) ) Variable_Trigger ( CurveForce_Dec_Past 100 ReleaseLoopRelease() ) ) VolumeCurve( CurveForceControlled CurvePoints ( 2 100 0.0 5000 1.0 ) Granularity ( 10 ) ) )
#56
Posted 15 November 2015 - 08:18 AM
Can this stream also be put in track sound files (the ones defined in ttype.dat)? Usually this would lead to less files needing modifications.
#57
Posted 15 November 2015 - 08:22 AM
#58
Posted 15 November 2015 - 08:40 AM
#59
Posted 15 November 2015 - 08:51 AM
Csantucci, on 15 November 2015 - 08:18 AM, said:
Can this stream also be put in track sound files (the ones defined in ttype.dat)? Usually this would lead to less files needing modifications.
I've added this to make possible to avoid the ttype method. Also the wagons should be the sound source. If it would be added to the track sound files, where would be the source? I don't know if it's easily possible to pass the wagons's curveforce to the track sound sources.
#60
Posted 15 November 2015 - 09:13 AM