• entries
    9
  • comments
    4
  • views
    26,516

4 Midi IN/OUT Ports for SEQV4L (Adding 2 more MIDI I/O)

Sign in to follow this  
Followers 0
Duggle

1,299 views

gallery_3440_57_262864.jpg

Abstract

This article documents the hardware and software mods to provide 2 extra (4 total) Midi I/O ports on the MB SEQ4L.

The added ports use the onboard UARTs (2,3) of the LPC MIOS32 core. The underlying sequencer code supports these ports (MIDI 3 and 4), but in the case of MIDI 3, the pins used, need to be replaced as they are( were) used to drive LED matrix columns. I chose J28 to provide these LED column driver pins, unfortunately they are part of the CV output (which I don't want) which has to be disabled in the software.

Introduction

The Midi Router functionality of the MB SEQV4 (Lite and "Full" versions) allows complex and well integrated MIDI interconnection of Synths and devices. The motivation in my case was to have Sysex Librarian and PC host synth patch design avaiable using the 4 available USB MIDI ports. Suffice it to say that having an extra 2 midi ports allows me to have RC50 Looper, MBSEQ, keyboards, and 2 Virus synths all talking and editable simultaneously from my PC. Perhaps the details should go in a separate blog article.

Hardware Mods

MIDI I/O Port 4

This one is straight forward as port J4B is free.

Simply connect a 2pin header receptacle:

J4B.SC->Midi In

J4B.SD->Midi Out

Ive used a GM5 PCB for MIDI sockets, opto, etc. but can use a standard circuit built on vero board. Just copy the circuit from a core.

MID I/O Port 3

This one is a little more involved as the pins that have the UART functionality are on J15 which is used to drive the LED matrix columns on the SEQV4L.

I've chosen J28.0 to replace J5B.6 (column driver)

and J28.1 to replace J5B.7 (column driver)

Core pin J5B.6->Midi IN (black wire in picture)

Core pin J5B.7->Midi OUT (red wire in picture)

J28.SDA->J5B.6 (connector) (white wire in picture)

J28.SC->J5B.7 (connecor) (blue wire in picture)

gallery_3440_57_545214.jpg

(above) MIDI port 3 wiring NOTE TRACKS ARE CUT between black and white and between red and blue!!!!

Software Mods

\trunk\apps\sequencers\midibox_seq_v4_lite\mios32\mios_32_config.h

This enables the extra midi ports in the firmware

include the following lines (comment out conflicting #defines)



#define SEQ4VL_FOUR_MIDI_PORTS            /*switch used elsewhere to compile this mod*/

#define MIOS32_USB_MIDI_NUM_PORTS 4  /*use with bootloader 1.010 or later for proper multiport usb */

#define MIOS32_UART_NUM 4

\trunk\modules\blm_cheapo\blm_cheapo.c This is where the column drivers port pins are initialised, including the replacement pins of J28 replace
  for(pin=0; pin<8; ++pin)

    MIOS32_BOARD_J5_PinInit(pin, MIOS32_BOARD_PIN_MODE_OUTPUT_PP);	

with


  // initialize all pins of J5A and J5B as outputs in Push-Pull Mode

  //***dug*** 6 and 7 are wired to MIDI IN/OUT3 

  //these signals are generated by J28.SDA and J28.SC, 0, and 1 respectively

#ifdef SEQ4VL_FOUR_MIDI_PORTS  

  for(pin=0; pin<6; ++pin)

    MIOS32_BOARD_J5_PinInit(pin, MIOS32_BOARD_PIN_MODE_OUTPUT_PP);

  MIOS32_BOARD_J28_PinInit(0, MIOS32_BOARD_PIN_MODE_OUTPUT_PP);

  MIOS32_BOARD_J28_PinInit(1, MIOS32_BOARD_PIN_MODE_OUTPUT_PP); 	

#else

  for(pin=0; pin<8; ++pin)

    MIOS32_BOARD_J5_PinInit(pin, MIOS32_BOARD_PIN_MODE_OUTPUT_PP);	

#endif 

insert

#ifdef SEQ4VL_FOUR_MIDI_PORTS  

  //J5 bits 6 and 7 are not initialised for GPIO so have no effect

  MIOS32_BOARD_J28_Set(led_row[selected_row]>>6);//put J5 6,7 into J28 0,1

#endif  

after MIOS32_BOARD_J5_Set(led_row[selected_row]); in s32 BLM_CHEAPO_PrepareCol(void) This drives the replacement pins of J28 of the LED matrix column. \trunk\apps\sequencers\midibox_seq_v4_lite\core\seq_file_hw.c (about line 860) comment out thus:


#elif defined(MIOS32_FAMILY_LPC17xx)

  	for(i=0; i<4; ++i) {

//    	MIOS32_BOARD_J28_PinInit(i, pin_mode);

//    	MIOS32_BOARD_J28_PinSet(i, 0);

  	}

#else

The remaining changes are to stop the J28 now LED matrix pins being driven by the old CV code: \trunk\apps\sequencers\midibox_seq_v4\core\seq_cv.c line 70 in SEQ_CV_Init() change
#elif defined(MIOS32_FAMILY_LPC17xx)

  for(i=0; i<4; ++i)

    MIOS32_BOARD_J28_PinInit(i, MIOS32_BOARD_PIN_MODE_INPUT_PD);

#else

to
#elif defined(MIOS32_FAMILY_LPC17xx)

  for(i=2; i<4; ++i)

    MIOS32_BOARD_J28_PinInit(i, MIOS32_BOARD_PIN_MODE_INPUT_PD);

#else

comment out first 3 calls to MIOS32_BOARD_J28_PinSet in s32 SEQ_CV_Update(void) thus:


#if defined(MIOS32_FAMILY_STM32F10x)

    MIOS32_BOARD_J5_PinSet(9, start_stop);

#elif defined(MIOS32_FAMILY_LPC17xx)

    //MIOS32_BOARD_J28_PinSet(1, start_stop);		***HERE***

#else

# warning "please adapt for this MIOS32_FAMILY"

#endif

  }


  // DIN Sync Pulse at J5C.A8

  if( seq_core_din_sync_pulse_ctr > 1 ) {

#if defined(MIOS32_FAMILY_STM32F10x)

    MIOS32_BOARD_J5_PinSet(8, 1);

#elif defined(MIOS32_FAMILY_LPC17xx)

//    MIOS32_BOARD_J28_PinSet(0, 1);			***HERE***

#else

# warning "please adapt for this MIOS32_FAMILY"

#endif

    --seq_core_din_sync_pulse_ctr;

  } else if( seq_core_din_sync_pulse_ctr == 1 ) {

#if defined(MIOS32_FAMILY_STM32F10x)

    MIOS32_BOARD_J5_PinSet(8, 0);

#elif defined(MIOS32_FAMILY_LPC17xx)

//    MIOS32_BOARD_J28_PinSet(0, 0);			***AND HERE***

#else

# warning "please adapt for this MIOS32_FAMILY"

#endif

Conclusion

That's it!!


Sign in to follow this  
Followers 0


2 Comments


would love to see what your doing on the software side of things with this :D.

 

-ajax

Share this comment


Link to comment
Share on other sites

I've since moved on to SEQ4 (full, with 4 MIDI ports fitted, of course!). 

 

The idea here is to have separate MIDI Ins and outs to each device (synth) so that it is possible to run a separate patch editor for each synth on PC, using the Router functionality to associate multiple USB Ports with different apps/synths. It works!

 

I've since discovered I don't like the patch editor software that much and am putting together hardware based editors based on MIDIbox NG.

So far this approach is shaping up to be brilliant!

Share this comment


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now