Joystick pots on the SEQ

Hi,

I have four joystick pots lying around since I tried to mod my UC-33e. I have a BCR2000 so I don’t really feel the need to build a controller MidiBox. But none the less, I’d like to use those pots. Here’s my idea…

I’m building a MidiBox SEQ2, and I was thinking maybe I could incorporate the pots in that project. Not to deal with the actual sequencer, but rather as a means to send CCs on a given midi channel, for example.  I guess I’ll have to get an AIN board, but is there an easy way of adding the extra code to the PIC, making the function available in parallell to the sequencer?

Regards,

Mikael

Hi Mikael,

no problem, just write following code to the USER_AIN_NotifyChange hook in main.asm

;; --------------------------------------------------------------------------
;;  This function is called by MIOS when a Pot has been moved
;;  Input:
;;    o Pot number in WREG and MIOS_PARAMETER1
;;    o LSB value in MIOS_PARAMETER2
;;    o MSB value in MIOS_PARAMETER3
;; --------------------------------------------------------------------------
USER_AIN_NotifyChange
        ;; convert 10-bit value to 7-bit value
        rrf    MIOS_PARAMETER3, F      ; value / 2
        rrf    MIOS_PARAMETER2, F
        rrf    MIOS_PARAMETER3, F      ; value / 2
        rrf    MIOS_PARAMETER2, F
        rrf    MIOS_PARAMETER3, F      ; value / 2
        rrf    MIOS_PARAMETER2, F
        bcf    MIOS_PARAMETER2, 7      ; clear 8th bit

        ;; now: pot number in WREG and MIOS_PARAMETER1
        ;; 7-bit value in MIOS_PARAMETER2

;; send CC
movlw	0xb5 ; 0xb5 = CC, channel 6
call	MIOS_MIDI_TxBufferPut
movf	MIOS_PARAMETER1, W	; pot number is the CC number
call	MIOS_MIDI_TxBufferPut
movf	MIOS_PARAMETER2, W      ; 7-bit CC value
goto	MIOS_MIDI_TxBufferPut
[/code]









in USER\_Init you have to specifiy the number of pots - thats all







Best Regards, Thorsten.

Thanks Thorsten,

I should have been more observant to put it in the right forum.  :-\

Wow… Is it really this simple - seems to good to be true!

Cheers,

Mikael

TK always makes things so easy . He’s the MAN!  ;D