<?xml version="1.0" encoding="UTF-8"?>
<!--
	Relax-NG validation schema for the Advanced/Audio Mobile Markup Language [AMML] 
	- Version 2.5
	- Last modification: 17/04/2009
	- Author: Lasorsa Yohan, INRIA Research Center, Team WAM
-->
<grammar ns="amml" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">

	<start>
		<element name="amml">
			<!--
				The audio cues define the play logic and behavior for the sound sources and may be routed into sub sections.
			-->
			<optional>
				<element name="cues">
					<zeroOrMore>
						<ref name="cue"/>
					</zeroOrMore>
				</element>		
			</optional>			
			<!--
				The sub sections allow to define separate audio groups for either mixing, applying sound effects or positionate
				sounds into a 3D environment.
			-->
			<optional>
				<element name="subSections">
					<zeroOrMore>
						<choice>
							<element name="mixGroup">
								<attribute name="id">
									<data type="ID"/>
								</attribute>
								<ref name="cueReferences"/>
								<ref name="mixAttributes"/>
								<ref name="mixControls"/>
							</element>
							<element name="soundSource3DGroup">
								<attribute name="id">
									<data type="ID"/>
								</attribute>
								<ref name="cueReferences"/>
								<ref name="soundSource3DControls"/>
							</element>				
						</choice>
					</zeroOrMore>
				</element>		
			</optional>
			<!-- 
				The master section contains all the global parameters that are applied at the final stage of the mix.
				It also allows to define the spectactor settings that will be used in coordination with the 3D sound sources.
			-->
			<optional>
				<element name="masterSection">
					<ref name="mixAttributes"/>
					<interleave>
						<ref name="masterMixControls"/>
						<optional>
							<element name="spectator">
								<ref name="spectatorControls"/>
							</element>
						</optional>
					</interleave>
				</element>
			</optional>			
		</element>
	</start>

