MIDI controller guide

Midi controllers include a vast assortment of musical equipment including keyboards, pads, pot/fader controls and much more. It is possible to connect these devices via USB and other means to a computer in order to trigger and control sound and video for live performances, recording, and other purposes. There are two programs among many others that can play MIDI as a software synthesizer in Gentoo, these are and.

Kernel
Kernel drivers are usually required for external MIDI controller support such as interfacing with a MIDI keyboard or drum pads. The configuration below are examples for the legacy PC game/MIDI port and through USB, for other more exotic hardware try to find if the specific hardware is in the kernel module list.

USE flags
Several packages are aware of the  USE flag.

There are several USE flags in Gentoo enabling MIDI support for packages, to see a list of some packages which contain USE flags which contain the keyword `midi`, the command from  could be used.

Configuration
List and set the default pat/soundfont that Gentoo will use globally, this can also be set independently per user.

Unfortunately TiMidity++ has difficulties with pulseaudio so it may need to be removed if it is installed. Furthermore once pulseaudio has been removed sound may be blocked when timidity is run as a system service. The solution seems to be that some soundcards require a dmix parameter in. ++defaults.pcm.dmix.rate 48000

The timidity daemon can be run in user mode and need not be a system service.

To see what midi ports are available use aconnect -l

Once you identify the $input and $output ports, typically

At this point aconnect -l should show the connection, you should hear sound when keys are pressed, and other system sounds should mix.

External resources

 * [Wikipedia - MIDI controller]