
// Current patch : Store PRG for each midi channel
unsigned char prg[16];

/////////////////////////////////////////////////////////////////////////////
// Send prg change
/////////////////////////////////////////////////////////////////////////////

void PRG_CHNG(unsigned char prgnum){//CHANGE PROGRAM FOR CURRENT MIDI CHANNEL
	if(prgnum>127)prgnum=127;
	prg[midi_channel]=prgnum;
	MIOS_LCD_CursorSet(0x00);
	MIOS_LCD_PrintCString("CHN");
	MIOS_LCD_PrintBCD2(midi_channel+1);
	MIOS_LCD_PrintCString(" PRG");
	MIOS_LCD_PrintBCD3(prg[midi_channel]);
	//http://www.borg.com/~jglatt/tech/midispec.htm
	MIOS_MIDI_TxBufferPut(192 + midi_channel);//PRG CHANGE
	MIOS_MIDI_TxBufferPut(prgnum);//PRG CHANGE NUM
	//MIOS_EEPROM_Write(0x00 + midi_channel, prg[midi_channel]);//SAVE TO EEPROM
	return;
}
