smc Posted July 24, 2011 Report Share Posted July 24, 2011 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 Quote Link to comment Share on other sites More sharing options...
TK. Posted July 24, 2011 Report Share Posted July 24, 2011 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). You could use a second PIC to scan DINs... but today the most elegant solution would be to use the module (or a downstripped version built on veroboard) 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 [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. Quote Link to comment Share on other sites More sharing options...
smc Posted July 25, 2011 Author Report Share Posted July 25, 2011 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.