Elvas Tower: VolumeCurve - Variable1Controlled in a Chuff Stream - Elvas Tower

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

VolumeCurve - Variable1Controlled in a Chuff Stream Rate Topic: -----

#1 User is offline   QJ-6811 

  • Conductor
  • Group: Status: Active Member
  • Posts: 385
  • Joined: 27-December 15
  • Gender:Male
  • Simulator:MSTS / Open Rails
  • Country:

Posted 14 January 2021 - 07:31 AM

I am making Chuff Streams for a steam locomotive. The following has now struck me:

You can create a "VolumeCurve - Variable1Controlled" in a Chuff Stream, this works fine in the forward direction.

Example like:


VolumeCurve (
     Variable1Controlled
          CurvePoints ( 5
               19.09 	0
               19.22 	1
               19.35	1
               19.78	1
               20.21	0
     )
     Granularity ( 10 )
)


As you know, with Chuff Streams the "Variable1" becomes negative when the locomotive is reversing.

However, it turns out that the "VolumeCurve - Variable1Controlled" does not support negative values for Variable1?

I'm assuming an error in OR, or is there another way to make this?

#2 User is offline   Csantucci 

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

Posted 14 January 2021 - 09:51 AM

Looking at the code, in OR Variable1 is positive also for negative wheel speeds, so your VolumeCurve should work also when the locomative is reversing. This is the formula used (valid for steam locomotives)
(car as MSTSSteamLocomotive).Variable1 = car.AbsSpeedMpS / car.DriverWheelRadiusM / MathHelper.Pi * 5;


#3 User is offline   QJ-6811 

  • Conductor
  • Group: Status: Active Member
  • Posts: 385
  • Joined: 27-December 15
  • Gender:Male
  • Simulator:MSTS / Open Rails
  • Country:

Posted 14 January 2021 - 10:38 AM

OK, thanks for the quick information.
Until now I only get sound when I remove this part (in backwards direction).
(both with positive or negative values)

Continue to find out ................

#4 User is offline   Csantucci 

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

Posted 14 January 2021 - 10:57 AM

Could you attach the whole stream? Sound played depends also from the triggers used.

#5 User is offline   QJ-6811 

  • Conductor
  • Group: Status: Active Member
  • Posts: 385
  • Joined: 27-December 15
  • Gender:Male
  • Simulator:MSTS / Open Rails
  • Country:

Posted 15 January 2021 - 01:23 AM

 Csantucci, on 14 January 2021 - 10:57 AM, said:

Could you attach the whole stream? Sound played depends also from the triggers used.


As an attachment the complete .SMS (LMS-Jubilee_ENG-extra.sms), but also a simple one for testing (LMS-Jubilee_ChuffTest.sms)

When driving forward, the Chuff Stream, FrequencyCurve / Variable1Controlled (to test a little extra adapted for hearing ......), VolumeCurve / Variable1Controlled and VolumeCurve / Variable2Controlled works well, so "as intended".

When reversing, the Chuff stream and VolumeCurve / Variable2Controlled work well, but not the FrequencyCurve / Variable1Controlled and VolumeCurve / Variable1Controlled.
You notice with FrequencyCurve / Variable1Controlled that it "hangs" on the first value (ie low frequency) and with VolumeCurve / Variable1Controlled with volume = 00.

IOW, the "negative Variable1" don't work, or as in top codec, not recognized or translated to absolute values?


Attached File  Chuffstream-test.zip (192.73K)
Number of downloads: 230

#6 User is offline   Csantucci 

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

Posted 15 January 2021 - 05:05 AM

In fact there was a second place in the code where Variable1 was set:
            // Variable1 is proportional to angular speed, value of 10 means 1 rotation/second.
            var variable1 = WheelSpeedSlipMpS / DriverWheelRadiusM / MathHelper.Pi * 5;
            Variable1 = ThrottlePercent == 0 ? 0 : variable1;

