This guide to programming with MIDI I/O in Linux is based on the OSS/Free soundcard drivers which comes with most Linux releases. See http://www.4front-tech.com for the lastest version and more info.
You must first install a soundcard with a MIDI interface. In Red Hat 5.2 package of Linux there is an easy program called sndconfig which will help you set up the soundcard with the proper IRQ's, DMA's and such.
Now that you have set up your soundcard and have it working ;-), you can type the command:
cat /dev/sndstatThe above command will print out the status of the soundcard drivers on your system. Check to see if there are any MIDI/Synth devices available. For example, here is what my system displays:
OSS/Linux 3.9e (C) 4Front Technologies 1996-1998 Kernel: Linux cmn36 2.0.33 #1 Thu Jun 11 15:10:55 PDT 1998 i686 Build: 2.0.33 Card config: Ensoniq AudioPCI Generic PnP support SoundBlaster AWE64 Gold at 0x220 irq 5 drq 1,5 Emu 8000 Synthesizer Engine at 0x620 irq 5 drq 1,5 OPL-2/OPL-3 FM at 0x388 SB MPU-401 at 0x330 irq 5 Audio devices: 0: Ensoniq AudioPCI (DUPLEX) 1: Ensoniq AudioPCI (playback only) 2: Creative SB AWE64 Gold (4.16) (DUPLEX) 3: SB secondary device (DUPLEX) Synth devices: 0: AWE32-0.4.2 (RAM4096k) 1: Yamaha OPL-3 Midi devices: 0: AudioPCI 1: Sound Blaster 16 Timers: 0: System clock Mixers: 0: Ensoniq AudioPCI 1: Sound Blaster 2: AWE32 EqualizerThe above display shows that the computer I am working on has two External MIDI devices which should be able to handle MIDI I/O, and two soundcard synthesizers which can accept MIDI input.