Page 1 of 1

How can you have two whistles or horns on a train

Unread postPosted: Fri Aug 17, 2012 8:09 pm
by Railfan587
I've heard that some engines have two or more whistles or horns are one locomotive. I want to put three whistle on the GtraX NKP#765: a Pennsy 3 chime, and N&W Y6a Hooter Whistle, and 765's standard Nathan 6 Chime Whistle. How can I do this?

Re: How can you have two whistles or horns on a train

Unread postPosted: Fri Aug 17, 2012 8:43 pm
by Chacal
By mixing the sound files together, with a sound editing program such as Audacity.

Re: How can you have two whistles or horns on a train

Unread postPosted: Sat Aug 18, 2012 12:06 am
by Machinist
Hi railfan, if I got it right, do you wanna listen to each one separated? or mixed, as Chacal got it?

Doc.

Re: How can you have two whistles or horns on a train

Unread postPosted: Sat Aug 18, 2012 8:51 am
by Railfan587
Machinist wrote:Hi railfan, if I got it right, do you wanna listen to each one separated? or mixed, as Chacal got it?

Doc.

I want to listen to then separately.

Re: How can you have two whistles or horns on a train

Unread postPosted: Sat Aug 18, 2012 10:27 am
by Machinist
So... in this case you can add three (or more) horns and also different bells separetely, but the steps are not easy:

1- Create the horns sounds samples (at least three, for each horn model) and the related scripts files. I have a slight idea of ​​how it works, but don't know how to do. A sounds' expert on here could help you.

2- Modify the Input Mapper to assign the other horns to unused controls. This I know how to do, I can provided the formula at the time being, when you have the horns working.

Good luck, *!!wink!!*
Doc.

Re: How can you have two whistles or horns on a train

Unread postPosted: Sat Aug 18, 2012 11:12 am
by Railfan587
Machinist wrote:So... in this case you can add three (or more) horns and also different bells separetely, but the steps are not easy:

1- Create the horns sounds samples (at least three, for each horn model) and the related scripts files. I have a slight idea of ​​how it works, but don't know how to do. A sounds' expert on here could help you.

2- Modify the Input Mapper to assign the other horns to unused controls. This I know how to do, I can provided the formula at the time being, when you have the horns working.

Good luck, *!!wink!!*
Doc.

I have the sounds looped and ready to go. But what's the Input Mapper?

Re: How can you have two whistles or horns on a train

Unread postPosted: Sat Aug 18, 2012 12:43 pm
by Machinist
Simple steps, I cannot go deeper due to lack of time... *!!wink!!* I don't own this engine, so I'm a bit blind to the correct folders, it will be up to you.