and here the speed may have also negative values. I will now generate a bug report and a patch for the Unstable release. I will apply it also in next OR NewYear MG release.
I am also perplex about the fact that Variable1 is set to 0 when ThrottlePercent is = 0. If no sound is desired when ThrottlePercent is = 0, this should be set in the VolumeCurve of the .sms file, but I won't modify this at the moment.
With the fix I am introducing, the second stream in the ChuffTest.sms file is no more needed.

#7 User is offline   QJ-6811 

  • Conductor
  • Group: Status: Active Member
  • Posts: 385
  • Joined: 27-December 15
  • Gender:Male
  • Simulator:MSTS / Open Rails
  • Country:

Posted 15 January 2021 - 08:21 AM

Quote

I will now generate a bug report and a patch for the Unstable release. I will apply it also in next OR NewYear MG release.


Thank you for that. I assume that with the patch the VolumeCurve responds to negative values of Variable_1 again. right?


Quote

I am also perplex about the fact that Variable1 is set to 0 when ThrottlePercent is = 0


I'm not surprised, this is the difference between "Speed Variable" and "Variable_1" on steam locomotives !!

Chuff sound (for steam locomotives) must be indicated with Variable_1 (and not with 'Speed variable'), because at Throttle = 0 no steam is given to the cylinders.
MSTS and OR therefore automatically ensures that (Chuff) sounds and the Stream is stopped and thus no more Chuff sound is given.
IOW, in a "standard Chuff Stream", such as 90% is applied, a VolumeCurve is not necessary.
Moreover, you would also have to adjust all existing .SMS ..........

Variable_1 is also used for other purposes, such as trigger for a Blower function. You cannot trigger this with Speed or VolumeCurve !!

Never change this ....... !!!!!!!


In this situation, the VolumeCurve is only used to create some sort of "fade-in / fade-out" between various transitions of Streams. IOW, from 0 to 100kmh 24 streams are used consecutively here and the VolumeCurve only ensures a 'smooth' transition between the Streams.

So, if the "Variable_1 negative value" is again taken as an absolute value, then the VolumeCurve will work again when driving backwards


Quote

With the fix I am introducing, the second stream in the ChuffTest.sms file is no more needed

I am very apprehensive about this. I think you're saying you're only going to use "the forward Chuff Streams"?

Maybe 80% usable with 'simple Streams', but you are going to change a current existing and used way and then remove the function between "driving forward and backward". If you have already made something for this, this will no longer work. So after my opinion "Never change this ....... !!!!!!!"

#8 User is offline   Csantucci 

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

Posted 15 January 2021 - 08:46 AM

Maybe I was not clear enough.
Variable1 will be always positive with the patch, even if the speed is negative (locomotive running backwards). So the .sms file will have to consider only the case where Variable1 is positive. To be more precise, the patch replaces
            var variable1 = WheelSpeedSlipMpS / DriverWheelRadiusM / MathHelper.Pi * 5;

with
            var variable1 = Math.Abs(WheelSpeedSlipMpS / DriverWheelRadiusM / MathHelper.Pi * 5);


#9 User is offline   QJ-6811 

  • Conductor
  • Group: Status: Active Member
  • Posts: 385
  • Joined: 27-December 15
  • Gender:Male
  • Simulator:MSTS / Open Rails
  • Country:

Posted 15 January 2021 - 09:20 AM

Okay clear.

If Variable_1 is always 'positive', (so not just for the volume curve?) Then you only need the current "forward Streams".
I don't think a problem in most cases, but as said, still a bit wary of existing .SMS files and the one that has made a distinction for sounds when driving forwards or backwards.
(As long as the operation and function of variable_1 remains unchanged as it works now, then I'm happy ...)

Thanks in advance for the patch adjustment, then see if everything works properly.

#10 User is offline   QJ-6811 

  • Conductor
  • Group: Status: Active Member
  • Posts: 385
  • Joined: 27-December 15
  • Gender:Male
  • Simulator:MSTS / Open Rails
  • Country:

Posted 16 January 2021 - 03:45 AM

As confirmation, several tests done in the latest release (U2021-01-15), all goes well as far as Chuff sounds and Variable1. :sign_thanks:

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

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