<?xml version="1.0"?>

<!-- DC-10 Common Sound Controller -->
<!-- Copyright (c) 2026 Josh Davidson (Octal450) -->

<PropertyList>
	
	<!-- Sound View Logic -->
	<logic>
		<input>
			<or>
				<equals>
					<property>/sim/current-view/view-number</property>
					<value>14</value>
				</equals>
				<equals>
					<property>/sim/current-view/view-number</property>
					<value>15</value>
				</equals>
			</or>
		</input>
		<output>/sim/sound/wingview-fwd</output>
	</logic>
	
	<logic>
		<input>
			<or>
				<equals>
					<property>/sim/current-view/view-number</property>
					<value>16</value>
				</equals>
				<equals>
					<property>/sim/current-view/view-number</property>
					<value>17</value>
				</equals>
				<equals>
					<property>/sim/current-view/view-number</property>
					<value>18</value>
				</equals>
				<equals>
					<property>/sim/current-view/view-number</property>
					<value>19</value>
				</equals>
			</or>
		</input>
		<output>/sim/sound/wingview-aft</output>
	</logic>
	
	<logic>
		<input>
			<or>
				<equals>
					<property>/sim/current-view/internal</property>
					<value>1</value>
				</equals>
				<property>/sim/sound/wingview-fwd</property>
			</or>
		</input>
		<output>/sim/sound/internal</output>
	</logic>
	
	<logic>
		<input>
			<or>
				<equals>
					<property>/sim/current-view/internal</property>
					<value>1</value>
				</equals>
				<property>/sim/sound/wingview-fwd</property>
				<property>/sim/sound/wingview-aft</property>
			</or>
		</input>
		<output>/sim/sound/internal-custom</output>
	</logic>
	
	<logic>
		<input>
			<not-equals>
				<property>/sim/sound/internal-custom</property>
				<value>1</value>
			</not-equals>
		</input>
		<output>/sim/sound/external-custom</output>
	</logic>
	
	<filter>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<property>/sim/sound/internal-custom</property>
			</condition>
			<expression>
				<table>
					<property>/velocities/groundspeed-kt</property>
					<entry><ind> 10</ind><dep>0.00</dep></entry>
					<entry><ind>110</ind><dep>0.25</dep></entry>
					<entry><ind>150</ind><dep>0.50</dep></entry>
				</table>
			</expression> 
		</input>
		<input>0</input>
		<output>/sim/sound/roll-v</output>
	</filter>
	
	<filter>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<property>/sim/sound/internal-custom</property>
			</condition>
			<expression>
				<table>
					<property>/velocities/groundspeed-kt</property>
					<entry><ind> 10</ind><dep>0.4</dep></entry>
					<entry><ind>200</ind><dep>0.8</dep></entry>
				</table>
			</expression> 
		</input>
		<input>0</input>
		<output>/sim/sound/roll-p</output>
	</filter>
	
	<filter>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<property>/sim/sound/internal-custom</property>
			</condition>
			<expression>
				<table>
					<property>/velocities/airspeed-kt</property>
					<entry><ind>100</ind><dep>0.0</dep></entry>
					<entry><ind>198</ind><dep>0.1</dep></entry>
					<entry><ind>250</ind><dep>0.5</dep></entry>
				</table>
			</expression> 
		</input>
		<input>0</input>
		<output>/sim/sound/wind</output>
	</filter>
	
	<filter>
		<type>gain</type>
		<gain>1.0</gain>
		<input>
			<condition>
				<property>/sim/sound/internal-custom</property>
			</condition>
			<expression>
				<table>
					<property>/velocities/airspeed-kt</property>
					<entry><ind>150</ind><dep>0.5</dep></entry>
					<entry><ind>250</ind><dep>1.0</dep></entry>
				</table>
			</expression> 
		</input>
		<input>0</input>
		<output>/sim/sound/windp</output>
	</filter>
	
	<filter>
		<type>noise-spike</type>
		<input>
			<expression>
				<min>
					<sum>
						<product>
							<property>/systems/pneumatics/pack-1-flow</property>
							<value>0.04</value>
						</product>
						<product>
							<property>/systems/pneumatics/pack-2-flow</property>
							<value>0.04</value>
						</product>
						<product>
							<property>/systems/pneumatics/pack-3-flow</property>
							<value>0.04</value>
						</product>
					</sum>
					<value>0.85</value>
				</min>
			</expression> 
		</input>
		<output>/sim/sound/packs</output>
		<max-rate-of-change>0.5</max-rate-of-change>
	</filter>

</PropertyList>