MIDI controller guide

From Gentoo Wiki
Jump to:navigation Jump to:search
This article has been flagged as dirty for not conforming to the wiki guidelines. It is now grouped in the list of articles that need formatting improvements.

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 media-sound/timidity++ and media-sound/fluidsynth.



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.

KERNEL Enable support for MIDI devices
Device Drivers  --->
  <*> Sound Card Support  --->
    <*> Advanced Linux Sound Architecture  --->
      <M> Sequencer Support
        <M> Sequencer dummy client
      <M> HR-timer backend support
      [*]  Use HR-Timer as default sequencer timer
(For the PC MIDI/game port)
    [*] Generic sound devices  --->
      (enable any special modules here)
      <M> Generic MPU-401 UART Driver
    [*] USB sound devices
      <M> USB Audio/MIDI driver
      (enable any special modules here)

USE flags

Several packages are aware of the midi 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 euses from app-portage/euses could be used.

user $euses midi

1. TiMidity++


root #emerge --ask timidity timidity-freepats fluid-soundfont


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

user $eselect timidity list
root #eselect timidity set 1

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 /etc/asound.conf.

++defaults.pcm.dmix.rate 48000

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

user $timidity -iAD -B2,8 -Os -EFreverb=0

To see what midi ports are available use aconnect -l

user $aconnect -l

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

user $aconnect $input:0 $output:0

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


Currently broken / TBD

External resources