1) Find where (In GTrax folder) are placed the Input Mapper (usually a folder with the name InputMapper, or a file in \RailSimulatorCore\InputMappers).
2) Open with RWTools the mapper file, say EngineExpert.bin.
3) Find and delete these sections:
For Blower
Code: Select all
            <iInputMapper-cInputMapEntry d:id="19631840">
               <State d:type="sInt32">0</State>
               <Device d:type="cDeltaString">Keyboard</Device>
               <ButtonState d:type="cDeltaString">ButtonDown</ButtonState>
               <Button d:type="cDeltaString">Key_N</Button>
               <ShiftButton d:type="cDeltaString">NoShift</ShiftButton>
               <Axis d:type="cDeltaString">NoAxis</Axis>
               <Name d:type="cDeltaString">IncreaseControlStart</Name>
               <Parameter d:type="cDeltaString">Blower</Parameter>
               <NewState d:type="sInt32">0</NewState>
            </iInputMapper-cInputMapEntry>
            <iInputMapper-cInputMapEntry d:id="19634384">
               <State d:type="sInt32">0</State>
               <Device d:type="cDeltaString">Keyboard</Device>
               <ButtonState d:type="cDeltaString">ButtonUp</ButtonState>
               <Button d:type="cDeltaString">Key_N</Button>
               <ShiftButton d:type="cDeltaString">NoShift</ShiftButton>
               <Axis d:type="cDeltaString">NoAxis</Axis>
               <Name d:type="cDeltaString">IncreaseControlStop</Name>
               <Parameter d:type="cDeltaString">Blower</Parameter>
               <NewState d:type="sInt32">0</NewState>
            </iInputMapper-cInputMapEntry>
            <iInputMapper-cInputMapEntry d:id="19932832">
               <State d:type="sInt32">0</State>
               <Device d:type="cDeltaString">Keyboard</Device>
               <ButtonState d:type="cDeltaString">ButtonDown</ButtonState>
               <Button d:type="cDeltaString">Key_N</Button>
               <ShiftButton d:type="cDeltaString">Shift</ShiftButton>
               <Axis d:type="cDeltaString">NoAxis</Axis>
               <Name d:type="cDeltaString">DecreaseControlStart</Name>
               <Parameter d:type="cDeltaString">Blower</Parameter>
               <NewState d:type="sInt32">0</NewState>
            </iInputMapper-cInputMapEntry>
            <iInputMapper-cInputMapEntry d:id="20021880">
               <State d:type="sInt32">0</State>
               <Device d:type="cDeltaString">Keyboard</Device>
               <ButtonState d:type="cDeltaString">ButtonUp</ButtonState>
               <Button d:type="cDeltaString">Key_N</Button>
               <ShiftButton d:type="cDeltaString">Shift</ShiftButton>
               <Axis d:type="cDeltaString">NoAxis</Axis>
               <Name d:type="cDeltaString">DecreaseControlStop</Name>
               <Parameter d:type="cDeltaString">Blower</Parameter>
               <NewState d:type="sInt32">0</NewState>
            </iInputMapper-cInputMapEntry>

and for Damper
Code: Select all
            <iInputMapper-cInputMapEntry d:id="20345520">
               <State d:type="sInt32">0</State>
               <Device d:type="cDeltaString">Keyboard</Device>
               <ButtonState d:type="cDeltaString">ButtonDown</ButtonState>
               <Button d:type="cDeltaString">Key_M</Button>
               <ShiftButton d:type="cDeltaString">NoShift</ShiftButton>
               <Axis d:type="cDeltaString">NoAxis</Axis>
               <Name d:type="cDeltaString">IncreaseControlStart</Name>
               <Parameter d:type="cDeltaString">Damper</Parameter>
               <NewState d:type="sInt32">0</NewState>
            </iInputMapper-cInputMapEntry>
            <iInputMapper-cInputMapEntry d:id="20099344">
               <State d:type="sInt32">0</State>
               <Device d:type="cDeltaString">Keyboard</Device>
               <ButtonState d:type="cDeltaString">ButtonUp</ButtonState>
               <Button d:type="cDeltaString">Key_M</Button>
               <ShiftButton d:type="cDeltaString">NoShift</ShiftButton>
               <Axis d:type="cDeltaString">NoAxis</Axis>
               <Name d:type="cDeltaString">IncreaseControlStop</Name>
               <Parameter d:type="cDeltaString">Damper</Parameter>
               <NewState d:type="sInt32">0</NewState>
            </iInputMapper-cInputMapEntry>
            <iInputMapper-cInputMapEntry d:id="20101888">
               <State d:type="sInt32">0</State>
               <Device d:type="cDeltaString">Keyboard</Device>
               <ButtonState d:type="cDeltaString">ButtonDown</ButtonState>
               <Button d:type="cDeltaString">Key_M</Button>
               <ShiftButton d:type="cDeltaString">Shift</ShiftButton>
               <Axis d:type="cDeltaString">NoAxis</Axis>
               <Name d:type="cDeltaString">DecreaseControlStart</Name>
               <Parameter d:type="cDeltaString">Damper</Parameter>
               <NewState d:type="sInt32">0</NewState>
            </iInputMapper-cInputMapEntry>
            <iInputMapper-cInputMapEntry d:id="20121176">
               <State d:type="sInt32">0</State>
               <Device d:type="cDeltaString">Keyboard</Device>
               <ButtonState d:type="cDeltaString">ButtonUp</ButtonState>
               <Button d:type="cDeltaString">Key_M</Button>
               <ShiftButton d:type="cDeltaString">NoShift</ShiftButton>
               <Axis d:type="cDeltaString">NoAxis</Axis>
               <Name d:type="cDeltaString">DecreaseControlStop</Name>
               <Parameter d:type="cDeltaString">Damper</Parameter>
               <NewState d:type="sInt32">0</NewState>
            </iInputMapper-cInputMapEntry>

3.a) Add (exactly as is) the following code anywhere in the mapper:
Code: Select all
            <iInputMapper-cInputMapEntry d:id="19111108">
               <State d:type="sInt32">0</State>
               <Device d:type="cDeltaString">Keyboard</Device>
               <ButtonState d:type="cDeltaString">ButtonDown</ButtonState>
               <Button d:type="cDeltaString">Key_N</Button>
               <ShiftButton d:type="cDeltaString">NoShift</ShiftButton>
               <Axis d:type="cDeltaString">NoAxis</Axis>
               <Name d:type="cDeltaString">IncreaseControlStart</Name>
               <Parameter d:type="cDeltaString">Horn2</Parameter>
               <NewState d:type="sInt32">0</NewState>
            </iInputMapper-cInputMapEntry>
            <iInputMapper-cInputMapEntry d:id="20222260">
               <State d:type="sInt32">0</State>
               <Device d:type="cDeltaString">Keyboard</Device>
               <ButtonState d:type="cDeltaString">ButtonUp</ButtonState>
               <Button d:type="cDeltaString">Key_N</Button>
               <ShiftButton d:type="cDeltaString">NoShift</ShiftButton>
               <Axis d:type="cDeltaString">NoAxis</Axis>
               <Name d:type="cDeltaString">DecreaseControlStart</Name>
               <Parameter d:type="cDeltaString">Horn2</Parameter>
               <NewState d:type="sInt32">0</NewState>
            </iInputMapper-cInputMapEntry>
            <iInputMapper-cInputMapEntry d:id="19333308">
               <State d:type="sInt32">0</State>
               <Device d:type="cDeltaString">Keyboard</Device>
               <ButtonState d:type="cDeltaString">ButtonDown</ButtonState>
               <Button d:type="cDeltaString">Key_M</Button>
               <ShiftButton d:type="cDeltaString">NoShift</ShiftButton>
               <Axis d:type="cDeltaString">NoAxis</Axis>
               <Name d:type="cDeltaString">IncreaseControlStart</Name>
               <Parameter d:type="cDeltaString">Horn3</Parameter>
               <NewState d:type="sInt32">0</NewState>
            </iInputMapper-cInputMapEntry>
            <iInputMapper-cInputMapEntry d:id="20444460">
               <State d:type="sInt32">0</State>
               <Device d:type="cDeltaString">Keyboard</Device>
               <ButtonState d:type="cDeltaString">ButtonUp</ButtonState>
               <Button d:type="cDeltaString">Key_M</Button>
               <ShiftButton d:type="cDeltaString">NoShift</ShiftButton>
               <Axis d:type="cDeltaString">NoAxis</Axis>
               <Name d:type="cDeltaString">DecreaseControlStart</Name>
               <Parameter d:type="cDeltaString">Horn3</Parameter>
               <NewState d:type="sInt32">0</NewState>
            </iInputMapper-cInputMapEntry>

4) In the engine.bin file find a section like this:
Code: Select all
                  <cControlContainerBlueprint-cControlValue d:id="53562752">
                     <ControlName d:type="cDeltaString">Horn</ControlName>
                     <DefaultValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</DefaultValue>
                     <MinimumValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</MinimumValue>
                     <MaximumValue d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</MaximumValue>
                     <BriefDescription d:type="cDeltaString">Horn</BriefDescription>
                     <DetailedDescription d:type="cDeltaString">Horn</DetailedDescription>
                     <ApplyToConsist d:type="cDeltaString">eFalse</ApplyToConsist>
                     <InterfaceElements>
                        <cControlContainerBlueprint-cInteriorNotchedLever d:id="53560448">
                           <ElementName d:type="cDeltaString">Horn</ElementName>
                           <DifficultyType d:type="cDeltaString">StopGo</DifficultyType>
                           <PickTransformName d:type="cDeltaString">horn</PickTransformName>
                           <MovementType d:type="cDeltaString">MoveDownUp</MovementType>
                           <AnalogInputSensitivity d:type="sFloat32" d:alt_encoding="0000000000000040" d:precision="string">2</AnalogInputSensitivity>
                           <DigitalInputSensitivity d:type="sFloat32" d:alt_encoding="0000000000000040" d:precision="string">2</DigitalInputSensitivity>
                           <AnimationName d:type="cDeltaString">Kuju\RailSimulatorUS\RailVehicles\Diesel\SD40-2\Default\CabView\horn</AnimationName>
                           <RestInNotchedPosition d:type="cDeltaString">eTrue</RestInNotchedPosition>
                           <NumberOfNotches d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</NumberOfNotches>
                        </cControlContainerBlueprint-cInteriorNotchedLever>
                     </InterfaceElements>
                  </cControlContainerBlueprint-cControlValue>

