Merge Projects to include DIN

Hi all,

I need to modify the Merger project to include 24 DIN’s. I guess a better way was to include the MIOS sw. But I found it rather difficult to adapt the existing Merger code with the MIOS. What would be an easiest approach?. Should I use the ROUTER project instead? But I looked at it already & found it to be over designed for my needs. Or can you basically, suggest I way to build an assigned DIN template around the existing MERGE project, I guess for me this will be the ideal way.

Best regards

SMC

This won’t work, because the PIC based merger emulates the second MIDI IN via software, which requires low interrupt latencies. No chance to add the MIOS based SRIO driver, the PIC architecture is too slow (or you would need some really good assembly skills to manage this).

http://discourse.midibox.org/t/topic/15558

This tutorial demonstrates, how to route MIDI events: http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Ftutorials%2F001_forwarding_midi%2F&#

With following code in app.c:

void APP_MIDI_NotifyPackage(mios32_midi_port_t port, mios32_midi_package_t midi_package)
{
// toggle Status LED on each incoming MIDI package
MIOS32_BOARD_LED_Set(1, ~MIOS32_BOARD_LED_Get());

switch( port ) {
case UART0: MIOS32_MIDI_SendPackage(UART0, midi_package); break;
case UART1: MIOS32_MIDI_SendPackage(UART0, midi_package); break;
}
}
[/code]




you would route incoming events from MIDI1 and MIDI2 to the MIDI1 output



The SRIO driver is already running in background.

Following example demonstrates, how to handle DIN events:[http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Ftutorials%2F010\_din%2F](http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Ftutorials%2F010_din%2F)
[code]  
void APP\_DIN\_NotifyToggle(u32 pin, u32 pin\_value)  
{  
 // toggle Status LED on each DIN pin change  
 MIOS32\_BOARD\_LED\_Set(1, ~MIOS32\_BOARD\_LED\_Get());  
  
 // send MIDI event  
 MIOS32\_MIDI\_SendNoteOn(DEFAULT, Chn1, (pin + MIDI\_STARTNOTE) & 0x7f, pin\_value ? 0x00 : 0x7f);  
}  

As you can see: there is no need to spend time on the old PIC platform anymore, because the new platform simplifies a lot.

Best Regards, Thorsten.

Hi Thorsten,

It definitely looks like a reasonable alternative to try out. However, since I have quite a few 18f452 pics laying around at home, I could at least take the option of using it to scan DIN or perhaps, I could revisit the router code again & modify it to suit my application.

Thanks again.

Best Regards

smc