View Full Version : The quirky behavior of Variable2
05-16-2002, 12:04 PM
I investigated closer the behavior of Variable2 in effort to create a smoother cut-out of the sound when the throttle is closed, and maybe also using different samples for full throttle and half throttle. I used speech samples to tell me at what value the Variable2 went past. I plotted the results:
The Variable2 is always 100 when Variable1 is 0 (wheels are not moving) and when the throttle is closed. When it is opened, Variable2 starts to increase, at first fast, then slowing to a straight line to 50% throttle. There it suddenly drops to a value depending on the cutoff (reverser) position, and then rises again, but a bit slower than before the 50% throttle. Cutoff also affects the speed at which Variable2 increases in respect to throttle.
So if Variable2 is to be used in creating a smoother cut-out of the sound, the volume should be full at Variable2 value of 10. Otherwise it will cause a drop at the 50% throttle position at lower cutoffs.
I don't know why the Variable2 behaves like that, what in earth did Kuju have in mind... the only thing comes to mind is how the throttle is defined in the eng-file. It is possible to define the curve at which the throttle lever position affects the steam pressure going to the cylinders. It is also possible to define a two-stage throttle valve... that might explain the drop in the half-way. I'll try to play with the settings in the eng-file (RegulatorValveType, etc) next.
05-16-2002, 12:13 PM
I just tested it! It works!! I changed the regulator valve type to single_port, and it gave smooth Variable2 readings from zero to full throttle!
I also believe that the twin_port valve type values can be modified to get the Variable2 working properly. Btw, did U.S. locomotives have single or twin port throttle valves?
05-16-2002, 06:20 PM
I seem to recall discussing this over here many many months ago, before there even was a Sound Forum. I gave a link back then, and so will give another one now. Go to www.uktrainsim.com and search for the Generic 3 Cylinder Sound set and A1 Sounds Upgrade. You'll find the following in use in all the .sms's
CurvePoints ( 12
Interesting that you have established the same from a slightly more scientific appraoch than mine. I use 12 curvepoints because I have found that if I use less then zero at zero doesn't happen!
05-17-2002, 11:21 AM
Yeah... but all the strange behavior of Variable2 can be now traced to the Regulator settings in the eng-file. Which I think is somewhat wrong, if the values drop at 50%... I don't think real locomotive throttles did that. Maybe another Kuju mishap.
You way to set the volume to the max at Variable2 of 10 is great for smoothly silencing the sound when the throttle is closed, but this discovery gives more freedom, it is possible to have different samples for different throttle positions, for example, at throttle position 50% the sound would get more intense, not just in volume but in frequency response. Great for realism.
05-17-2002, 06:02 PM
Not sure I fully understand your proposition. Do you mean that at any one speed (or Variable1) level you would have a set of same beat period .wav files to be selected on the basis of Variable2 level? If so then this will require having both V1 and V2 triggers mixed in the same stream. I have not yet been sucessful in getting more than one type of Variable_Trigger to work in a single stream. Have you?
There is a significant issue in using a V2 volume curve. You can only have one volume curve so it has to be at the expense of the default one which provides the Xfading used by MS/Kuju. This then results in very distinct changes between the .wav files.
05-17-2002, 06:10 PM
In using the volume curve that I have posted above I have managed to eleminate a volume drop at about 50mph but still get a slight one at about 105mph (using the scotsman). Any ideas?
05-18-2002, 03:02 AM
>proposition. Do you mean that
>at any one speed (or
>Variable1) level you would have
>a set of same beat
>period .wav files to be
>selected on the basis of
>Variable2 level? If so then
Yeah, pretty much. And not only selected, but smoothly xfaded by the Variable2.
>this will require having both
>V1 and V2 triggers mixed
>in the same stream. I
Nope... V2 will use volumecurve, V1 will use triggers. And the different sample sets would be played simultaneously in separate streams. Variable2 would then only bring them up and silence them.
>of the default one which
>provides the Xfading used by
>MS/Kuju. This then results in
Forget the xfading there! It doesn't sound realistic. The sounds can be triggered in one stream one behind another, if they are close enough to each other in speed, it doesn't sound that bad. That is the best way to do it.
05-19-2002, 06:31 PM
I follow that! Quite a neat approach, although it will require more streams, but not too many more. How many 'levels' do you anticipate doing?
Also, how are you getting zero volume at zero V2 given that your graph show the value as always one?
05-20-2002, 12:24 PM
>many more. How many 'levels'
>do you anticipate doing?
I don't know, as many as sounds good. Maybe something between 1-5mph. That makes a lot of files, so the preferably will have to be short, maybe containing only 4 chuffs, one rotation of the wheel of two-cylinder locomotives. 8 would give more variation to the sounds, but it doubles the lenght. Shorter samples also react quicker to changes in wheel rotation speed (when slipping the wheels).
>Also, how are you getting zero
>volume at zero V2 given
>that your graph show the
>value as always one?
Oh yeah, there is a correlation between Variable1 and Variable2. When Variable2 goes to 100 Variable1 goes to 0, and vice-versa. So, when the Variable2 goes close to zero, it first smoothly lowers the stream volume, and when reaching 100, it puts Variable1 to zero too, meaning the stream stops playing the sample, because it is defined so. You know, the chuffing sounds are not triggered until the Variable1 rises above, say, 0.1... so at zero nothing is played. But it doesn't work if you use Speed triggers instead of Variable1.
You can also use SetStreamVolume( ) to set the stream volume to 0.0 below Variable1 of 0.1, and 1.0 above it.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.