Elvas Tower: Automatic switch track sound - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
  • 5 Pages +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

Automatic switch track sound Rate Topic: -----

#1 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,986
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 22 January 2017 - 12:57 PM

As discussed elsewhere, getting a specific sound playing when a train passes over a switch is a desirable feature. There are some possibilities in MSTS to get this, but they are either very cumbersome to prepare (adding specific sound regions for every switch) or with some big limit (sound source over switch).
So I am working on a solution that enables OR to automatically pass from the previous track sound to a switch track sound when any car passes over the switch.
To do this within the ttype.dat there must be one position where a switch track sound is defined (there are many around); if one is not there, it must be added (by also increasing by one the first number in the ttype.dat file). One of the legacy ttype.dat files could be modified as follows
SIMISA@@@@@@@@@@JINX0t1t______

11
TrackType ( "Default" 				"EuropeSteamTrack0In.sms" "EuropeSteamTrack0Ex.sms"	)
TrackType ( "Concrete Supported"	"EuropeSteamTrack1In.sms" "EuropeSteamTrack1Ex.sms"	)
TrackType ( "Wood Supported" 		"EuropeSteamTrack2In.sms" "EuropeSteamTrack2Ex.sms"	)
TrackType ( "In Tunnel" 			"EuropeSteamTrack3In.sms" "EuropeSteamTrack3Ex.sms"	)
TrackType ( "Steel Bridge" 			"EuropeSteamTrack4In.sms" "EuropeSteamTrack4Ex.sms"	)
TrackType ( "Girder Bridge" 		"EuropeSteamTrack5In.sms" "EuropeSteamTrack5Ex.sms"	)
TrackType ( "Under Bridge" 			"EuropeSteamTrack6In.sms" "EuropeSteamTrack6Ex.sms"	)
TrackType ( "Concrete Bridge" 		"EuropeSteamTrack7In.sms" "EuropeSteamTrack7Ex.sms"	)
TrackType ( "Crossing Platform" 	"EuropeSteamTrack8In.sms" "EuropeSteamTrack8Ex.sms"	)
TrackType ( "Wooden Bridge" 		"EuropeSteamTrack9In.sms" "EuropeSteamTrack9Ex.sms"	)
TrackType ( "Switch" 		"New track sound/switchtrack7in.sms" "New track sound/switchtrack7ex.sms"	)