<!--*******************************************************************************************************************************-->	

	<!-- Reference to a previously defined cue by its ID -->
	<define name="cueReferences">
		<attribute name="cues">
			<data type="IDREFS"/>
		</attribute>
	</define>
	
	<!-- 
		A cue is a managed sound source that can be controlled by time or special events. 
		It is a container for one or more audio chunks.
	-->
	<define name="cue">
		<element name="cue">
			<attribute name="id">
				<data type="ID"/>
			</attribute>
			<!-- Space-separated list of events or time (in seconds) triggering the start of the cue. -->
			<optional>
				<attribute name="begin">
					<ref name="eventOrTimeList"/>
				</attribute>
			</optional>
			<!-- 
				Duration of the cue in seconds. 
				If not specified, the cue will be played until the loopCount value is reached. 
			-->
			<optional>
				<attribute name="dur">
					<data type="float"/>
				</attribute>
			</optional>
			<!-- Space-separated list of events or time (in seconds) triggering the stop of the cue. -->
			<optional>
				<attribute name="end">
					<ref name="eventOrTimeList"/>
				</attribute>
			</optional>
			<!-- 			
				Number of times the cue should be played. If set to -1, the cue will repeat	undefinitely. 
				Value 0 is invalid. Default value is 1.
			-->
			<optional>
				<attribute name="loopCount">
					<data type="int"/>
				</attribute>
			</optional>
			<!--
				Allows prioritizing the playback of a cue by setting a priority level between 0 and 100. 100 being the highest
				priority, 50 the default level and zero the lowest priority.
			-->
			<optional>			
				<attribute name="priority">
					<data type="int"/>
				</attribute>			
			</optional>
			<oneOrMore>
				<ref name="chunk"/>
			</oneOrMore>
		</element>
	</define>
	
	<!-- A chunk is an audio fragment embedding one or more audio tracks that can be played in order or randomly. -->
	<define name="chunk">
		<element name="chunk">
			<!-- 
				Duration of the chunk in seconds. 
				If not specified, the current track will be played until the end of the media. 
			-->
			<optional>
				<attribute name="dur">
					<data type="float"/>
				</attribute>
			</optional>			
			<!-- Determines how the tracks are picked. Default value is "ordered". -->
			<optional>
				<attribute name="pick">
					<choice>
						<value>ordered</value>
						<value>random</value>
						<value>exclusiveRandom</value>
						<value>reversed</value>
					</choice>
				</attribute>
			</optional>
			<!-- 
				Sets the fade in type for the chunk. Default value is "none". 
				If the previous chunk has set "crossfade" as its fade out type, the fade in properties will be ignored.
			-->
			<optional>
				<attribute name="fadeInType">
					<choice>
						<value>none</value>
						<value>simplefade</value>
					</choice>
				</attribute>
			</optional>
			<!-- Sets the duration of the fade in transition, in seconds. Default value is 1. -->
			<optional>
				<attribute name="fadeInDur">
					<data type="float"/>
				</attribute>
			</optional>					
			<!-- Sets the fade type for the transition with the next chunk. Default value is "none". -->
			<optional>
				<attribute name="fadeOutType">
					<choice>
						<value>none</value>
						<value>simplefade</value>
						<value>crossfade</value>
					</choice>
				</attribute>
			</optional>
			<!-- Sets the duration of the fade transition, in seconds. Default value is 1. -->
			<optional>
				<attribute name="fadeOutDur">
					<data type="float"/>
				</attribute>
			</optional>			
			<!-- The current active track, by index. Default value is 0 (first track). -->
			<optional>
				<attribute name="activeTrack">
					<data type="int"/>
				</attribute>
			</optional>			
			<!-- 
				Space-separated list of events or time (in seconds) enabling the chunk. 
				By default, a chunk is enabled.
			-->
			<optional>
				<attribute name="enable">
					<ref name="eventOrTimeList"/>
				</attribute>
			</optional>
			<!-- Space-separated list of events or time (in seconds) disabling the chunk. -->
			<optional>
				<attribute name="disable">
					<ref name="eventOrTimeList"/>
				</attribute>
			</optional>
			<oneOrMore>
				<ref name="track"/>
			</oneOrMore>
		</element>
	</define>
	
	<!-- A track is the most basic audio element. -->
	<define name="track">
		<element name="track">
			<!-- 
				The audio source file. A track can define multiple scenes, with each scene having a particular audio source.
				If no audio source can be found for a particular scene, the default one will be used.
			-->
			<attribute name="src"/>
			<zeroOrMore>
				<element name="scene">
					<attribute name="name"/>
					<attribute name="src"/>
				</element>
			</zeroOrMore>
			<!-- 
				Define the probability of this track to be picked between all tracks if the chunk pick mode is set to random.
				Probability is defined as relative to other tracks values, and must be positive.
				Default value is 1.
			-->
			<optional>
				<attribute name="pickPriority">
					<data type="int"/>
				</attribute>		
			</optional>
			<!-- 
				Number of times the track will loop and play the content of its audio source. If set to -1, the	track will 
				repeat undefinitely. Value 0 is invalid. Default value is 1. 
			-->
			<optional>
				<attribute name="loopCount">
					<data type="int"/>
				</attribute>		
			</optional>
			<!-- Space-separated list of events or time (in seconds) that will set the current track as the active one. -->
			<optional>
				<attribute name="setActive">
					<ref name="eventOrTimeList"/>
				</attribute>
			</optional>
			<ref name="mixAttributes"/>
			<ref name="mixControls"/>
			<ref name="trackControls"/>
		</element>
	</define>
	
	<!-- Standard mixing control elements and various sound effect control elements available for the sub sections.. -->
	<define name="mixControls">
		<interleave>
			<ref name="volumeControl"/>
			<ref name="panControl"/>
			<ref name="effectOrderControl"/>
			<ref name="audioVirtualizerControl"/>
			<ref name="chorusControl"/>
			<ref name="equalizerControl"/>
			<ref name="reverbSourceControl"/>
		</interleave>
	</define>
	
	<!-- Standard mixing control elements and various sound effect control elements available for the master section.   -->
	<define name="masterMixControls">
		<interleave>
			<ref name="volumeControl"/>
			<ref name="panControl"/>
			<ref name="effectOrderControl"/>
			<ref name="audioVirtualizerControl"/>
			<ref name="chorusControl"/>
			<ref name="equalizerControl"/>
			<ref name="reverbControl"/>
		</interleave>
	</define>

	<!-- Specify various control parameters for the spectator. -->
	<define name="spectatorControls">
		<interleave>
			<ref name="dopplerControl"/>
			<ref name="orientationControl"/>
			<ref name="locationControl"/>	
		</interleave>
	</define>

	<!-- Specify various control parameters for a 3D-positioned sound source. -->
	<define name="soundSource3DControls">
		<interleave>
			<ref name="dopplerControl"/>
			<ref name="orientationControl"/>
			<ref name="locationControl"/>	
			<ref name="directivityControl"/>
			<ref name="distanceAttenuationControl"/>
			<ref name="macroScopicControl"/>
			<ref name="obstructionControl"/>
			<ref name="reverbSourceControl"/>
		</interleave>
	</define>
	
	<!-- Specify track special control elements. -->
	<define name="trackControls">
		<interleave>
			<ref name="rateControl"/>
			<ref name="pitchControl"/>
		</interleave>
	</define>
	
	<!-- 
		Special mix controls attributes. 
		Allow quick and easy access to the mix control parameters.
	-->
	<define name="mixAttributes">
		<optional>
			<attribute name="volume">
				<data type="int"/>
			</attribute>		
		</optional>
		<optional>
			<attribute name="pan">
				<data type="int"/>
			</attribute>
		</optional>
	</define>
	
