
void CTROL(unsigned char pin){
	MIOS_LCD_CursorSet(0x00);
	//MIOS_LCD_PrintCString("CTRL");

	switch(pin){//SPECIAL KEYS

		case 57:midi_channel=0;break;//MIDICHAN 1  (keyb:esc)
		case 56:midi_channel=1;break;//MIDICHAN 2  (keyb:1)
		case 63:midi_channel=2;break;//MIDICHAN 3  (keyb:2)
		case 48:midi_channel=3;break;//MIDICHAN 4  (keyb:3)
		case 55:midi_channel=4;break;//MIDICHAN 5  (keyb:4)
		case 40:midi_channel=5;break;//MIDICHAN 6  (keyb:5)
		case 47:midi_channel=6;break;//MIDICHAN 7  (keyb:6)
		case 32:midi_channel=7;break;//MIDICHAN 8  (keyb:7)
		case 39:midi_channel=8;break;//MIDICHAN 9  (keyb:8)
		case 24:midi_channel=9;break;//MIDICHAN 10 (keyb:9)
		case 31:midi_channel=10;break;//MIDICHAN 11 (keyb:0)
		case 16:midi_channel=11;break;//MIDICHAN 12 (keyb:+)
		case 23:midi_channel=12;break;//MIDICHAN 13 (keyb:-)
		case 8: midi_channel=13;break;//MIDICHAN 14 (keyb:£)
		case 15:midi_channel=14;break;//MIDICHAN 15 (keyb:clr-home)
		case 0 :midi_channel=15;break;//MIDICHAN 16 (keyb:inst-del)

		
		case 2:PRG_CHNG(prg[midi_channel]+1);break;//CRSR RIGHT :PRG++
		case 3:PRG_CHNG(prg[midi_channel]-1);break;//CRSR LEFT  :PRG--

		case 54://E : CTRL+E -> EDIT PATTERN
			//pg.EDIT=1;
			MIOS_LCD_PrintCString("EDIT PATTERN");
			break;//E : CTRL+E -> EDIT

		/*
		case 41://CTRL+R : REC (edit) PHRASE
			pg.REC=1;
			MIOS_LCD_PrintCString("EDIT PHRASE");
			break;
		
		case 17:PRG_IN();break;//P : PRG CHANGE
		case 41:REC();break;//R : REC
		case 53:SAVE();break;//S : CTRL+S -> SAVE
		case 30:LOAD();break;//o : CTRL+O -> LOAD
		*/

	}

	led_num(midi_channel);
	return;
}
/*
void SPCE(unsigned char pin){//SPACE BAR
	
//	MIOS_LCD_CursorSet(0x00);
//	MIOS_LCD_PrintCString("SPACE+");
//	MIOS_LCD_PrintBCD2(pin);
//	MIOS_LCD_PrintCString("   ");

	MIOS_LCD_CursorSet(0xCE);
	MIOS_LCD_PrintCString("POS ");
	MIOS_LCD_PrintBCD2(song_pos);	//song_pos

	switch(pin){//SPECIAL KEYS

		case 58:SONGPOS(0);	break;//MIDICHAN 1
		//case 56:SONGPOS(1);	break;//MIDICHAN 2
		case 59:SONGPOS(1);	break;//MIDICHAN 2
		case 60:SONGPOS(2);	break;//MIDICHAN 3
		//case 48:SONGPOS(3);	break;//MIDICHAN 4
		case 51:SONGPOS(3);	break;//MIDICHAN 4
		case 52:SONGPOS(4);	break;//MIDICHAN 5
		//case 40:SONGPOS(5);	break;//MIDICHAN 6
		case 43:SONGPOS(5);	break;//MIDICHAN 6
		case 44:SONGPOS(6);	break;//MIDICHAN 7
		//case 32:SONGPOS(7);	break;//MIDICHAN 8
		case 35:SONGPOS(7);	break;//MIDICHAN 8
		case 36:SONGPOS(8);	break;//MIDICHAN 9
		//case 24:SONGPOS(9);	break;//MIDICHAN 10
		case 27:SONGPOS(9);	break;//MIDICHAN 10
		case 28:SONGPOS(10);break;//MIDICHAN 11
		//case 16:SONGPOS(11);break;//MIDICHAN 12
		case 19:SONGPOS(11);break;//MIDICHAN 12
		case 20:SONGPOS(12);break;//MIDICHAN 13
		//case 8 :SONGPOS(13);break;//MIDICHAN 14
		case 11:SONGPOS(13);break;//MIDICHAN 14
		case 12:SONGPOS(14);break;//MIDICHAN 15
		//case 0 :SONGPOS(15);break;//MIDICHAN 16
		case 3 :SONGPOS(15);break;//MIDICHAN 16

		case 59 :RUN();break;//RUN-STOP
	}

	return;
}

*/

/*
void COMODORE(unsigned char pin){//COMMODORE KEY
	
	MIOS_LCD_CursorSet(0x80);
	MIOS_LCD_PrintCString("C=+");
	MIOS_LCD_PrintBCD2(pin);
	MIOS_LCD_PrintCString("   ");

	switch(pin){//COMMODORE SPECIAL KEYS
		case 0 :MIOS_Reset();return;break;
		case 47:CC_edit();return;break;//C : CTRL+C -> COPY
	}
	return;
}
*/