
/////////////////////////////////////////////////////////////////////////////
// This function is called by MIOS when a pot has been moved
/////////////////////////////////////////////////////////////////////////////
void AIN_NotifyChange(unsigned char pin, unsigned int pin_value) __wparam
{
	unsigned char cc=0;

	MIOS_LCD_CursorSet(0x40); // 2nd line
	MIOS_LCD_PrintCString("POT");
	MIOS_LCD_PrintBCD1((pin+1));
	MIOS_LCD_PrintCString(":");
	MIOS_LCD_PrintBCD3(MIOS_AIN_Pin7bitGet(pin));



	switch(pin){

		case 0://POT 1 : CC num 1
			//MIOS_LCD_PrintCString("CC");
			MIOS_MIDI_TxBufferPut(176 + midi_channel); // CC at channel n
			MIOS_MIDI_TxBufferPut(46);  // pin number corresponds to CC number
			MIOS_MIDI_TxBufferPut(MIOS_AIN_Pin7bitGet(pin));   // don't send 10bit pin_value,
			break;

		case 1://POT 2 : CC num 2
			//MIOS_LCD_PrintCString("CC");
			MIOS_MIDI_TxBufferPut(176 + midi_channel); // CC at channel n
			MIOS_MIDI_TxBufferPut(47);  // pin number corresponds to CC number
			MIOS_MIDI_TxBufferPut(MIOS_AIN_Pin7bitGet(pin));   // don't send 10bit pin_value,
			break;
	

		case 3://TEMPO
			bpm=48+pin_value<<2;
		break;
	}



	return;
}


//MBSID

//CUTOFF : 46
//RESONA : 47

/*
//SEND CC !!
MIOS_MIDI_TxBufferPut(176 + midi_channel); // CC at channel n
MIOS_MIDI_TxBufferPut(MIOS_EEPROM_Read(0x10 + midi_channel));  // pin number corresponds to CC number
MIOS_MIDI_TxBufferPut(MIOS_AIN_Pin7bitGet(pin));   // don't send 10bit pin_value,
*/
