goule Posted January 4, 2009 Report Share Posted January 4, 2009 Hi guys,My controller is in MIDI merge mode, so that I can receive and transmit notes from my master keyboard (P60) to the outside world together with my controller MIDI messages.I want to get rid of the realtime MIDI messages that comes out of my P60 and simply ignore them. Those are 'timing clock' (0xf8) and 'active sensing' (0xfe). I've tried this : void MPROC_NotifyReceivedByte(unsigned char byte) __wparam { // This function is called by MIOS when a MIDI byte has been received if ((0xf8 == byte) || (0xfe == byte)) MIOS_MPROC_MergerDisable(); else MIOS_MPROC_MergerEnable(); } The filter works but when I play with the controllers, it seems like it completely messes up the note on / note off messages, and if you keep on playing on the keyboard after a while everything gets back to normal (until you touch the controller again).I suppose this is due to the fact that I should be sure that the message is only 1 byte long before cancelling it ... does anyone know how to do this ? :P Quote Link to comment Share on other sites More sharing options...
audiocommander Posted January 4, 2009 Report Share Posted January 4, 2009 Hi goule :-)I'm not sure if it's a good idea to dis- & enable the merger functionality here?Wouldn't it be better to en- or disable it just once in a setup routine and to simply ignore the bytes here you're not interested in?Because every time, there's a byte received that's not 0xf8 or 0xfe, the merger is set to enabled... that sounds odd to me :-/cheers,Michael Quote Link to comment Share on other sites More sharing options...
stryd_one Posted January 4, 2009 Report Share Posted January 4, 2009 The following error or errors occurred while posting this message:Warning - while you were typing a new reply has been posted. You may wish to review your post. Beaten! Quote Link to comment Share on other sites More sharing options...
goule Posted January 4, 2009 Author Report Share Posted January 4, 2009 Hi folks ! Thanks fro that fast answers ! ;)Wouldn't it be better (...) to simply ignore the bytes here you're not interested in?That's what I need to find : how do you ignore bytes (mean : how not to merge them to the output) without using the MIOS_MPROC_MergerDisable() function ? Quote Link to comment Share on other sites More sharing options...
audiocommander Posted January 4, 2009 Report Share Posted January 4, 2009 either you use the merger as a pre-built functionality (that means: forward all or nothing) - or you have to implement it yourself. That means, you got to do the forwarding on your own. This way you can ignore certain messages.It's another question, why your application should forward certain data while not forwarding certain other data. In general, I'd say this sounds a bit inconsequential (at least looking at it from a user's side of the view) :-) Quote Link to comment Share on other sites More sharing options...
goule Posted January 4, 2009 Author Report Share Posted January 4, 2009 Works like a charm, thank you guys ! void Init(void) __wparam { (...) MIOS_MIDI_MergerSet(MIOS_MIDI_MERGER_DISABLED); (...) } // This function is called by MIOS when a complete MIDI event has been received void MPROC_NotifyReceivedEvnt(unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam { MIOS_MIDI_TxBufferPut(evnt0); MIOS_MIDI_TxBufferPut(evnt1); MIOS_MIDI_TxBufferPut(evnt2); } 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.