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. This article will only focus on timidity++.

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, the command  from  could be used.

Emerge
Install  with:

optionally, install the additional  with:

Configuration
The available patchsets can be queried using :

As an example, to set the  as the default patchset for the current user:

Starting the daemon
The timidity daemon can be run in user mode and need not be a system service:

Connecting midi ports
To begin using the midi controller, a midi input port must be connected to an output port. To see which input ports are available:

the above is an example of what the output may look like. Here the midi controller is a Native Instruments Komplete Kontrol A49.

Similarly, to see which output ports are available:

To connect directly to Timidity, use the following command:

The connection can be verified using:

If all went well, pressing a key on the midi controller should play a sound. This sound will depend on which timidity patchset is enabled using.

To remove all connections, use:

Milkytracker
To use a midi controller with Milkytracker, the package  is required. This package is not available in the official Gentoo repository, but can be found in several community overlays. Once  has been installed, verify that the midi port is available:

Once a midi controller has been connected to this port, Milkytracker will automatically recognize the controller.

Testing midi controller keys
If for some reason midi controller input is not producing any output, physical device failure can be ruled out using  from. First, identify the port of the midi controller:

then run the following:

where  is the port of the midi controller. Pressing any key on the controller should show up in the stdout. If no output is displayed, assuming the correct port was used, physical hardware failure may be to blame.

Pulseaudio
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 :

External resources

 * Wikipedia - MIDI controller