<root>
<document schema='101' license='1,Ben Rowland,XHZ9AR' title='' description='' target='PIC.18F.18F2550' >
	<config data='!0,24!8,e!10,38!18,1e!20,0!28,80!30,80!38,0!40,ff!48,80!50,ff!58,a0!60,ff!68,ff%5,1%3,0%0,4%8,e%e,0%f,0%15,1%10,0%11,0%13,3%18,0%19,f%28,0%29,0%2a,0%2f,1%30,0%32,0%35,0%36,0%37,1%40,1%41,1%42,1%43,1%4f,1%4e,0%50,1%51,1%52,1%53,1%5f,1%5e,0%5d,1%60,1%61,1%62,1%63,1%6e,1' clkspd='48000000' simspd='1' usewdt='0' constif='0' />
	<plugins >
		<dll_dbg_icd enabled='0' >
			<data name='debug' value='1' />
			<data name='userpins' value='0' />
			<data name='speed' value='1000' />
			<data name='usev9' value='0' />
			<data name='breaks' value='8' />
			<data name='stacks' value='8' />
			<data name='clkport' value='1' />
			<data name='clkbit' value='6' />
			<data name='dataport' value='1' />
			<data name='databit' value='7' />
			<data name='monitor' value='1' />
			<data name='ictloop' value='1' />
			<data name='ictrate' value='1000' />
			<data name='ictmask' value='-1' />
		</dll_dbg_icd>
		<dll_models enabled='1' />
		<dll_upgrader enabled='1' />
		<dll_webhelp enabled='1' />
	</plugins>
	<supplement use='0' head='' body='' />
	<debug />
	<components >
		<settings autoimg='1' center='1' unitscale='0' fixedscale='0' fixedx='1' fixedy='1' fixedz='1' headcode='0' />
		<definition guid='b7d97af8-792c-4618-97e0-f1d748f4e54f' vstate='40' vmin='0' vmaj='1' srcleaf='' visiblename='' description='' category='' catenable='1' author='' manuname='' manucode='' sysinfo='0' keywords='' dynamic='0' iconpath='' />
		<component class_type='root' codename='panel' x='0' y='0' z='0' xsz='1' ysz='1' zsz='1' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
			<resources />
			<properties />
			<values />
			<events />
			<apis />
			<variables >
				<variable public='0' >
					<def class_type='variable' name='Velo' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='TxMidi' type='u8' description='' isconst='0' isinit='0' usrinit='&quot;&quot;' setinit='' >
						<array size='3' />
					</def>
				</variable>
				<variable public='0' >
					<def class_type='variable' name='USB_Status' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='USB_NOTE' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Midi_In' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='status' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='false' type='b1' description='' isconst='1' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Portb_R4' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='USB_VELO' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='idx' type='u8' description='' isconst='0' isinit='1' usrinit='0' setinit='0' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='Note' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='true' type='b1' description='' isconst='1' isinit='1' usrinit='1' setinit='1' />
				</variable>
				<variable public='0' >
					<def class_type='variable' name='I' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
				</variable>
			</variables>
			<macros >
				<macro >
					<flowline name='USBcomms' description='' >
						<local name='bytes' type='u8' description='' isconst='0' isinit='0' usrinit='0' setinit='' />
						<command class_type='call' title='Call Component Macro' component='CircularBuffer1' macro='GetNumberBytes' >
							<return exp='.bytes' />
						</command>
						<command class_type='decision' title='Decision' exp='.bytes' swap='0' >
							<flowline >
								<command class_type='call' title='Call Component Macro' component='CircularBuffer1' macro='GetByte' >
									<return exp='.bytes' />
								</command>
								<command class_type='decision' title='Decision' exp='Portb_R4 = 1' swap='0' >
									<flowline >
										<command class_type='call' title='Call Component Macro' component='USB_Serial1' macro='SendByte' >
											<argument exp='.bytes' />
										</command>
									</flowline>
									<flowline />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='TxMidi[idx] = .bytes' />
								</command>
								<command class_type='calculation' title='Calculation' >
									<exp exp='idx = idx + 1' />
								</command>
								<command class_type='decision' title='Decision' exp='idx = 3' swap='0' >
									<flowline >
										<command class_type='decision' title='Decision' exp='Portb_R4 = 1' swap='0' >
											<flowline >
												<command class_type='call' title='Call Component Macro' component='MIDI1' macro='SendMIDI' >
													<argument exp='TxMidi[0]' />
													<argument exp='TxMidi[1]' />
													<argument exp='TxMidi[2]' />
												</command>
											</flowline>
											<flowline />
										</command>
										<command class_type='calculation' title='Calculation' >
											<exp exp='idx = 0' />
										</command>
									</flowline>
									<flowline />
								</command>
							</flowline>
							<flowline />
						</command>
					</flowline>
				</macro>
				<macro >
					<flowline name='Main' description='' >
						<command class_type='call' title='Call Component Macro' component='USB_Serial1' macro='Initialise' />
						<command class_type='calculation' title='Calculation' >
							<exp exp='I = 0' />
						</command>
						<command class_type='call' title='Call Component Macro' component='MIDI1' macro='Initialise' />
						<command class_type='interrupt' title='Interrupt 4800 bytes / s' enable='1' name='TMR0' call='USBcomms' >
							<settings timer='1' prescale='8' postscale='-1' rollover='-1' bitcount='-1' trigger='3' maskhi='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' masklo='--------------------------------------------------------------------------------------------------------------------------------------------------------------------------8' >
								<option value='1' />
								<option value='0' />
								<option value='3' />
								<option value='-1' />
							</settings>
						</command>
						<command class_type='loop' title='Loop' type='0' exp='1' >
							<flowline >
								<command class_type='input' title='Input' mode='1' port='1048576' mask='16' exp='Portb_R4' />
								<command class_type='call' title='Call Component Macro' component='MIDI1' macro='ReceiveMIDI' >
									<return exp='status' />
									<argument exp='255' />
								</command>
								<command class_type='call' title='Call Component Macro' component='MIDI1' macro='ReadData' >
									<return exp='Note' />
									<argument exp='1' />
								</command>
								<command class_type='call' title='Call Component Macro' component='MIDI1' macro='ReadData' >
									<return exp='Velo' />
									<argument exp='2' />
								</command>
								<command class_type='call' title='Call Component Macro' component='CircularBuffer1' macro='PutByte' >
									<argument exp='status' />
								</command>
								<command class_type='call' title='Call Component Macro' component='CircularBuffer1' macro='PutByte' >
									<argument exp='Note' />
								</command>
								<command class_type='call' title='Call Component Macro' component='CircularBuffer1' macro='PutByte' >
									<argument exp='Velo' />
								</command>
							</flowline>
						</command>
					</flowline>
				</macro>
			</macros>
			<component class_type='ref' guid='a9b43242-9ccc-4f1c-b2d1-acdfbe420fc1' vmin='808' vmaj='16' codename='MIDI1' x='-88' y='0' z='1.005' xsz='60' ysz='26' zsz='1.51' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='CHANNEL' data='001' />
					<value target='TX' data='$PORTC.6' />
					<value target='RX' data='$PORTC.7' />
					<value target='TXRemap' data='' />
					<value target='RXRemap' data='' />
					<value target='label' data='MIDI' />
					<value target='DataSource' data='001' />
					<value target='Midi_Port' data='000' />
					<value target='Injector' data='000' />
					<value target='InjectorHandle' data='0' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='3e28ac22-2855-410a-9660-0b0a4731e545' vmin='808' vmaj='16' codename='USB_Serial1' x='-32' y='0' z='2.005' xsz='60' ysz='26' zsz='1.51' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='vendor_ID' data='4799' />
					<value target='product_ID' data='61456' />
					<value target='dev_name' data='Flowcode USB Serial' />
					<value target='dev_manufacturer' data='Matrix Multimedia Ltd.' />
					<value target='major_version' data='1' />
					<value target='minor_version' data='0' />
					<value target='enumeration_tout' data='0' />
					<value target='timeout' data='10' />
					<value target='usb_type' data='1' />
					<value target='driver_directory' data='$(srcdir)' />
					<value target='driver_filename' data='Flowcode_USB_Serial_Driver' />
					<value target='gen_driver' data='' />
					<value target='COM_port' data='001' />
					<value target='label' data='USB Serial' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
			<component class_type='ref' guid='c34f9b8a-a915-4f75-ad0c-87f2ad670a8a' vmin='40' vmaj='16' codename='CircularBuffer1' x='-64' y='40' z='0' xsz='20' ysz='20' zsz='20' xang='0' yang='0' zang='0' xquat='0' yquat='0' zquat='0' wquat='1' visible='1' interactive='1' solid='1' layer='1' poslock='0' >
				<resources />
				<properties />
				<values >
					<value target='BufferSize' data='128' />
					<value target='StorageType' data='000' />
				</values>
				<events />
				<apis />
				<variables />
				<macros />
			</component>
		</component>
	</components>
	<keymap />
	<panel2d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='9737364' img='' style='0' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel2d>
	<panel3d shadows='0' lighting='2' brightness='0' perspective='0' >
		<background rgb='8409120' img='' style='0' />
		<table rgb='7360576' img='' style='0' size='25' />
		<camera xe='0' ye='0' ze='300' xt='0' yt='0' zt='0' xquat='0' yquat='0' zquat='0' wquat='1' />
	</panel3d>
	<layout >
		<view type='0' name='Main' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAALQQAAJEDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
		<view type='0' name='USBcomms' mode='0' placement='LAAAAAAAAAABAAAA---------------------wAAAAAUAAAALQQAAJEDAAA' zoom='75' scrollx='0' scrolly='0' flags='0' />
	</layout>
</document>
</root>
