BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

train.dat sound pitches

Go down

train.dat sound pitches Empty train.dat sound pitches

Post by SylvesterChevrolet Tue Mar 30, 2021 8:10 pm

Hello!
I'm experiencing issues with motor pitches when I make different trains.

https://i.servimg.com/u/f37/20/29/34/51/20210310.png

This is an example of the class 465 I'm currently helping a friend with. As you can see it is more or less straight and shouldn't have any judders in sound. But the audio you hear is not wwhat's displayed in that photo, here is a video. (one of the developer's filmed this): https://www.youtube.com/watch?v=xXQmBnTOXpI&feature=youtu.be

As you can hear, it isnt a consistent pitch and does it in intervals of what seems like 0.2. Makes a lot of mine and other's trains sound like alternative taurus locomotive .dats, which I personally find it annoying as it hinders the quality of my work and often due to this sound issue, I scrap a lot of trains because of it. As a new guy to the developing for bve scene, having switched from doing personal TS2019 train mods, this is an odd thing to happen.

Hope it gets fixed soon!
Sylvester.
SylvesterChevrolet
SylvesterChevrolet

Posts : 14
Join date : 2020-08-15
Location : GreenDale

Back to top Go down

train.dat sound pitches Empty Re: train.dat sound pitches

Post by leezer3 Tue Mar 30, 2021 8:44 pm

That's by design (at least at the minute), as a legacy hangover from BVE2 / BVE4
https://openbve-project.net/documentation_hugo/en/trains/train_dat.html#motor

Motor sounds are updated in 0.2km/h steps.
Making any sort of change here in the existing train.dat format would be breaking backwards incompatible, which is something that I've tried very hard to avoid.

The solution will (eventually) be in the new train.xml format. We're working towards this (slowly), but for the minute I'm afraid this is what it is Sad

leezer3

Posts : 1785
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

train.dat sound pitches Empty Re: train.dat sound pitches

Post by SylvesterChevrolet Tue Mar 30, 2021 9:19 pm

Will train editor.exe work with train.xmls in that case? I personally think the "backwards compatibility" excuse is poor, you could keep the current format but update the 0.2km/h so its smoother but doesnt ruin old trains. The spinoff payware android game "Hmmsim 2" demonstrates this. So it is possible, and if train.xmls require heavy maths like animating code, then this updated .dat would be more suited I feel
SylvesterChevrolet
SylvesterChevrolet

Posts : 14
Join date : 2020-08-15
Location : GreenDale

Back to top Go down

train.dat sound pitches Empty Re: train.dat sound pitches

Post by leezer3 Tue Mar 30, 2021 9:51 pm

When complete, train.xml will be available in both editors, or via editing manually if you prefer.

Unfortunately, we have literally hundreds (probably thousands) of trains currently available which were all built using the assumption that the 0.2km/h stepping was the correct behaviour.
I don't know how many changing this to a smooth transition (or anything else) would break, and it's not good code or manners to find out.

leezer3

Posts : 1785
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

train.dat sound pitches Empty Re: train.dat sound pitches

Post by Delsin Tue Mar 30, 2021 11:47 pm

I'm not sure, but probably the original BVE4 and below behavior was using the 0.2km/h steps to plot pitch and volume curves rather than using tiny steps, it's like what BVE5 does now, but setting these values every 0.2km/h was mandatory due to how train.dat stores data or some other reason. Hmmsim and BVE4 do sound differently in some cases from Openbve, but I've never paid attention to the "stepping" thing and attributed most discrepancies to the fact that the sounds are now played from the actual cars rather than just in the background.

Speaking of which, I did pinpoint at least one motor sound difference between BVE and Openbve, which is volume seemingly not fading completely into silence unlike BVE4 (mentioned that in my long sound issues post), and that might be related to the "stepping" issue too
Delsin
Delsin

Posts : 284
Join date : 2016-08-20

Back to top Go down

train.dat sound pitches Empty Re: train.dat sound pitches

Post by Tony515 Tue Apr 13, 2021 11:18 pm

leezer3 wrote:When complete, train.xml will be available in both editors, or via editing manually if you prefer.

Unfortunately, we have literally hundreds (probably thousands) of trains currently available which were all built using the assumption that the 0.2km/h stepping was the correct behaviour.
I don't know how many changing this to a smooth transition (or anything else) would break, and it's not good code or manners to find out.
To implement these "smoothing" changes to train.dat/train.xml without potentially breaking backward-compatibility, maybe it's possible to add a SoundInterpolationMode variable which could be ignored or set to 0 in train.dat/train.xml to do the current 0.2km/h increments with no interpolation, or could be set to 1 to create smooth interpolation between all segments of the same sound.

Interpolation (smoothing out the pitch by constantly updating pitch values between 0.2km/h points by making linear equations connecting the points) in sound could definitely be possible without any significant performance drawbacks (see how smooth the playback of .animated sound with equations for PitchFunction is and you can see it's possible).

Bottom line... my suggestion is to keep the old system, but add a second option with interpolation (solving legacy compatibility issues).
Tony515
Tony515

Posts : 13
Join date : 2020-04-24
Location : New York City, USA

https://www.youtube.com/channel/UCfV997Q6rT3AKS1Xom936Ew

Back to top Go down

train.dat sound pitches Empty Re: train.dat sound pitches

Post by Delsin Tue Apr 13, 2021 11:25 pm

There should be no compatibility issues, as I said, sounds were interpolated smoothly in BVE2/4, so no need for that option. There should be no smoothing where sound index changes though to avoid issues (these points are not meant to be the same continuous sound)

Also, many weird and non-standard cases can be implemented with .animated sound for train objects realistically and painlessly, this is exactly what train devs need beside standard sound features Cool
Delsin
Delsin

Posts : 284
Join date : 2016-08-20

Back to top Go down

train.dat sound pitches Empty Re: train.dat sound pitches

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum