<?xml version="1.0" encoding="UTF-8"?>
<!--
 This file is part of FlightGear, the free flight simulator
 http://www.flightgear.org/

 Copyright (C) 2009 Torsten Dreyer, Torsten (at) t3r _dot_ de

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 2 of the
 License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 General Public License for more details.
-->
<PropertyList>
    <fx>

        <HSI-gyro>
            <type>avionics</type>
            <name>HSIGyro</name>
            <mode>looped</mode>
            <path>Sounds/gear.wav</path>
            <position>
                <x>-1.915</x>
                <y>-0.358245</y>
                <z>1.43194</z>
            </position>
            <volume>
              <property>/instrumentation/kcs55/kg102/spin-norm</property>
              <max>0.2</max>
            </volume>
            <pitch>
                <property>/instrumentation/kcs55/kg102/spin-norm</property>
                <factor>1.5</factor>
                <min>0.001</min>
                <max>1.5</max>
                <offset>0.0</offset>
            </pitch>
        </HSI-gyro>
        <TC-gyro>
            <type>avionics</type>
            <name>TCGyro</name>
            <mode>looped</mode>
            <path>Sounds/gear.wav</path>
            <position>
                <x>-1.915</x>
                <y>-0.443245</y>
                <z>1.43194</z>
            </position>
            <volume>
              <property>/instrumentation/turn-indicator/spin</property>
              <max>0.2</max>
            </volume>
            <pitch>
                <property>/instrumentation/turn-indicator/spin</property>
                <factor>1.6</factor>
                <min>0.001</min>
                <max>1.6</max>
                <offset>0.0</offset>
            </pitch>
        </TC-gyro>
        <!-- make some noise if the test-button is pulled on kx165 (squelch open) -->
        <comm1-noise>
            <name>COMM1 noise</name>
            <mode>looped</mode>
            <path>Sounds/wind.wav</path>
            <condition>
                <and>
                    <and>
                        <property>instrumentation/comm[0]/test-btn</property>
                        <property>instrumentation/comm[0]/serviceable</property>
                        <property>instrumentation/nav[0]/power-btn</property>
                    </and>
                    <or>
                        <property>instrumentation/audio-panel/com[0]</property>
                        <property>instrumentation/audio-panel/com-mic[0]</property>
                    </or>
                </and>
            </condition>
            <volume>
                <property>instrumentation/comm[0]/volume</property>
                <type>lin</type>
                <factor>1.0</factor>
            </volume>
        </comm1-noise>

        <comm2-noise>
            <name>COMM2 noise</name>
            <mode>looped</mode>
            <path>Sounds/wind.wav</path>
            <condition>
                <and>
                    <and>
                        <property>instrumentation/comm[1]/test-btn</property>
                        <property>instrumentation/comm[1]/serviceable</property>
                        <property>instrumentation/nav[1]/power-btn</property>
                    </and>
                    <or>
                        <property>instrumentation/audio-panel/com[1]</property>
                        <property>instrumentation/audio-panel/com-mic[1]</property>
                    </or>
                </and>
            </condition>
            <volume>
                <property>instrumentation/comm[1]/volume</property>
                <type>lin</type>
                <factor>1.0</factor>
            </volume>
        </comm2-noise>

        <!-- Engine 1 -->
        <crank>
            <name>engstart1</name>
            <path>Sounds/engstart.wav</path>
            <property>engines/engine[0]/cranking</property>
            <position>
                <x>-2.0</x>
                <y>0.0</y>
                <z>-2.0</z>
            </position>
            <volume>
                <offset>0.4</offset>
            </volume>
        </crank>
        <crank>
            <name>crank1</name>
            <mode>looped</mode>
            <path>Sounds/cranking.wav</path>
            <condition>
                <property>engines/engine[0]/cranking</property>
                <not>
                    <property>engines/engine[0]/running</property>
                </not>
            </condition>
            <position>
                <x>-2.0</x>
                <y>0.0</y>
                <z>-2.0</z>
            </position>
            <volume>
                <offset>0.5</offset>
            </volume>
        </crank>
        <crank>
            <name>cough1</name>
            <path>Sounds/coughing.wav</path>
            <property>engines/engine[0]/running</property>
            <position>
                <x>-2.0</x>
                <y>0.0</y>
                <z>-2.0</z>
            </position>
            <volume>
                <offset>0.3</offset>
            </volume>
        </crank>
        <engine>
            <name>engine1</name>
            <mode>looped</mode>
            <path>Sounds/wasp.wav</path>
            <property>engines/engine[0]/running</property>
            <position>
                <x>-2.0</x>
                <y>0.0</y>
                <z>-2.0</z>
            </position>
            <volume>
                <property>engines/engine[0]/mp-osi</property>
                <factor>0.009</factor>
                <min>0.15</min>
                <max>0.6</max>
                <offset>0.15</offset>
            </volume>
            <pitch>
                <property>engines/engine[0]/rpm</property>
                <factor>0.0004</factor>
                <min>0.1</min>
                <max>2.0</max>
                <offset>0.3</offset>
            </pitch>
        </engine>
        <!-- Engine 2 -->
        <crank>
            <name>engstart2</name>
            <path>Sounds/engstart.wav</path>
            <property>engines/engine[1]/cranking</property>
            <position>
                <x>2.0</x>
                <y>0.0</y>
                <z>-2.0</z>
            </position>
            <volume>
                <offset>0.4</offset>
            </volume>
        </crank>
        <crank>
            <name>crank2</name>
            <mode>looped</mode>
            <path>Sounds/cranking.wav</path>
            <condition>
                <property>engines/engine[1]/cranking</property>
                <not>
                    <property>engines/engine[1]/running</property>
                </not>
            </condition>
            <position>
                <x>2.0</x>
                <y>0.0</y>
                <z>-2.0</z>
            </position>
            <volume>
                <offset>0.5</offset>
            </volume>
        </crank>
        <crank>
            <name>cough2</name>
            <path>Sounds/coughing.wav</path>
            <property>engines/engine[1]/running</property>
            <position>
                <x>2.0</x>
                <y>0.0</y>
                <z>-2.0</z>
            </position>
            <volume>
                <offset>0.0</offset>
            </volume>
        </crank>
        <engine>
            <name>engine2</name>
            <mode>looped</mode>
            <path>Sounds/wasp.wav</path>
            <property>engines/engine[1]/running</property>
            <position>
                <x>2.0</x>
                <y>0.0</y>
                <z>-2.0</z>
            </position>
            <volume>
                <property>engines/engine[1]/mp-osi</property>
                <factor>0.009</factor>
                <min>0.15</min>
                <max>0.6</max>
                <offset>0.15</offset>
            </volume>
            <pitch>
                <property>engines/engine[1]/rpm</property>
                <factor>0.0004</factor>
                <min>0.1</min>
                <max>2.0</max>
                <offset>0.3</offset>
            </pitch>
        </engine>
        <rumble>
            <name>rumble</name>
            <mode>looped</mode>
            <path>Sounds/rumble.wav</path>
            <condition>
                <or>
                    <property>gear/gear[0]/wow</property>
                    <property>gear/gear[1]/wow</property>
                    <property>gear/gear[2]/wow</property>
                </or>
            </condition>
            <volume>
                <property>velocities/groundspeed-kt</property>
                <type>log</type>
                <factor>0.5</factor>
            </volume>
        </rumble>

        <!-- 
        Gear Warning according to POH:
        A micro switch incorporated in the throttle quadrant activates the
        gear warning horn under the following conditions
        (a) gear is not locked down and the manifold pressure has fallen below
            14 inches on either one or both engines
        (b) the gear selector switch is in the UP position and the aircraft is
            on ground
        -->
        <gear-warn>
            <name>gear warning</name>
            <mode>looped</mode>
            <path>Sounds/gear-hrn.wav</path>
            <condition>
             <not>
               <property>controls/electric/circuitbreaker/cb_0_6</property>
             </not>
             <or>
              <and>
                <property>gear/gear[1]/wow</property>
                <not>
                  <property>controls/gear/gear-down</property>
                </not>
              </and>
              <and>
                <or>
                  <less-than>
                    <property>gear/gear[0]/position-norm</property>
                    <value>0.95</value>
                  </less-than>
                  <less-than>
                    <property>gear/gear[1]/position-norm</property>
                    <value>0.95</value>
                  </less-than>
                  <less-than>
                    <property>gear/gear[2]/position-norm</property>
                    <value>0.95</value>
                  </less-than>
                </or>
                <or>
                  <less-than>
                    <property>engines/engine/mp-inhg</property>
                    <value>14</value>
                  </less-than>
                  <less-than>
                    <property>engines/engine[1]/mp-inhg</property>
                    <value>14</value>
                  </less-than>
                </or>
              </and>
             </or>
            </condition>
            <position>
              <x>-2.0</x>
              <y>0.40</y>
              <z>1.40</z>
            </position>
            <reference-dist>2.0</reference-dist>
            <max-dist>5.0</max-dist>
        </gear-warn>

        <gear>
            <name>gear</name>
            <mode>in-transit</mode>
            <path>Sounds/gear.wav</path>
            <property>gear/gear[0]/position-norm</property>
            <volume>
              <max>0.25</max>
            </volume>
        </gear>
        <gear-lock>
            <name>gear-lock</name>
            <path>Sounds/gear-lck.wav</path>
            <condition>
                <equals>
                    <property>gear/gear[0]/position-norm</property>
                    <value>0</value>
                </equals>
            </condition>
            <reference-dist>10.0</reference-dist>
            <max-dist>20.0</max-dist>
        </gear-lock>
        <squeal>
            <name>squeal</name>
            <path>Sounds/squeal.wav</path>
            <condition>
                <or>
                    <property>gear/gear[0]/wow</property>
                    <property>gear/gear[1]/wow</property>
                    <property>gear/gear[2]/wow</property>
                </or>
            </condition>
            <volume>
                <property>velocities/speed-down-fps</property>
                <factor>0.05</factor>
            </volume>
            <volume>
                <property>velocities/groundspeed-kt</property>
                <factor>0.01</factor>
            </volume>
            <volume>
                <internal>dt_stop</internal>
                <factor>0.05</factor>
                <max>1.0</max>
            </volume>
            <pitch>
                <property>velocities/groundspeed-kt</property>
                <factor>0.0025</factor>
                <offset>1.2</offset>
            </pitch>
        </squeal>
        <flap>
            <name>flaps</name>
            <mode>in-transit</mode>
            <path>Sounds/flaps.wav</path>
            <property>surface-positions/flap-pos-norm</property>
            <volume>
                <factor>0.45</factor>
            </volume>
            <reference-dist>10.0</reference-dist>
            <max-dist>20.0</max-dist>
        </flap>
        <wind>
            <name>wind</name>
            <mode>looped</mode>
            <path>Sounds/wind.wav</path>
            <property>velocities/airspeed-kt</property>
            <volume>
                <property>position/altitude-ft</property>
                <factor>-0.000015</factor>
                <offset>1.0</offset>
                <min>0.1</min>
                <max>1.0</max>
            </volume>
            <volume>
                <property>velocities/airspeed-kt</property>
                <factor>0.0015</factor>
                <min>0.03</min>
                <max>0.25</max>
            </volume>
            <pitch>
                <property>velocities/airspeed-kt</property>
                <factor>0.01</factor>
                <offset>1.25</offset>
            </pitch>
        </wind>
        <stall>
            <name>stall</name>
            <path>Sounds/stall.wav</path>
            <condition>
              <not>
                <property>gear/gear[0]/wow</property>
              </not>
            </condition>
            <property>sim/alarms/stall-warning</property>
            <volume>
                <property>velocities/airspeed-kt</property>
                <min>30.0</min>
            </volume>
            <reference-dist>10.0</reference-dist>
            <max-dist>20.0</max-dist>
        </stall>
    </fx>
</PropertyList>