where the last track type has been added.
In addition to this OR must know which one of these is the switch sound. This info must be inserted in the route's .trk file (better in an include file to be located as usual in a route's Openrails subfolder.
Such .trk file (that must have the same name as its big parent in the route's main folder) is e.g. as the following one

include ( "../ITALIA13.trk" )
			ORTSDefaultTurntableSMS ( turntable.sms )
			ORTSSwitchSMSNumber ( 10 )

where clearly the relevant line is the last one.
It is obvious that this has sense only if the route doesn't already have specific sound regions defined around every switch.
The .exe and .dll files to be replaced in release x.3760 or in stable release 1.2 are contained here


Blueprint created https://blueprints.l...tch-track-sound .

28/1/2017: attachment removed because new version available

#2 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,986
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 22 January 2017 - 01:55 PM

Here a demo video
https://www.youtube....eature=youtu.be
This route uses an original ttype.dat, so it has a boring sound. However, only adding this new feature the audio effect is quite improved.

#3 User is offline   SP 0-6-0 

  • Foreman Of Engines
  • Group: Status: Contributing Member
  • Posts: 985
  • Joined: 12-November 05
  • Gender:Not Telling
  • Location:Another planet.
  • Simulator:MSTS/ORTS
  • Country:

Posted 22 January 2017 - 02:14 PM

Interesting. I wonder if this could be adapted to the railroad diamond crossing sounds I released at TS.com?

What about the originally discussed points motor sounds when the switches are thrown?

Robert

#4 User is offline   Hamza97 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 606
  • Joined: 01-March 15
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 22 January 2017 - 06:40 PM

Oh,,,Wow.. This is fast.... :sign_thanks: I will definitely try it today....

#5 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,986
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 22 January 2017 - 11:15 PM

The feature is active on both switches and crossovers.
Adding switch motor sound is another story. I haven't yet thought about it.

#6 User is offline   burgerbern 

  • Conductor
  • Group: Status: Contributing Member
  • Posts: 491
  • Joined: 26-May 06
  • Gender:Male
  • Location:UK
  • Simulator:ORTS
  • Country:

Posted 23 January 2017 - 01:33 AM

The SLI Seligman2 route has a sound set for this which could be used, its name is "wheel switch moderate.sms" and it uses 7 different wav files randomly to give the sound of train passing over a switch, have tried it on 4 routes the Feather River, Mactier, Kicking Horse Pass 2 and Rogers Pass and it works well, do not know if it is the sounds i am using but the sound is coming after the wheels have passed over the switches and are a little past them, is there a way of tweaking the onset timing of the sounds?

#7 User is offline   istvanek 

  • Hostler
  • Group: Status: Active Member
  • Posts: 74
  • Joined: 23-March 15
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 23 January 2017 - 03:34 AM

I am delighted with this new feature. Thank you Carlo.

Could you explain how exactly does it work? This knowledge may be useful in appropriately configuring .sms file. Maybe you could also show a sample .sms? It would be helpful.

Thank you once again.

#8 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,986
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 23 January 2017 - 06:16 AM

Hi istvanek,
the code simply tests for every "visible" car whether the distance of a switch which is currently "under" the car's train and the center of the car is less than the length of the car. If yes, and it was no the update before, the switch track sound is started. When the distance becomes greater, and was less the update before, the track sound is selected as usual.
For my test I haven't written a specific track sound .sms file; I have used one I already used in usual applications. So there are no binding requirements. It is advisable that the sound of the flange on the switch starts as soon as the switch track sound starts (so no silent intervals before the hard sound of the flange starts). No other things come into mind to me. It can be suggested that one loop of the switch sound lasts a bit more than the time needed for the longest wagon to run over a distance of twice its lenght (of course considering the speeds at which one wants such sound to play), so that the sound is played only once, with no loop. But these are theoric sophistications. No absolute need to respect such requirements.

#9 User is offline   jonas 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 548
  • Joined: 04-April 14
  • Gender:Male
  • Simulator:MSTS & OR
  • Country:

Posted 24 January 2017 - 12:59 AM

View PostCsantucci, on 22 January 2017 - 01:55 PM, said:


Very nice feature! http://www.elvastower.com/forums/public/style_emoticons/default/thumbup3.gif Good thing for much more realistic.


If someone changes only one line in the ttype.dat the reference will be gone how it works by now (AIUI). Would it be possible to better use


include ( "../ITALIA13.trk" )
			ORTSDefaultTurntableSMS ( turntable.sms )
			ORTSSwitchSMSTrackType ( "Switch" )

or


include ( "../ITALIA13.trk" )
			ORTSDefaultTurntableSMS ( turntable.sms )
			ORTSSwitchSMSName ( "Switch" )

instead of ORTSSwitchSMSNumber (10) to make the reference more stable?

#10 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,986
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 24 January 2017 - 06:42 AM

This new code is embedded in the track sound code. This one uses numbers (the position in the ttype.dat file) to identify track sounds. So, to allow this embedding, also the switch sound must be within the ttype.dat file and therefore be identified by a number.
I don't see big risks in that, because one cannot revolutionize ttype.dat as he likes: if e.g. an intermediate line is deleted, all subsequent sound files are played when a sound region is met that has a lower number than intended for them. So ttype.dat should be quite "stable", and in any case the position of the switch sound within it should remain unaltered (else also all preceding sounds would be played at the wrong place).

  • 5 Pages +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users