<!-- Sample xml demonstrating how to make TouchDAW's MIDI utilities emulate a piece of hardware.
This sets up the pads underneath the range selector on the keyboard screen to mimick the first 12 pads plus scene up / down
and scene start / stop buttons on a Launchkeys series keyboard and makes the app identify itself as a Launchkeys 49 Mk2 by 
replying to device queries with the appropriate sysex message.
See https://customer.novationmusic.com/sites/customer/files/novation/downloads/10535/launchkey-mk2-programmers-reference-guide.pdf
for details on the hardware's MIDI implementation.
This should work with full RGB feedback in Ableton Live 9+ after defining a Launchkey Mk2 control surface and linking it to the app's
second MIDI port (both in- & output) in Live's MIDI preferences.
For clarity the sample ommits all nodes but the first block of pads on the keyboard screen and the query response definition. -->

<touchdaw_midi_map>
	<keyboard>
		<!-- Pads on the keyboard screen follow the keyboard's MIDI channel settings unless forced to another channel by a 'MIDI Channel' action or a
		a global 'fc' ("Force Channel") attribute. The hardware's buttons all send on channel 16 (15 in code, because 0 based), so the emulation will have to do as well.
		The 'vc' ("Velocity Code") attribute globally sets the 'LP_RGB' color code for all pads. -->
		<launchpad id="0" fc="15" vc="3">
			<!-- 8 clip slots -->
			<pad id="0" midi="0x9F,0x60,0x7F"/>
			<pad id="1" midi="0x9F,0x61,0x7F"/>
			<pad id="2" midi="0x9F,0x62,0x7F"/>
			<pad id="3" midi="0x9F,0x63,0x7F"/>
			<pad id="4" midi="0x9F,0x64,0x7F"/>
			<pad id="5" midi="0x9F,0x65,0x7F"/>
			<pad id="6" midi="0x9F,0x66,0x7F"/>
			<pad id="7" midi="0x9F,0x67,0x7F"/>
			<!-- 4 (of 8) track stop buttons -->
			<pad id="8" midi="0x9F,0x70,0x7F"/>
			<pad id="9" midi="0x9F,0x71,0x7F"/>
			<pad id="10" midi="0x9F,0x72,0x7F"/>
			<pad id="11" midi="0x9F,0x73,0x7F"/>
			<!-- scene up/down -->
			<pad id="12" midi="0xBF,0x70,0x7F" title="&#x25B2;"/>
			<pad id="13" midi="0xBF,0x71,0x7F" title="&#x25BC;"/>
			<!-- scene start/stop -->
			<pad id="14" midi="0x9F,0x68,0x7F" title="&#x25B6;&#xFE0E;"/>
			<pad id="15" midi="0x9F,0x78,0x7F" title="&#x25A0;"/>
		</launchpad>
	</keyboard>
	<emulation>
			<!-- This node can have multiple 'query' subnodes with (optional) 'midi' and (required) 'response' attributes.
			The 'midi' attribute is what incoming midi is matched against. 'response' denotes what will be sent in return if a match has been detected.
			If no 'midi' attribute is present, matches will be made against standard device inquiries (0xF0,0x7E,0x7f,0x06,0x01,0xF7), only one
			'query' subnode without a 'midi' attribute will make sense. 
			The 'midi' attribute can contain 0xFF wildcard bytes that will match any incoming byte.
			'query' nodes can be deactivated by adding an 'active="false"' attribute.
			
			'emulation' nodes can also be given inside 'launchpad' or 'controller' nodes, which has the advantage that they are importable along with
			the controller definition (and will get removed with them). 
			-->
			<query response="0xF0,0x7E,0x00,0x06,0x02,0x00,0x20,0x29,0x7C,0x00,0x01,0x00,0x00,0x01,0x06,0x02,0xF7"/>
	</emulation>
</touchdaw_midi_map>