Page 2 of 2

Re: Alsa midi input support

Posted: Sat Feb 06, 2021 6:31 pm
by corrados
Unfortunately, the ALSA raw midi interface seems to access the MIDI hardware directly (as far as I understood the documentation). So, I cannot use the aconnect command anymore which I need for my project. Therefore, I changed my code to re-create the raw MIDI message based on the event sequence information of the ALSA MIDI event, where I now also added the CC events. I know that this is not a nice code but it seems to work correctly. I am running out of ideas how to solve this nicely...

Re: Alsa midi input support

Posted: Sat Feb 06, 2021 8:01 pm
by deva
I'm all-in for pragmatic solutions, so if it works I think we should go with that.
I also agree that "locking" the hardware by using direct access to it is something that should be prevented if at all possible.

Since the ev->type is an snd_seq_event_type enum it would probably be cleaner to use switch/case to handle it.
I initially thought that we should then add all the rest of the enum values to cover all possible types, but it seems that the enum list covers a lot more than just the regular midi types, so now I'm not so sure...

Re: Alsa midi input support

Posted: Sun Feb 07, 2021 7:43 am
by corrados
Yes, it makes sense to use a switch/case. I just updated my branch with the change.

Re: Alsa midi input support

Posted: Tue Feb 09, 2021 5:33 pm
by corrados
I consider my ALSA midi implementation as done now. If you like, you could merge my branch corrados_alsamidi it to your alsamidi branch.

Re: Alsa midi input support

Posted: Tue Feb 09, 2021 7:34 pm
by deva
It has been merged to develop now. Great job :-)

Re: Alsa midi input support

Posted: Tue Feb 09, 2021 8:20 pm
by corrados
Thanks. I don't know why (maybe a merge issue) but if I look at the following commit: http://git.drumgizmo.org/drumgizmo.git/ ... 8198525eb6, the include is doubled which is incorrect:

+#ifdef HAVE_INPUT_ALSAMIDI
+#include "input/alsamidi.h"
+#endif

Can you please remove one of them or should I do that?

Re: Alsa midi input support

Posted: Wed Feb 10, 2021 3:22 pm
by deva
I'm thinking we can remove it if/when other changes are being made to that same file?