leezer3 / OpenBVE

OpenBVE- A free train simulator
http://www.openbve-project.net
275 stars 52 forks source link

[Bug] BVE5 motor tables not working correctly #959

Open hotdamndel opened 10 months ago

hotdamndel commented 10 months ago

Description

Attaching BVE5 motor sound via car's xml file produces erratic sounds or (sometimes) crashes.

Reproduction

Test train: https://cdn.discordapp.com/attachments/1172533635115663360/1172534016461787237/TKK9000.rar

Related information

Stable version 1.9.2.2

leezer3 commented 10 months ago

Fixed the crash.

I think the erratic sound you're referring to is the little blip when it moves off? Trying to get to the bottom of that one.

hotdamndel commented 10 months ago

That and lack of any other motor sound after that blip.

leezer3 commented 10 months ago

OK, give it a try with the build from today. Original code tried to be a little too clever....

Not going to guarantee that this is currently right (specifically, looking at it again, I suspect the interpolation needs tweaking where the sound is set to zero volume in the next step), but now has some sounds.

hotdamndel commented 10 months ago

Seems to be working now, except sound tables with (apparently) sound indexes exceeding 15 are still broken (similarly to before, no sound other than a rapidly rising pitch blip within first few km/h). Will do more testing to see how finer details like interpolation and volume consistency work on those tables that seem fine now.

hotdamndel commented 10 months ago

Lil update, it's still broken for seemingly all trains aside from in the very start (like on the train I've attached), pitch seems to be matching but only for that very first sample.