Jump to content

Integrate MIDIO128 and CV - possible?


adamstan
 Share

Recommended Posts

Hello. On my neverending ;-) quest for building polysynth using MidiBox as keyboard decoder, I started to wonder if it's possible to 'merge' MIDIO128 functions into MidiBox CV so it would become all-in-one keyboard scanner ,voice assigner and MIDI interface - in one CORE module. It would be also nice to have Mono/Poly/Unison switch to change these settings without diving into menus. Do you have any suggestions??

Thanks in advance :-)

PS I've found quite cheap PCB manufacturer, and nearly all boards are designed, so maybe in few months the quest will be completed :-)

Link to comment
Share on other sites

Hi,

so long you only want to send common MIDI events, the appr. code can be added very easily to the main.asm file:


;; --------------------------------------------------------------------------
;;  This function is called by MIOS when an button has been toggled
;;  Input:
;;    o Button number in WREG and MIOS_PARAMETER1
;;    o Button value MIOS_PARAMETER2:
;;      - 1 if button has been released (=5V)
;;      - 0 if button has been pressed (=0V)
;; --------------------------------------------------------------------------
USER_DIN_NotifyToggle
        ;; check for control surface buttons - the CS handler will jump
        ;; back if the button has not been assigned to a CS function
        goto    CS_MENU_BUTTON_Handler
CS_MENU_BUTTON_Handler_Return

      ;; Ok, button not assigned to CS, send a MIDI Note event
      movlw 0x90
      call MIOS_MIDI_TxBufferPut
      movf MIOS_PARAMETER1, W    ; button number
      addlw 0x18 - 4      ; add 0x18 (C-1) - 4 (first four buttons assigned to CS)
      call MIOS_MIDI_TxBufferPut
      movlw 0x7f      ; send velocity=0x7f when button pressed, 0 when button depressed
      IFSET MIOS_PARAMETER2, 0, movlw 0
      call MIOS_MIDI_TxBufferPut
      return
[/code] The CS buttons should be assigned to DIN 0..3:
[code]
  #define DEFAULT_DIN_MENU_EXEC        3      ; menu exec button assigned to DIN pin #3
  #define DEFAULT_DIN_MENU_RIGHT        2      ; menu right button assigned to DIN pin #2
  #define DEFAULT_DIN_MENU_LEFT        1      ; menu left button assigned to DIN pin #1
  #define DEFAULT_DIN_MENU_SELECT      0      ; menu select button assigned to DIN pin #0

Best Regards, Thorsten.

Link to comment
Share on other sites

Is this code correct?

USER_DIN_NotifyToggle
        ;; check for control surface buttons - the CS handler will jump
        ;; back if the button has not been assigned to a CS function
        goto    CS_MENU_BUTTON_Handler
CS_MENU_BUTTON_Handler_Return

       ;; Ok, button not assigned to CS, send a MIDI Note event
       movlw 0x90
       call MIOS_MIDI_TxBufferPut
       movf MIOS_PARAMETER1, W    ; button number
       addlw 0x18 - 4      ; add 0x18 (C-1) - 4 (first four buttons assigned to CS)
       movwf MIOS_PARAMETER1 ; store key number temporarily in MIOS_PARAMETER1
	call MIOS_MIDI_TxBufferPut
       movlw 0x7f      ; send velocity=0x7f when button pressed, 0 when button depressed
       IFSET MIOS_PARAMETER2, 0, movlw 0
       	call MIOS_MIDI_TxBufferPut
	movwf MIOS_PARAMETER3 ; put velocity in MIOS_PARAMETER3
	movff MIOS_PARAMETER1, MIOS_PARAMETER2 ; put key number in MIOS_PARAMETER2
	movlw 0x90
	movwf MIOS_PARAMETER1 ; put 0x90 in MIOS_PARAMETER1
	call USER_MPROC_NotifyReceivedEvent       
	return

Link to comment
Share on other sites

Currently you are writing the output of MIOS_MIDI_TxBufferPut into the MIOS_PARAMETERx registers, this won't work, because WREG has an undefined value at this time.

It's better to determine the MIDI bytes again after the entire MIDI event has been sent (just duplicate the code), to write them into MIOS_PARAMETER[123] instead of calling MIOS_MIDI_TxBufferPut. Thereafter you can call the MIOS hook.

Best Regards, Thorsten.

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...