[http://tedfelix.com/linux/linux-midi.html]
[https://wiki.archlinux.org/index.php/USB_MIDI_keyboards]
CONTENTS
A. Summary
B. Download and install
C. Check midi port numbers
D. Jack audio server
E. Fluidsynth
F. Connect physical and virtual Midi devices
G. Bristol
X. Troubleshooting
A. SUMMARY
Midi works with port numbers that you 'connect' to eachother. Alsa provides the driver for Midi (as well as for your sound card). Jack is a server on top of Alsa which must be used as if it was your sound card driver (for low latency). Fluidsynth behaves like a Midi synthesizer/device (a 'softsynth'). One connects an inputdevice (likea physical Midi keyboard) to an outputdevice (like the softsynth) w/ aconnect. Bristol is a standlone application that emulates various classic analogue synthesizers which you can play with your typing keyboard. But you can also use a Midi keyboard and assign buttons etc. from said Midi keyboard to Bristol's ones.
B. DOWNLOAD AND INSTALL
1. Download a midi file (ex.: song.mid).
2. Download a sound font (ex.: soundfont.sf2)
3. Download a wav file (ex.: test.wav). Or make one yourself with: sox -b 16 -n test.wav rate 44100 channels 2 synth 1 sine 440)
4. Disable pulseaudio:
Code: Select all
sudo mv ~/.pulse ~/.pulse-backup
sudo rm -rf ~/.pulse
Code: Select all
autospawn = no
daemon-binary =/bin/true
Code: Select all
pulseaudio --start
6. Install patchage
7. Install aconnectgui
C. Check midi port numbers
1. cat /proc/asound/cards
~~~~~~~~~~~~~~~~~~~~~~~~~
Code: Select all
0 [CMI8738 ]: CMI8738-MC6 - C-Media CMI8738
C-Media CMI8738 (model 55) at 0xd000, irq 20
1 [PCH ]: HDA-Intel - HDA Intel PCH
HDA Intel PCH at 0xf7c10000 irq 45
2 [v2 ]: USB-Audio - USB Oxygen 8 v2
M-Audio USB Oxygen 8 v2 at usb-0000:00:1a.0-1.1, full speed
2. aplaymidi -l
~~~~~~~~~~~~~~~
Code: Select all
Port Client name Port name
14:0 Midi Through Midi Through Port-0
16:0 C-Media CMI8738 C-Media CMI8738 MIDI
17:0 OPL3 FM synth OPL3 FM Port
24:0 USB Oxygen 8 v2 USB Oxygen 8 v2 MIDI 1
128:0 FLUID Synth (3726) Synth input port (3726:0)
D. Jack audio server
1. Start jack daemon
~~~~~~~~~~~~~~~~~~~~
Code: Select all
jackd -d alsa --device hw:0 --rate 44100 --period 128
Code: Select all
jackd -d alsa --device hw:0
~~~~~~~~~~~~
Make sure the Jack daemon is running and:
Code: Select all
export JACK_PLAY_CONNECT_TO=system:playback_%d
Code: Select all
jack.play test.wav
E. Fluidsynth
1. Test
Code: Select all
fluidsynth --audio-driver=alsa -o audio.alsa.device=hw:0 soundfont.sf2 song.mid
Code: Select all
fluidsynth --server --audio-driver=alsa -o audio.alsa.device=hw:0 soundfont.sf2
Code: Select all
fluidsynth --server --audio-driver=jack --connect-jack-outputs soundfont.sf2
Determine fluidsynth's Midi port mumber with:
Code: Select all
aplaymidi -l
Code: Select all
aplaymidi -p 128:0 song.mid
F. Connect physical and virtual Midi devices
1. Determine the Midi port number of your input device. Type in a terminal:
Code: Select all
aconnect -i
Code: Select all
client 24: 'USB Oxygen 8 v2' [type=kernel]
0 'USB Oxygen 8 v2 MIDI 1'
Which means that the Midi port number of the Oxgen keyboard is 24.
2. Determine output device Midi port
Code: Select all
aconnect -o
client 128: 'FLUID Synth (11332)' [type=user]
0 'Synth input port (11332:0)'
Code: Select all
aconnect 24 128
Code: Select all
aconnect 24:0 128:0
G. BRISTOL
1. Start Jack:
Code: Select all
jackd -d alsa --device hw:0
3. Configure > Easy mode > radio button 'Jack' > checkbox 'Jack auto connect'.
Click 'Apply'!
4. Use (your regular typing) keyboard for playing notes.
Midi:
5. Configure > Advanced mode > Midi driver: alsa
Click 'Apply'!
6. 'aconnect -o' will show that Bristol has Midi port number 128.
7. 'aconnect 24 128' (you can check w/: aconnectgui).
8. Assign buttons from your (hardware) Midi keyboard to Bristol's software ones by middle clicking on them in the GUI.
9. Bristol is (very) querky. If it don't work: restart monoBristol.
X. TROUBELSHOOTING
1. Watch midi keyboard output:
Code: Select all
aseqdump -p 24
Code: Select all
aconnect -i