[alsa-devel] alsa midi tutorial

andy baxter andy at earthsong.free-online.co.uk
Thu Jun 12 18:25:51 CEST 2008


Florian Faber wrote:
> Andy,
>
>   
>> What I want to do is feed drum trigger signals from an arduino board
>> (a usb development board that lets you interface electronics to the
>> computer) to a midi sequencer.
>>     
>
> Why do you need to go through the computer for this? You can use the 
> arduino's serial port to send and receive MIDI commands. It's really 
> simple and there are tons of projects on the web that do exactly that.
>   
OK, but I don't have a hardware sequencer, so I was thinking that it 
would be good to write a small program in C that would translate 
incoming usb serial data from the arduino into midi data, which I could 
then feed into any linux soft synth, sequencer, or whatever.
>   
>> I had a look at the following page from the alsa api reference:
>>
>> http://www.alsa-project.org/alsa-doc/alsa-lib/seq.html
>>
>> but I'm finding it a bit hard to follow - I'm looking for something a
>> bit simpler with code examples to work through that will give me a
>> way in to alsa midi programming.
>>
>> Does anyone know of anything like this?
>>     
>
> No, but that's the wrong page. For sending MIDI data you simply open the 
> device (snd_rawmidi_open) and send your commands (snd_rawmidi_write).
>
>   
OK - I will have a look at the page on rawmidi. I thought at first this 
was a low level interface which you didn't need unless you were doing 
something quite involved which the sequencer interface didn't provide.

andy.

P.S. apologies for not sending my first reply to the list - I'm used to 
lists that set reply-to as the list address.


More information about the Alsa-devel mailing list