5) Copy and paste twice the section.
6) In both copies remove the path/file reference for the animation, change to this:
Code: Select all
<AnimationName d:type="cDeltaString"></AnimationName>

7) In first copy, change (all instances of) "Horn" and "horn" by "Horn2" and "horn2" respectively; in second copy, change "Horn" and "horn" by "Horn3" and "horn3".
8) Now find, and then copy and paste twice the Horn child section, like :
Code: Select all
                  <cEntityContainerBlueprint-sChild d:id="73239648">
                     <ChildName d:type="cDeltaString">Horn</ChildName>
                     <BlueprintID>
                        <iBlueprintLibrary-cAbsoluteBlueprintID>
                           <BlueprintSetID>
                              <iBlueprintLibrary-cBlueprintSetID>
                                 <Provider d:type="cDeltaString">Kuju</Provider>
                                 <Product d:type="cDeltaString">RailSimulatorUS</Product>
                              </iBlueprintLibrary-cBlueprintSetID>
                           </BlueprintSetID>
                           <BlueprintID d:type="cDeltaString">Audio\RailVehicles\Diesel\SD40\Cab\Class SD40 Horn Sound.xml</BlueprintID>
                        </iBlueprintLibrary-cAbsoluteBlueprintID>
                     </BlueprintID>
                     <Matrix>
                        <cHcRMatrix4x4>
                           <Element>
                              <e d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</e>
                              <e d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</e>
                              <e d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</e>
                              <e d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</e>
                              <e d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</e>
                              <e d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</e>
                              <e d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</e>
                              <e d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</e>
                              <e d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</e>
                              <e d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</e>
                              <e d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</e>
                              <e d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</e>
                              <e d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</e>
                              <e d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</e>
                              <e d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</e>
                              <e d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</e>
                           </Element>
                        </cHcRMatrix4x4>
                     </Matrix>
                     <ParentNodeName d:type="cDeltaString"></ParentNodeName>
                  </cEntityContainerBlueprint-sChild>

9) In first copy, change ChildName "Horn" by "Horn2", and modify the path/file names in BlueprintID to match to your secondhorn.bin blueprint; do the same in second copy for "Horn3".

Must be enough, sorry but I don't have time to go in more details along next two weeks (I thought you still would start to create the sounds), especially not having the engine.

Hit "N" for Horn 2, and "M" for Horn 3.

I'm presuming you are very skill handling script files with RW Tools!
By your own risk, as is!!!

I just hope this work for you, worked for me adding cab lights and step lights for some engines I enhanced for my own use.

Good luck,
Doc.

Re: How can you have two whistles or horns on a train

Unread postPosted: Sat Aug 18, 2012 12:57 pm
by Railfan587
*!!thnx!!*

Re: How can you have two whistles or horns on a train

Unread postPosted: Sat Aug 18, 2012 1:22 pm
by Machinist
Ops... *!embar*! The way I had did, the horn buttoms wouldn't work just pressing/releasing N or M, so I've just modified #3 above and added #3.a. Also added #8 and #9 (missing those).

Wait to thank when it works... !*roll-laugh*!

Please, delete in your last post (above) the whole "quote", once it is showing the earlier instructions which were already updated. !!**sorry**!!

Good luck, again.
Doc.