1) First off, is there a simple GPL library that is
easy to implement
and that focuses on MIDI? If not, any website with some sample code
would be greatly appreciated!
libmidi++, used in ardour but entirely separate from it, does
this. however, its written in C++, and i suspect you will find it
quite confusing since it also makes much use of libsigc++. you may
find useful code there however, since it has a full MIDI parser (based
on the one from keykit) including MMC and MTC.
2) I am trying to design something that is not driver
specific (i.e. OSS
or ALSA), so is there any way to do this (i.e. sending message directly
to /dev/midi device or something similar without blocking it to other
apps)
yes, but not without blocking it to other apps. you can't do this
without being "driver specific", since the non-blocking aspect
requires a design that moves it away from being "raw midi".
3) For checking the presence of the midi interface on a
Linux box, is it
safest to look for /dev/midi device, or is there a "nicer" way?
that will work (for OSS and ALSA).
4) Is there a way to send MIDI data in such a way that
it is perceived
by other app on the system (i.e. like sending a midi signal through
midi-out which is via cable connected to midi-in on the same machine,
except without doing so physically)? If so, how? If not, what are the
alternatives (other than above-mentioned physical solution)?
you can just use a name pipe (FIFO) in the exact same way you use
/dev/midiNN. libmidi++ has support for this.
5) Finally, this may be a bit far-fetched question, but
here it goes
anyhow: does anyone know if Pd and other applications like it are able
to receive simple numeric messages via network (TCP/IP) protocol (since
this would be an alternative to #4)?
i had a recollection that someone had implemented OSC for Pd, but i
may be wrong. OSC would be a much better solution if only a decent
reference implementation of OSC existed.
--p