Jens M Andreasen wrote:
On Tue, 2005-06-21 at 21:54 -0400, Paul Coccoli
wrote:
The best ALSA MIDI reference I found was
http://www.suse.de/~mana/seqdemo.c
It's an example client that illustrates how to receive MIDI messages.
It should be pretty clear how to add MIDI control after you look at
that code.
I use that one too, but think that the inner switch is perhaps a little
too simplistic to be fully helpful, with missing velocity, aftertouch,
pgmchange and so. After spending some time ploughing through header
files, my adaption of the switch now looks like this:
Thanks to both of you !
I think I'm gonna set up some capture-style configuration, like :
- you click on Tools/Midi capture
- you move your mouse over some widget (a given track's pitch, for ex)
- you move a knob on your hardware controller
- the knob is assigned to the given widget
I think I'll listen for different kind of events, of course
SND_SEQ_EVENT_CONTROLLER, but also PITCHBEND, NOTEON, NOTEOFF, so that one can
even change settings with a midi drumset or keyboard.
Do you think it's ok if I listen to midi events in glib's main loop ? For
example with g_timeout_add() ? Better spawn a thread ?
--
og