yes, i imagined it would be possible and u make it sound so easy...but...where to start? ??? Here is the tag: USER_AIN_NotifyChange
LC_MF_FaderEvent
;; save the fader number in LC_FADER_NUMBER
movwf LC_FADER_NUMBER
#if TOUCH_SENSOR_MODE >= 2
;; in this mode, no value will be sent if touch sensor not active
movf LC_FADER_NUMBER, W
call MIOS_MF_SuspendGet
bz LC_MF_FaderEvent_End
#endif
;; store 10-bit LSB value in LC_FADER_POS_L
movff MIOS_PARAMETER2, LC_FADER_POS_L
;; store 10-bit MSB value in LC_FADER_POS_H
movff MIOS_PARAMETER3, LC_FADER_POS_H
;; shift the values to the right position like descriped in
;; the Logic Control MIDI implementation, chapter 12
;; 10 bit -> 14 bit (LC_FADER_POS_[LH] << 4)
clrc
rlf LC_FADER_POS_L, F ; 1
rlf LC_FADER_POS_H, F
rlf LC_FADER_POS_L, F ; 2
rlf LC_FADER_POS_H, F
rlf LC_FADER_POS_L, F ; 3
rlf LC_FADER_POS_H, F
rlf LC_FADER_POS_L, F ; 4
rlf LC_FADER_POS_H, F
;; MIDI MSB: (LC_FADER_POS_H << 1) | LC_FADER_POS_L[7]
clrc
rlf LC_FADER_POS_H, W
IFSET LC_FADER_POS_L, 7, iorlw 0x01
movwf LC_FADER_POS_H
;; MIDI LSB: LC_FADER_POS_L & 0x7f
movlw 0x7f
andwf LC_FADER_POS_L, F
;; for MIDIbox Link: notify begin of stream
call MIOS_MIDI_BeginStream
;; finally send value: E<fader> LSB MSB
movf LC_FADER_NUMBER, W
andlw 0x0f
#if MOTORFADER0_IS_MASTERFADER != 0
skpnz
iorlw 0x08
#endif
iorlw 0xe0
call MIOS_MIDI_TxBufferPut
movf LC_FADER_POS_L, W
call MIOS_MIDI_TxBufferPut
movf LC_FADER_POS_H, W
call MIOS_MIDI_TxBufferPut
;; for MIDIbox Link: notify end of stream
call MIOS_MIDI_EndStream
LC_MF_FaderEvent_End
;; thats all
return
;; --------------------------------------------------------------------------
;; This function is called by LC_MPROC_Received_Ex when a fader should
;; be moved
;; Input:
;; o fader number in WREG and MIOS_PARAMETER1
;; o LSB value in MIOS_PARAMETER2
;; o MSB value in MIOS_PARAMETER3
;; --------------------------------------------------------------------------
LC_MF_FaderMove
;; save fader number in LC_FADER_NUMBER
andlw 0x07
movwf LC_FADER_NUMBER
;; derive 10-bit value from received 14-bit value. Store result in LC_FADER_POS_[LH]
movff MIOS_PARAMETER2, LC_FADER_POS_L ; MIDI LSB -> LC_FADER_POS_L
movff MIOS_PARAMETER3, LC_FADER_POS_H ; MIDI MSB -> LC_FADER_POS_H
;; LSB = MSB[0] | MIDI LSB
btfsc LC_FADER_POS_H, 0
bsf LC_FADER_POS_L, 7
;; MSB = MIDI MSB >> 1
clrc
rrf LC_FADER_POS_H, F
;; 10-bit value = 14-bit value >> 4
clrc
rrf LC_FADER_POS_H, F ; 1
rrf LC_FADER_POS_L, F
clrc
rrf LC_FADER_POS_H, F ; 2
rrf LC_FADER_POS_L, F
clrc
rrf LC_FADER_POS_H, F ; 3
rrf LC_FADER_POS_L, F
clrc
rrf LC_FADER_POS_H, F ; 4
rrf LC_FADER_POS_L, F
;; finally move fader
movff LC_FADER_POS_L, MIOS_PARAMETER1
movff LC_FADER_POS_H, MIOS_PARAMETER2
movf LC_FADER_NUMBER, W
goto MIOS_MF_FaderMove
from ain eg 2 I see:
USER_AIN_NotifyChange
;; a pot has been moved.
;; Send a MIDI event
;; save pot number in AIN_POT_NUMBER
movff MIOS_PARAMETER1, AIN_POT_NUMBER
;; save low-byte of conversion result in AIN_VALUE_L
movff MIOS_PARAMETER2, AIN_VALUE_L
;; save high-byte of conversion result in AIN_VALUE_H
movff MIOS_PARAMETER3, AIN_VALUE_H
;; prepare pointer 0 for last value entry
lfsr FSR0, AIN_VALUE_7BIT_BEGIN
movf AIN_POT_NUMBER, W
addwf FSR0L, F
;; now we can access the last pot value indirectly via INDF0
;; prepare pointer 1 for active value entry
lfsr FSR1, AIN_ACTIVE_VALUES_BEGIN
movf AIN_POT_NUMBER, W
addwf FSR1L, F
;; now we can access the active value indirectly via INDF1
;; important for soft-overtake: save last pot value in AIN_LAST_VALUE
;; so that we can determine the direction (clockwise or counter-clockwise turn?)
movff INDF0, AIN_LAST_VALUE
;; the AIN driver delivers a 10-bit result
;; convert it to a 7-bit value and save new result in AIN_VALUE_7BIT
;; the calculation is simple: the 10-bit value has to be divided by 8
;; the common way for this simple division is to shift the value
;; three times to the right. Every right-shift divides the value by 2
clrc ; value / 2
rrf MIOS_PARAMETER3, F
rrf MIOS_PARAMETER2, F
clrc ; value / 2
rrf MIOS_PARAMETER3, F
rrf MIOS_PARAMETER2, F
clrc ; value / 2
rrf MIOS_PARAMETER3, F
rrf MIOS_PARAMETER2, W ; copy result to working register (WREG)
;; makes: value / (2*2*2) == value / 8
;; result is now in WREG, write result to AIN_VALUE_7BIT (INDF0)
movwf INDF0
;; if soft takeover has not been activated, continue behind the
;; handler
IFCLR INDF1, 7, rgoto AIN_Cont ; (INDF1 == AIN_VALUE_7BIT[pot_number])
;; continue of active value == new value
movf INDF1, W
andlw 0x7f ; (mask out snap bit)
xorwf INDF0, W
bz AIN_Cont ; values equal? continue!
;; else branch depending on clockwise or counter clockwise turn
;; means: last value <= new value
movf AIN_LAST_VALUE, W
IFLEQ INDF0, ACCESS, rgoto AIN_CounterClockwise
AIN_Clockwise
;; pot has been moved clockwise
;; exit if if new value <= active value
movf INDF1, W
andlw 0x7f ; (mask out snap bit)
IFLEQ INDF0, ACCESS, return
;; exit if active value >= last value
IFGEQ AIN_LAST_VALUE, ACCESS, return
;; else continue
rgoto AIN_Cont
AIN_CounterClockwise
;; pot has been counter clockwise
;; exit if if new value >= active value
movf INDF1, W
andlw 0x7f ; (mask out snap bit)
IFGEQ INDF0, ACCESS, return
;; exit if active value <= last value
IFLEQ AIN_LAST_VALUE, ACCESS, return
;; else continue
AIN_Cont
;; save 7-bit result in AIN_ACTIVE_VALUE
movff INDF0, INDF1
;; and clear snap bit
bcf INDF1, 7
;;
;; !!!IMPORTANT!!!
;; MIOS functions normaly overwrite the FSR1 pointer, where currently
;; the active value has been saved
;; so don't use INDF1 anymore below (or calculate the correct pointer to the
;; pot entry once more)
;; !!!IMPORTANT!!!
;;
;; now send a MIDI event which contains the new value
;; we read the entry from MIOS_MPROC_EVENT_TABLE
;; this has a big advantage: you can setup the "input" and "output"
;; events at one place!
TABLE_ADDR MIOS_MPROC_EVENT_TABLE ; this macro sets the base address
movf AIN_POT_NUMBER, W ; add pot offset (number *2) to TABLPTR
mullw 2 ; multiplicate with 2, result in PROD[LH]
movf PRODL, W
addwf TBLPTRL, F ; low-byte
movf PRODH, W
addwfc TBLPTRH, F ; high-byte (+carry bit on overrun)
;; for MIDIbox Link: notify begin of stream
call MIOS_MIDI_BeginStream
;; send first MIDI byte
tblrd*+ ; read first byte from table
movf TABLAT, W
call MIOS_MIDI_TxBufferPut ; and send
;; send the second MIDI byte
tblrd*+ ; read second byte from table
movf TABLAT, W
call MIOS_MIDI_TxBufferPut ; and send
;; send the third MIDI byte
movf INDF0, W ; value from 0x00 to 0x7f
call MIOS_MIDI_TxBufferPut
;; for MIDIbox Link: notify end of stream
call MIOS_MIDI_EndStream
;; request a display update by setting DISPLAY_UPDATE_REQ,0
;; USER_DISPLAY_Tick polls this flag!
bsf DISPLAY_UPDATE_REQ, 0
;; thats all
return
END So i have to take some of ain eg 2 and combine with the code in lc_mc.inc right...no other files need touching?