Jump to content

LC Initialization


Guest faz909
 Share

Recommended Posts

Hi Thorsten, all..

I've been following the MIDIBox developments for a while now.. you cease to amaze me with your ideas.. Well Done!!

I'm trying to work out the equations in Logic Controls challenge/response code..  (please excuse my lack of knowledge, I'm a novice)

.. r1 = 0x7F & (l1+(l2^0xA)-l4)

  r2 = 0x7F & ((l3>>4)^(l1+l4))

  r3 = 0x7F & (l4-(l3<<2)^(l1|l2)

  r4 = 0x7F & (l2-l3+(0xF0^(l4<<4)))

In my readings, I've learnt about the different operations.. AND, XOR, LSHIFT, RSHIFT, OR.. I've found a calculator that handles algebraic equations.. but I have no idea if I understand it or not.. I do have some answers.. can someone please tell me if I'm right or wrong?  

if  L1  =   8   then R1 = 22

if  L2  =  16  then R2 = 14

if  L2  =  32  then R2 = 127

if  L2  =  12  then R2 = 32

I'm also confused with the 7 byte ASCII serial number.. I don't own a Logic control, so I don't know what a serial number looks like, it's format.. Is there a format for LC serial numbers? Is the random challenge code random each time LC turns on, or is it dependant on the serial no.?

I'm sending sysex messages between two PC's, with one of them trying to emulate a LC power up using sysex faders.

As you can see, I'm confused, and need some help to understand all this..

Thanks in advance..

Faz

Link to comment
Share on other sites

Hi Faz,

it isn't required to send the decoded password to Logic or Cubase, some dummy bytes are enough, since the purpose of this nameization sequence is only to unlock the Logic Control itself. Here the appr. code for the MIOS application, which will be published soon (and which can give you some more hints). These parts are called by a SysEx parser, which reacts on F0 00 00 66 <LC-ID> <action-ID>:

;; --------------------------------------------------------------------------
;;  MIDI Check action: perform a sysex action
;; --------------------------------------------------------------------------
LC_MPROC_Handler
        IFSET   LC_MPROC_STATE, LC_MPROC_STATE_ACTION, rgoto LC_MPROC_Handler_DoAction

        bsf     LC_MPROC_STATE, LC_MPROC_STATE_ACTION

        movff   LC_MPROC_IN, LC_MPROC_ACTION
        rgoto   LC_MPROC_SysExCheck_End

        ;; ---

LC_MPROC_Handler_DoAction
        movf    LC_MPROC_ACTION, W
        bz      LC_MPROC_Action_Query

        movf    LC_MPROC_ACTION, W
        xorlw   0x02
        bz      LC_MPROC_Action_HostReply

        movf    LC_MPROC_ACTION, W
        xorlw   0x10
        bz      LC_MPROC_Action_WriteMTC1

        movf    LC_MPROC_ACTION, W
        xorlw   0x11
        bz      LC_MPROC_Action_WriteMTC2

        movf    LC_MPROC_ACTION, W
        xorlw   0x12
        bz      LC_MPROC_Action_WriteLCD

        movf    LC_MPROC_ACTION, W
        xorlw   0x13
        bz      LC_MPROC_Action_VersionReq

        goto    LC_MPROC_ActionInvalid

;; --------------------------------------------------------------------------
;;  MIDI Action: LC Query
;; --------------------------------------------------------------------------
LC_MPROC_Action_Query
        ;; wait until sysex footer (F7) has been received
        movlw   0xf7
        IFNEQ   LC_MPROC_IN, ACCESS, rgoto LC_MPROC_SysExCheck_End

        ;; send SysEx header
        call    LC_MPROC_Send_SysExHeader

        ;; send Host Connect Query
        movlw   0x01
        call    MIOS_MIDI_TxBufferPut

        ;; call help function which sends the LC serial number
        call    LC_MPROC_Hlp_SendSerial

        ;; send dummy password
        movlw   'A'
        call    MIOS_MIDI_TxBufferPut
        movlw   'B'
        call    MIOS_MIDI_TxBufferPut
        movlw   'C'
        call    MIOS_MIDI_TxBufferPut
        movlw   'D'
        call    MIOS_MIDI_TxBufferPut

        ;; send SysEx footer
        call    LC_MPROC_Send_SysExFooter

        ;; finish Action
        rgoto   LC_MPROC_ActionFinished
        
;; --------------------------------------------------------------------------
;;  MIDI Action: LC Host Reply
;; --------------------------------------------------------------------------
LC_MPROC_Action_HostReply
        ;; wait until sysex footer (F7) has been received
        movlw   0xf7
        IFNEQ   LC_MPROC_IN, ACCESS, rgoto LC_MPROC_SysExCheck_End

        ;; send SysEx header
        call    LC_MPROC_Send_SysExHeader

        ;; send Host Connect Confirmation
        movlw   0x03
        call    MIOS_MIDI_TxBufferPut

        ;; call help function which sends the LC serial number
        call    LC_MPROC_Hlp_SendSerial

        ;; send SysEx footer
        call    LC_MPROC_Send_SysExFooter

        ;; finish Action
        rgoto   LC_MPROC_ActionFinished

;; --------------------------------------------------------------------------
;; this help function sends the pseudo serial number of the emulation: 12345678
LC_MPROC_Hlp_SendSerial
        movlw   '1'
        movwf   TMP1
LC_MPROC_Hlp_SendSerial_Loop
        movf    TMP1, W
        call    MIOS_MIDI_TxBufferPut
        incf    TMP1, F
        movlw      '8'
        IFNEQ      TMP1, ACCESS, rgoto LC_MPROC_Hlp_SendSerial_Loop
        return

;; --------------------------------------------------------------------------
;;  MIDI Action: LC Version Request
;; --------------------------------------------------------------------------
LC_MPROC_Action_VersionReq
        ;; wait until sysex footer (F7) has been received
        movlw   0xf7
        IFNEQ   LC_MPROC_IN, ACCESS, rgoto LC_MPROC_SysExCheck_End

        ;; send SysEx header
        call    LC_MPROC_Send_SysExHeader

        ;; send version number
        movlw   0x14
        call    MIOS_MIDI_TxBufferPut

        movlw   'V'
        call    MIOS_MIDI_TxBufferPut
        movlw   '1'
        call    MIOS_MIDI_TxBufferPut
        movlw   '.'
        call    MIOS_MIDI_TxBufferPut
        movlw   '4'
        call    MIOS_MIDI_TxBufferPut
        movlw   '2'
        call    MIOS_MIDI_TxBufferPut

        ;; send footer only if merger has not been enabled
        ;; to ensure a proper MIDI protocol
        call    MIOS_MIDI_MergerGet
        andlw   0x01
        bnz     LC_MPROC_Action_VersionReq_End
        
        movlw   0xf7
        call    MIOS_MIDI_TxBufferPut
LC_MPROC_Action_VersionReq_End
        rgoto   LC_MPROC_ActionFinished

there is no special format for the version number

Hope it helps

Best Regards, Thorsten.

P.S.: maybe it's required to handle this SySEx interaction (Query/Reply/Version Request) as fast as possible before the host application sends the query command again!)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...