<!--*******************************************************************************************************************************-->	

	<!-- Specify the output volume of the track, ranging from 0 to 100 with a linear scale. -->
	<define name="volumeControl">
		<optional>
			<element name="volumeControl">
				<optional>
					<attribute name="level">
						<data type="int"/>
					</attribute>
				</optional>
				<ref name="animate"/>
			</element>
		</optional>
	</define>

	<!--
		Specify the panning in case of a mono audio source, ranging from -100 to 100, where 0 represents panning for
		both channels, -100 full panning to the left, and 100 full panning to the right, with a linear scale.
	-->
	<define name="panControl">
		<optional>
			<element name="panControl">
				<optional>
					<attribute name="pan">
						<data type="int"/>
					</attribute>
				</optional>
				<ref name="animate"/>
			</element>
		</optional>
	</define>

	<!--
		Specify the order of the effects inside an effect group. Effects with a smaller order are processed first.
		If no effect order control is used, the default order will be used (which is implementation specific).
	-->
	<define name="effectOrderControl">
		<optional>
			<element name="effectOrderControl">
				<oneOrMore>
					<element name="effectOrder">
						<attribute name="effectControl">
							<choice>
								<value>audioVirtualizerControl</value>
								<value>chorusControl</value>
								<value>equalizerControl</value>
								<value>reverbControl</value>
								<value>reverbSourceControl</value>
							</choice>						
						</attribute>
						<attribute name="order">
							<data type="int"/>
						</attribute>					
					</element>		
				</oneOrMore>
			</element>
		</optional>
	</define>

	<!--
		Allows to virtualize audio channels. The behavior of this effect is dependent on the numbers of input and 
		output audio channels.
	-->
	<define name="audioVirtualizerControl">
		<optional>
			<element name="audioVirtualizerControl">
				<ref name="commonControlElements"/>
			</element>
		</optional>
	</define>

	<!-- A chorus/flanger effect that can be adjusted with several parameters. -->
	<define name="chorusControl">
		<optional>
			<element name="chorusControl">
				<!-- Average delay between the sound sources, in milliseconds. -->
				<optional>
					<attribute name="averageDelay">
						<data type="int"/>
					</attribute>
				</optional>
				<!-- Sets the delay modulation depth, as a percentage of the average delay. -->
				<optional>
					<attribute name="modulationDepth">
						<data type="int"/>
					</attribute>
				</optional>
				<!-- Sets the delay modulation rate, in mHz. -->
				<optional>
					<attribute name="modulationRate">
						<data type="int"/>
					</attribute>
				</optional>
				<!-- Determines how much of the audio is passed via the effect in percents. -->
				<optional>
					<attribute name="wetLevel">
						<data type="int"/>
					</attribute>
				</optional>
				<ref name="commonControlElements"/>
			</element>
		</optional>
	</define>

	<!-- Allows the manipulation of the equalization settings of an audio source. -->
	<define name="equalizerControl">
		<optional>
			<element name="equalizerControl">
				<!-- 
					Sets the bass level using a linear point scale with values between 0 and 100. 0 corresponds to 
					the maximum available attenuation, 50 being a flat equalization and 100 the maximum available
					amplification.
				-->
				<optional>
					<attribute name="bassLevel">
						<data type="int"/>
					</attribute>
				</optional>
				<!-- 
					Sets the treble level using a linear point scale with values between 0 and 100. 0 corresponds 
					to the maximum available attenuation, 50 being a flat equalization and 100 the maximum available
					amplification.
				-->
				<optional>
					<attribute name="trebleLevel">
						<data type="int"/>
					</attribute>
				</optional>
				<ref name="commonControlElements"/>
			</element>
		</optional>
	</define>

	<!-- A reverb effect that can be adjusted with several parameters. -->
	<define name="reverbControl">
		<optional>
			<element name="reverbControl">
				<!-- 
					Sets the gain level of the reverberation in mB. 
					The value must be non-positive.
				-->
				<optional>
					<attribute name="reverbLevel">
						<data type="int"/>
					</attribute>
				</optional>
				<!-- Sets the reverberation time in milliseconds. -->
				<optional>
					<attribute name="reverbTime">
						<data type="int"/>
					</attribute>
				</optional>
				<ref name="commonControlElements"/>			
			</element>
		</optional>
	</define>

	<!-- Specify the feeding of an audio source to the reverb audio effect. -->
	<define name="reverbSourceControl">
		<optional>
			<element name="reverbSourceControl">
				<!-- 
					Sets the level of the reflected sound compared to the natural room gain, in mB. 
					The value must be non-positive, 0 meaning the natural room gain. 
					Values equal or inferior to -9600 disable the reflected sound.
				-->
				<optional>
					<attribute name="roomLevel">
						<data type="int"/>
					</attribute>
				</optional>
			</element>
		</optional>
	</define>

	<!-- Specify the settings of the Doppler effect for a 3D sound source. -->
	<define name="dopplerControl">
		<optional>
			<element name="dopplerControl">
				<!-- Sets the velocity used in calculations for the Doppler effect. -->
				<optional>
					<attribute name="velocity">
						<list>
							<data type="int"/>	<!-- x -->
							<data type="int"/>	<!-- y -->
							<data type="int"/>	<!-- z -->
						</list>
					</attribute>
				</optional>
				<!-- Enables or disables the Doppler effect. -->
				<optional>
					<attribute name="enabled">
						<data type="boolean"/>
					</attribute>
				</optional>
				<ref name="animate"/>
			</element>
		</optional>
	</define>
	
	<!-- Specify the orientation settings for an object in the virtual acoustic space. -->
	<define name="orientationControl">
		<optional>
			<element name="orientationControl">
				<!-- Turns the object to the new orientation. -->
				<optional>
					<attribute name="orientation">
						<list>
							<data type="int"/>	<!-- heading -->
							<data type="int"/>	<!-- pitch -->
							<data type="int"/>	<!-- roll -->
						</list>
					</attribute>
				</optional>
				<ref name="animate"/>
			</element>
		</optional>
	</define>

	<!-- Specify the location of an object in the virtual acoustic space. -->
	<define name="locationControl">
		<optional>
			<element name="locationControl">
				<!-- Moves the object to the new location. -->
				<optional>
					<attribute name="location">
						<list>
							<data type="int"/>	<!-- x -->
							<data type="int"/>	<!-- y -->
							<data type="int"/>	<!-- z -->
						</list>
					</attribute>
				</optional>
				<ref name="animate"/>
			</element>
		</optional>
	</define>

	<!-- Specify the directivity pattern of a 3D sound source. -->
	<define name="directivityControl">
		<optional>
			<element name="directivityControl">
				<!-- Sets the directivity parameters. -->
				<optional>
					<attribute name="directivity">
						<list>
							<data type="int"/>	<!-- minAngle -->
							<data type="int"/>	<!-- maxAngle -->
							<data type="int"/>	<!-- rearLevel -->
						</list>
					</attribute>
				</optional>
				<ref name="animate"/>
			</element>
		</optional>
	</define>
	
	<!-- Controls how the sound from a 3D sound source is attenuated with its distance from the spectator. -->
	<define name="distanceAttenuationControl">
		<optional>
			<element name="distanceAttenuationControl">
				<!-- Sets the attenuation parameters. -->
				<optional>
					<attribute name="attenuation">
						<list>
							<data type="int"/>		<!-- minDistance -->
							<data type="int"/>		<!-- maxDistance -->
							<data type="boolean"/>	<!-- muteAfterMax -->
							<data type="int"/>		<!-- rolloffFactor -->
						</list>
					</attribute>
				</optional>
				<ref name="animate"/>
			</element>
		</optional>
	</define>

	<!-- Specify the macroscopic behavior of a 3D sound source. -->
	<define name="macroScopicControl">
		<optional>
			<element name="macroScopicControl">
				<!-- Sets the size of the audio source. -->
				<optional>
					<attribute name="size">
						<list>
							<data type="int"/>	<!-- x -->
							<data type="int"/>	<!-- y -->
							<data type="int"/>	<!-- z -->
						</list>
					</attribute>
				</optional>
				<ref name="animate"/>
			</element>
		</optional>
	</define>

	<!-- Specify how much of the direct sound from a 3D sound source can be heard. -->
	<define name="obstructionControl">
		<optional>
			<element name="obstructionControl">
				<!-- 
					Sets the level at which high frequency components will be transmitted directly from the
					source, in mB. The value must be non-positive. If 0, the source's frequency response
					will be flat.
				-->
				<optional>
					<attribute name="HFLevel">
						<data type="int"/>
					</attribute>
				</optional>
				<!-- 
					Sets the overall level that will be transmitted from the source, in mB. 
					The value must be non-positive. If 0, the source will be non-obstructed.
				-->
				<optional>
					<attribute name="level">
						<data type="int"/>
					</attribute>
				</optional>
				<ref name="animate"/>
			</element>
		</optional>
	</define>

	<!-- Allows to control the playback rate of a track. -->
	<define name="rateControl">
		<optional>
			<element name="rateControl">
				<!-- Sets the rate as a milli-percentage, 100'000 being the default rate. -->
				<optional>
					<attribute name="rate">
						<data type="int"/>
					</attribute>
				</optional>
				<ref name="animate"/>
			</element>
		</optional>
	</define>
	
	<!--
		Allows to raise or lower the pitch of the track without changing the playback speed.
	-->
	<define name="pitchControl">
		<optional>
			<element name="pitchControl">
				<!-- Sets the relative pitch shift, in milli-semitones. The default value is 0 -->
				<optional>
					<attribute name="pitch">
						<data type="int"/>
					</attribute>
				</optional>
				<ref name="animate"/>
			</element>
		</optional>
	</define>	

	<!-- Standard elements shared by most audio controls. -->
	<define name="commonControlElements">
		<optional>
			<attribute name="enabled">
				<data type="boolean"/>
			</attribute>
		</optional>
		<optional>
			<attribute name="preset"/>
		</optional>
		<ref name="animate"/>
	</define>
	
	<!-- Allows time or event based parameter animation. -->
	<define name="animate">
		<zeroOrMore>
			<element name="animate">
	            <attribute name="id"/>
				<!-- 
					The name of the attribute that will be animated.
					Some special attribute names may be used, allowing to set multiple parameters at the 
					same time; in that case the animation will only works with events using their associated
					event data as the source values to set the parameters. The event data then must contains
					all values needed binded on the parameters names, i.e. if the special attribute
					"velocity" is used, the event data must contains "X", "Y", and "Z" values.
				-->
				<attribute name="attribute">
					<choice>
						<value>level</value>						<!-- 0 to 100 for volumeControl, <0 for obstructionControl -->
						<value>pan</value>							<!-- -100 to 100 -->
						<value>rate</value>							<!-- >0 -->
						<value>pitch</value>
						<value>enabled</value>						<!-- 0 <=> false, !=0 <=> true -->
						<value>location</value>						<!-- special attributes with X, Y and Z subvalues -->
						<value>location.X</value>
						<value>location.Y</value>
						<value>location.Z</value>
						<value>velocity</value>						<!-- special attributes with X, Y and Z subvalues -->
						<value>velocity.X</value>
						<value>velocity.Y</value>
						<value>velocity.Z</value>
						<value>orientation</value>					<!-- special attributes with Heading, Pitch and Roll subvalues -->
						<value>orientation.Heading</value>
						<value>orientation.Pitch</value>
						<value>orientation.Roll</value>
						<value>directivity</value>					<!-- special attributes with MaxAngle, MinAngle and RearAngle subvalues -->
						<value>directivity.MinAngle</value>
						<value>directivity.MaxAngle</value>
						<value>directivity.RearAngle</value>
						<value>attenuation</value>					<!-- special attributes with MaxDistance, MuteAfterMax, MinDistance and RolloffFactor subvalues -->
						<value>attenuation.MinDistance</value>		<!-- >0 -->
						<value>attenuation.MaxDistance</value>		<!-- >0 -->
						<value>attenuation.MuteAfterMax</value>		<!-- 0 <=> false, !=0 <=> true -->
						<value>attenuation.RolloffFactor</value>	<!-- >0 -->
						<value>size</value>							<!-- special attributes with X, Y and Z subvalues -->
						<value>size.X</value>
						<value>size.Y</value>
						<value>size.Z</value>
						<value>HFLevel</value>						<!-- <0 -->
						<value>averageDelay</value>					<!-- >0 -->
						<value>modulationDepth</value>				<!-- >0 -->
						<value>modulationRate</value>				<!-- >0 -->
						<value>wetLevel</value>						<!-- 0 to 100 -->
						<value>reverbLevel</value>					<!-- <0 -->
						<value>reverbTime</value>					<!-- >0 -->
						<value>roomLevel</value>					<!-- <0 -->
						<value>bassLevel</value>					<!-- 0 to 100 -->
						<value>trebleLevel</value>					<!-- 0 to 100 -->
					</choice>
				</attribute>
				<!-- Space-separated list of events or time triggering the start of the animation. -->
	            <optional>
	                <attribute name="begin">
	                    <ref name="eventOrTimeList"/>
	                </attribute>
	            </optional>
				<!-- Space-separated list of events or time triggering the stop of the animation. -->
	            <optional>
	                <attribute name="end">
	                    <ref name="eventOrTimeList"/>
	                </attribute>
	            </optional>
				<!-- Duration of the animation. Default value is undefined. -->
	            <optional>
	                <attribute name="dur">
	                    <data type="float"/>
	                </attribute>
	            </optional>
				<!-- 
					Number of times the animation should be played. This number may be fractional, thus
					only a part of the last repetition may be done.	If set to -1, the animation will repeat 
					undefinitely. Value 0 is invalid. Default value is 1.
				-->
				<optional>
	                <attribute name="repeatCount">
	                    <data type="float"/>
	                </attribute>
	            </optional>
				<!-- 
					Active duration of the animation. The animation may be repeated many times along the
					specified duration. Default value is undefined. 
				-->
	            <optional>
	                <attribute name="repeatDur">
	                    <data type="float"/>
	                </attribute>
	            </optional>				
				<!-- Starting value of the animation. -->
	            <optional>
	                <attribute name="from">
	                    <data type="float"/>
	                </attribute>
	            </optional>
				<!-- Ending value of the animation. -->				
	            <optional>
	                <attribute name="to">
	                    <data type="float"/>
	                </attribute>
	            </optional>
				<!-- Relative offset for the value of the animation. -->
	            <optional>
	                <attribute name="by">
	                    <data type="float"/>
	                </attribute>
	            </optional>
				<!-- 
					A space-separated list of one or more values for the animation.
					The animation will use a linear interpolation between those values equally spaced through 
					the animation duration.
				-->
				<optional>
	                <attribute name="values">
						<list>
							<data type="float"/>
						</list>
	                </attribute>
				</optional>				
				<!-- 
					Animate the specified attribute (or set of attributes) using the data received with an event.
					You can use the value "none" to disable it or postpone the ".default" suffix to an event name
					to animate the attribute (or set of attributes) using the data provided with the event, 
					searching for values with the default attribute(s) name(s), eg:
					- when animating a single attribute, for example the attribute "level" of a volume control, 
					  the data provided with the event will be used directly (it must be an integer).
					  You can also specify manually which named value to search in the event data if a value set 
					  is provided by using the "." + value name suffix instead of ".default", for example 
					  "eventName.level".				
					- when animation an attribute set, for example the "location" of a location control,
					  the values named "X", "Y" and "Z" will be searched in the value set provided with the event.
                    If no suitable values are found inside the data provided with the specified event, this setting 
					has no effect.
					The default value is "none".
				-->
				<optional>
	                <attribute name="eventValue">
						<data type="string"/>
	                </attribute>
				</optional>
				<!-- 
					Specify whether the animated value should be set to the ending value of the animation or
					restored to its original value after the end of the animation. Default value is "remove".
				-->
	            <optional>
	                <attribute name="fill">
	                    <choice>
	                        <value>remove</value>
	                        <value>freeze</value>
	                    </choice>
	                </attribute>
	            </optional>				
				<!-- 
					Defines how the animation function interacts with itself, across repeat iterations. 
					Default value is "none".
				-->
	            <optional>
	                <attribute name="accumulate">
	                    <choice>
	                        <value>none</value>
	                        <value>sum</value>
	                    </choice>
	                </attribute>
	            </optional>				
			</element>
		</zeroOrMore>
	</define>

<!--*******************************************************************************************************************************-->	

	<define name="eventOrTimeList">
		<list>
			<oneOrMore>
				<choice>
					<data type="float"/>
					<data type="string"/>
				</choice>
			</oneOrMore>
		</list>
	</define>
	
</grammar>
