个人工具

“UbuntuHelp:MidiHardwareSynthesisSetup”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第2行: 第2行:
 
{{Languages|UbuntuHelp:MidiHardwareSynthesisSetup}}
 
{{Languages|UbuntuHelp:MidiHardwareSynthesisSetup}}
 
Use this guide to setup your MIDI synth, if you have a soundcard with hardware MIDI synthesis capability (see SoundcardsWithHardwareSynth )
 
Use this guide to setup your MIDI synth, if you have a soundcard with hardware MIDI synthesis capability (see SoundcardsWithHardwareSynth )
 
 
Please be absolutely sure you have a soundcard with hardware MIDI synthesis capability before you following any of the instructions here! If you haven't, refer to MidiSoftwareSynthesisHowTo instead.
 
Please be absolutely sure you have a soundcard with hardware MIDI synthesis capability before you following any of the instructions here! If you haven't, refer to MidiSoftwareSynthesisHowTo instead.
 
 
=== For Sound Blaster Live/Audigy ===
 
=== For Sound Blaster Live/Audigy ===
 
 
First, let's check if the required kernel modules are loaded. In my experience, all releases of Ubuntu after Hoary will have the kernel modules loaded already.  
 
First, let's check if the required kernel modules are loaded. In my experience, all releases of Ubuntu after Hoary will have the kernel modules loaded already.  
 
 
Open a terminal and issue this command:
 
Open a terminal and issue this command:
 
<pre><nowiki>
 
<pre><nowiki>
 
aplaymidi -l
 
aplaymidi -l
 
</nowiki></pre>
 
</nowiki></pre>
 
 
If you see something similar to this:
 
If you see something similar to this:
 
<pre><nowiki>
 
<pre><nowiki>
第28行: 第23行:
 
gksudo gedit /etc/modules
 
gksudo gedit /etc/modules
 
</nowiki></pre>
 
</nowiki></pre>
 
 
When prompted, enter your password. Now, at the end of the file, add this:
 
When prompted, enter your password. Now, at the end of the file, add this:
 
<pre><nowiki>
 
<pre><nowiki>
第38行: 第32行:
 
</nowiki></pre>
 
</nowiki></pre>
 
(You may not need all of these... I have found it to work with just the first three.)
 
(You may not need all of these... I have found it to work with just the first three.)
 
 
Then save and exit gedit. Now, at the terminal, issue this command:
 
Then save and exit gedit. Now, at the terminal, issue this command:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo modprobe -a snd-seq snd-seq-device snd-seq-midi snd-seq-oss snd-seq-midi-event
 
sudo modprobe -a snd-seq snd-seq-device snd-seq-midi snd-seq-oss snd-seq-midi-event
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Then, we need to install the package "awesfx". You will need the universe and multiverse repositories enabled; for help on that please refer to AddingRepositoriesHowto
 
Then, we need to install the package "awesfx". You will need the universe and multiverse repositories enabled; for help on that please refer to AddingRepositoriesHowto
 
 
Issue the following command into a terminal:
 
Issue the following command into a terminal:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo aptitude install awesfx
 
sudo aptitude install awesfx
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Now, we need a soundfont. If you have windows installed on this machine, you can retrieve 2gmgsmt.sf2 from the windows/system32/drivers/ folder. Else, you can get a soundfont from the internet.  
 
Now, we need a soundfont. If you have windows installed on this machine, you can retrieve 2gmgsmt.sf2 from the windows/system32/drivers/ folder. Else, you can get a soundfont from the internet.  
 
 
For help getting soundfonts from the internet:
 
For help getting soundfonts from the internet:
 
Websites: http://www.personalcopy.com (try Unison.sf2) http://www.hammersound.net/ or look up soundfonts in a search engine. A big list may be found at http://timidity.s11.xrea.com/files/readme_cfgp.htm in which the fifth soundfont from the top (SGM-whatever) is quite complete for general use with TiMidity++.
 
Websites: http://www.personalcopy.com (try Unison.sf2) http://www.hammersound.net/ or look up soundfonts in a search engine. A big list may be found at http://timidity.s11.xrea.com/files/readme_cfgp.htm in which the fifth soundfont from the top (SGM-whatever) is quite complete for general use with TiMidity++.
 
 
If you end up with a file ending with .sfArk, it's compressed in an annoying proprietary format. You may need a windows machine to decompress it, depending which version they've used. Details at http://melodymachine.com/sfark.htm There is a Linux version available on the website.
 
If you end up with a file ending with .sfArk, it's compressed in an annoying proprietary format. You may need a windows machine to decompress it, depending which version they've used. Details at http://melodymachine.com/sfark.htm There is a Linux version available on the website.
 
 
Now, once you've got a soundfont, issue this command at the terminal:
 
Now, once you've got a soundfont, issue this command at the terminal:
 
<pre><nowiki>
 
<pre><nowiki>
 
sfxload file.sf2
 
sfxload file.sf2
 
</nowiki></pre>
 
</nowiki></pre>
 
 
And now, you're ready to listen to some midi files. If you need a MIDI file to test this with, here's a short one: http://www.webpost.net/av/avatarmaster/patricksworld.mid
 
And now, you're ready to listen to some midi files. If you need a MIDI file to test this with, here's a short one: http://www.webpost.net/av/avatarmaster/patricksworld.mid
 
 
Now, type "aplaymidi -l" in the terminal. This will tell you the ALSA MIDI port number for the synth. In my experience on all versions of Ubuntu before Edgy, it is 65:0. On Edgy, it is 17:0.
 
Now, type "aplaymidi -l" in the terminal. This will tell you the ALSA MIDI port number for the synth. In my experience on all versions of Ubuntu before Edgy, it is 65:0. On Edgy, it is 17:0.
 
 
In the output of "aplaymidi -l", you should see something similar to this:
 
In the output of "aplaymidi -l", you should see something similar to this:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
62:0    Midi Through                    Midi Through Port-0
 
62:0    Midi Through                    Midi Through Port-0
第78行: 第60行:
 
65:3    Emu10k1 WaveTable                Emu10k1 Port 3
 
65:3    Emu10k1 WaveTable                Emu10k1 Port 3
 
</nowiki></pre>
 
</nowiki></pre>
 
 
As you see, it tells you the port number for the emu10k1 wavetable, which is what will play your MIDI.
 
As you see, it tells you the port number for the emu10k1 wavetable, which is what will play your MIDI.
 
 
At the terminal, do this:
 
At the terminal, do this:
 
<pre><nowiki>
 
<pre><nowiki>
第86行: 第66行:
 
</nowiki></pre>
 
</nowiki></pre>
 
(where 65:0 is the port number that aplaymidi -l reports to you, and file.mid is the filename of the midi file you want to play
 
(where 65:0 is the port number that aplaymidi -l reports to you, and file.mid is the filename of the midi file you want to play
 
 
You should be hearing wonderful synthesized music.
 
You should be hearing wonderful synthesized music.
 
 
=== For Sound Blaster Awe64 (and probably also Awe32) ===
 
=== For Sound Blaster Awe64 (and probably also Awe32) ===
 
 
First, let's check if the required kernel modules are loaded.
 
First, let's check if the required kernel modules are loaded.
 
 
Open a terminal and issue this command:
 
Open a terminal and issue this command:
 
<pre><nowiki>
 
<pre><nowiki>
 
aplaymidi -l
 
aplaymidi -l
 
</nowiki></pre>
 
</nowiki></pre>
 
 
If you see something similar to this:
 
If you see something similar to this:
 
<pre><nowiki>
 
<pre><nowiki>
第112行: 第87行:
 
gksudo gedit /etc/modules
 
gksudo gedit /etc/modules
 
</nowiki></pre>
 
</nowiki></pre>
 
 
When prompted, enter your password. Now, at the end of the file, add this:
 
When prompted, enter your password. Now, at the end of the file, add this:
 
<pre><nowiki>
 
<pre><nowiki>
第118行: 第92行:
 
snd-emu8000-synth
 
snd-emu8000-synth
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Then save and exit gedit. Now, at the terminal, issue this command:
 
Then save and exit gedit. Now, at the terminal, issue this command:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo modprobe -a snd-sbawe snd-emu8000-synth
 
sudo modprobe -a snd-sbawe snd-emu8000-synth
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Then, we need to install the package "awesfx". You will need the universe and multiverse repositories enabled; for help on that please refer to AddingRepositoriesHowto
 
Then, we need to install the package "awesfx". You will need the universe and multiverse repositories enabled; for help on that please refer to AddingRepositoriesHowto
 
 
Issue the following command into a terminal:
 
Issue the following command into a terminal:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo aptitude install awesfx
 
sudo aptitude install awesfx
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Now, we need a soundfont. If you have windows installed on this machine, you can retrieve 2gmgsmt.sf2 from the windows/system32/drivers/ folder. Else, you can get a soundfont from the internet.  
 
Now, we need a soundfont. If you have windows installed on this machine, you can retrieve 2gmgsmt.sf2 from the windows/system32/drivers/ folder. Else, you can get a soundfont from the internet.  
 
 
For help getting soundfonts from the internet:
 
For help getting soundfonts from the internet:
 
Websites: http://www.personalcopy.com (try Unison.sf2) http://www.hammersound.net/ or look up soundfonts in a search engine. A big list may be found at http://timidity.s11.xrea.com/files/readme_cfgp.htm in which the fifth soundfont from the top (SGM-whatever) is quite complete for general use with TiMidity++.
 
Websites: http://www.personalcopy.com (try Unison.sf2) http://www.hammersound.net/ or look up soundfonts in a search engine. A big list may be found at http://timidity.s11.xrea.com/files/readme_cfgp.htm in which the fifth soundfont from the top (SGM-whatever) is quite complete for general use with TiMidity++.
 
 
If you end up with a file ending with .sfArk, it's compressed in an annoying proprietary format. You may need a windows machine to decompress it, depending which version they've used. Details at http://melodymachine.com/sfark.htm There is a Linux version available on the website.
 
If you end up with a file ending with .sfArk, it's compressed in an annoying proprietary format. You may need a windows machine to decompress it, depending which version they've used. Details at http://melodymachine.com/sfark.htm There is a Linux version available on the website.
 
 
You are advised to choose a small soundfont. Some models in the Sound Blaster Awe series have only 512 kByte of soundfont memory...
 
You are advised to choose a small soundfont. Some models in the Sound Blaster Awe series have only 512 kByte of soundfont memory...
 
 
Now, once you've got a soundfont, issue this command at the terminal:
 
Now, once you've got a soundfont, issue this command at the terminal:
 
<pre><nowiki>
 
<pre><nowiki>
 
sfxload file.sf2
 
sfxload file.sf2
 
</nowiki></pre>
 
</nowiki></pre>
 
 
And now, you're ready to listen to some midi files. If you need a MIDI file to test this with, here's a short one: http://www.webpost.net/av/avatarmaster/patricksworld.mid
 
And now, you're ready to listen to some midi files. If you need a MIDI file to test this with, here's a short one: http://www.webpost.net/av/avatarmaster/patricksworld.mid
 
 
Now, type "aplaymidi -l" in the terminal. This will tell you the ALSA MIDI port number for the synth. In my experience on all versions of Ubuntu before Edgy, it is 65:0. On Edgy, it is 17:0.
 
Now, type "aplaymidi -l" in the terminal. This will tell you the ALSA MIDI port number for the synth. In my experience on all versions of Ubuntu before Edgy, it is 65:0. On Edgy, it is 17:0.
 
 
In the output of "aplaymidi -l", you should see something similar to this:
 
In the output of "aplaymidi -l", you should see something similar to this:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
Port    Client name                      Port name
 
Port    Client name                      Port name
第161行: 第122行:
 
17:3    Emu8000 WaveTable                Emu8000 Port 3
 
17:3    Emu8000 WaveTable                Emu8000 Port 3
 
</nowiki></pre>
 
</nowiki></pre>
 
 
As you see, it tells you the port number for the emu8000 wavetable, which is what will play your MIDI.
 
As you see, it tells you the port number for the emu8000 wavetable, which is what will play your MIDI.
 
 
At the terminal, do this:
 
At the terminal, do this:
 
<pre><nowiki>
 
<pre><nowiki>
第169行: 第128行:
 
</nowiki></pre>
 
</nowiki></pre>
 
(where 17:0 is the port number that aplaymidi -l reports to you, and file.mid is the filename of the midi file you want to play
 
(where 17:0 is the port number that aplaymidi -l reports to you, and file.mid is the filename of the midi file you want to play
 
 
You should be hearing wonderful synthesized music.
 
You should be hearing wonderful synthesized music.
 
 
=== For Soundcards with OPL3 FM synth ===
 
=== For Soundcards with OPL3 FM synth ===
 
 
Some older soundcards (from around 1995 or so, I think) had the OPL3 chip on them for MIDI synthesis.  
 
Some older soundcards (from around 1995 or so, I think) had the OPL3 chip on them for MIDI synthesis.  
 
http://en.wikipedia.org/wiki/Yamaha_YMF262
 
http://en.wikipedia.org/wiki/Yamaha_YMF262
第180行: 第136行:
 
But if you still want to get it working anyway, here is this guide.
 
But if you still want to get it working anyway, here is this guide.
 
''NOTE: This can only apply to Dapper, and versions of Ubuntu after Dapper, since older ones do not have a package that we need in their repositories; alsa-tools.''
 
''NOTE: This can only apply to Dapper, and versions of Ubuntu after Dapper, since older ones do not have a package that we need in their repositories; alsa-tools.''
 
 
First, let us load the modules needed.
 
First, let us load the modules needed.
 
Open a terminal and run this command:
 
Open a terminal and run this command:
第186行: 第141行:
 
sudo modprobe -a snd-seq snd-seq-device snd-seq-midi snd-seq-oss snd-seq-midi-event snd-opl3-synth
 
sudo modprobe -a snd-seq snd-seq-device snd-seq-midi snd-seq-oss snd-seq-midi-event snd-opl3-synth
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Now, run this command:
 
Now, run this command:
 
<pre><nowiki>
 
<pre><nowiki>
第200行: 第154行:
 
</nowiki></pre>
 
</nowiki></pre>
 
Note the "OPL3 FM synth" part. That should be in the output. If it isn't, then you don't have a soundcard that has the OPL3 FM chip on it, so stop following this guide. If it is, you do indeed have the OPL3 FM chip; so continue following this guide.
 
Note the "OPL3 FM synth" part. That should be in the output. If it isn't, then you don't have a soundcard that has the OPL3 FM chip on it, so stop following this guide. If it is, you do indeed have the OPL3 FM chip; so continue following this guide.
 
 
Now you need to make the required modules load at boot. To do this, issue this command at the terminal:
 
Now you need to make the required modules load at boot. To do this, issue this command at the terminal:
 
<pre><nowiki>
 
<pre><nowiki>
 
gksudo gedit /etc/modules
 
gksudo gedit /etc/modules
 
</nowiki></pre>
 
</nowiki></pre>
 
 
When prompted, enter your password. Now, at the end of the file, add this:
 
When prompted, enter your password. Now, at the end of the file, add this:
 
<pre><nowiki>
 
<pre><nowiki>
第216行: 第168行:
 
</nowiki></pre>
 
</nowiki></pre>
 
Then save the changes and exit gedit.
 
Then save the changes and exit gedit.
 
 
Now, we need to install the package "alsa-tools". You may need the multiverse and universe repositories enabled for this. If you haven't got them enabled and need help doing that, please refer to AddingRepositoriesHowto
 
Now, we need to install the package "alsa-tools". You may need the multiverse and universe repositories enabled for this. If you haven't got them enabled and need help doing that, please refer to AddingRepositoriesHowto
 
 
Run this command in the terminal.
 
Run this command in the terminal.
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo aptitude install alsa-tools
 
sudo aptitude install alsa-tools
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Now, we are ready to load the instrument patches for it.
 
Now, we are ready to load the instrument patches for it.
 
 
Run this command in the terminal:
 
Run this command in the terminal:
 
<pre><nowiki>
 
<pre><nowiki>
第231行: 第179行:
 
</nowiki></pre>
 
</nowiki></pre>
 
Please note, the port number (shown here as 17:0) may differ for you. Check the output of aplaymidi -l to make sure what the port number for the OPL3 is on your system.
 
Please note, the port number (shown here as 17:0) may differ for you. Check the output of aplaymidi -l to make sure what the port number for the OPL3 is on your system.
 
 
Once that is done, we're ready to test it out. Here is a MIDI file to test it with: http://www.webpost.net/av/avatarmaster/patricksworld.mid
 
Once that is done, we're ready to test it out. Here is a MIDI file to test it with: http://www.webpost.net/av/avatarmaster/patricksworld.mid
 
 
Now, run this command in the terminal:
 
Now, run this command in the terminal:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
aplaymidi -p 17:0 file.mid
 
aplaymidi -p 17:0 file.mid
第241行: 第186行:
 
Remember, the port number might be different for you. Check the output of aplaymidi -l to make sure which one.
 
Remember, the port number might be different for you. Check the output of aplaymidi -l to make sure which one.
 
If you can't hear anything, run "alsamixer" in a terminal and make sure the "synth" mixer item is not muted or set to a volume level of 0 or something.
 
If you can't hear anything, run "alsamixer" in a terminal and make sure the "synth" mixer item is not muted or set to a volume level of 0 or something.
 
 
If it all worked, you should be hearing some tinny old synth noises.
 
If it all worked, you should be hearing some tinny old synth noises.
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 20:16的版本

Use this guide to setup your MIDI synth, if you have a soundcard with hardware MIDI synthesis capability (see SoundcardsWithHardwareSynth ) Please be absolutely sure you have a soundcard with hardware MIDI synthesis capability before you following any of the instructions here! If you haven't, refer to MidiSoftwareSynthesisHowTo instead.

For Sound Blaster Live/Audigy

First, let's check if the required kernel modules are loaded. In my experience, all releases of Ubuntu after Hoary will have the kernel modules loaded already. Open a terminal and issue this command:

aplaymidi -l

If you see something similar to this:

Port    Client name                      Port name
62:0    Midi Through                     Midi Through Port-0
64:0    EMU10K1 MPU-401 (UART)           EMU10K1 MPU-401 (UART)
65:0    Emu10k1 WaveTable                Emu10k1 Port 0
65:1    Emu10k1 WaveTable                Emu10k1 Port 1
65:2    Emu10k1 WaveTable                Emu10k1 Port 2
65:3    Emu10k1 WaveTable                Emu10k1 Port 3

It means that the required modules are loaded and you can skip this step. Else, we need to make the required modules load at boot. To do this, issue this command at the terminal:

gksudo gedit /etc/modules

When prompted, enter your password. Now, at the end of the file, add this:

snd-seq
snd-seq-device
snd-seq-midi
snd-seq-oss
snd-seq-midi-event

(You may not need all of these... I have found it to work with just the first three.) Then save and exit gedit. Now, at the terminal, issue this command:

sudo modprobe -a snd-seq snd-seq-device snd-seq-midi snd-seq-oss snd-seq-midi-event

Then, we need to install the package "awesfx". You will need the universe and multiverse repositories enabled; for help on that please refer to AddingRepositoriesHowto Issue the following command into a terminal:

sudo aptitude install awesfx

Now, we need a soundfont. If you have windows installed on this machine, you can retrieve 2gmgsmt.sf2 from the windows/system32/drivers/ folder. Else, you can get a soundfont from the internet. For help getting soundfonts from the internet: Websites: http://www.personalcopy.com (try Unison.sf2) http://www.hammersound.net/ or look up soundfonts in a search engine. A big list may be found at http://timidity.s11.xrea.com/files/readme_cfgp.htm in which the fifth soundfont from the top (SGM-whatever) is quite complete for general use with TiMidity++. If you end up with a file ending with .sfArk, it's compressed in an annoying proprietary format. You may need a windows machine to decompress it, depending which version they've used. Details at http://melodymachine.com/sfark.htm There is a Linux version available on the website. Now, once you've got a soundfont, issue this command at the terminal:

sfxload file.sf2

And now, you're ready to listen to some midi files. If you need a MIDI file to test this with, here's a short one: http://www.webpost.net/av/avatarmaster/patricksworld.mid Now, type "aplaymidi -l" in the terminal. This will tell you the ALSA MIDI port number for the synth. In my experience on all versions of Ubuntu before Edgy, it is 65:0. On Edgy, it is 17:0. In the output of "aplaymidi -l", you should see something similar to this:

62:0    Midi Through                     Midi Through Port-0
64:0    EMU10K1 MPU-401 (UART)           EMU10K1 MPU-401 (UART)
65:0    Emu10k1 WaveTable                Emu10k1 Port 0
65:1    Emu10k1 WaveTable                Emu10k1 Port 1
65:2    Emu10k1 WaveTable                Emu10k1 Port 2
65:3    Emu10k1 WaveTable                Emu10k1 Port 3

As you see, it tells you the port number for the emu10k1 wavetable, which is what will play your MIDI. At the terminal, do this:

aplaymidi -p 65:0 file.mid

(where 65:0 is the port number that aplaymidi -l reports to you, and file.mid is the filename of the midi file you want to play You should be hearing wonderful synthesized music.

For Sound Blaster Awe64 (and probably also Awe32)

First, let's check if the required kernel modules are loaded. Open a terminal and issue this command:

aplaymidi -l

If you see something similar to this:

Port    Client name                      Port name
14:0    Midi Through                     Midi Through Port-0
16:0    Sound Blaster 16                 Sound Blaster 16 MIDI
17:0    Emu8000 WaveTable                Emu8000 Port 0
17:1    Emu8000 WaveTable                Emu8000 Port 1
17:2    Emu8000 WaveTable                Emu8000 Port 2
17:3    Emu8000 WaveTable                Emu8000 Port 3

It means that the required modules are loaded and you can skip this step. Else, we need to make the required modules load at boot. To do this, issue this command at the terminal:

gksudo gedit /etc/modules

When prompted, enter your password. Now, at the end of the file, add this:

snd-sbawe
snd-emu8000-synth

Then save and exit gedit. Now, at the terminal, issue this command:

sudo modprobe -a snd-sbawe snd-emu8000-synth

Then, we need to install the package "awesfx". You will need the universe and multiverse repositories enabled; for help on that please refer to AddingRepositoriesHowto Issue the following command into a terminal:

sudo aptitude install awesfx

Now, we need a soundfont. If you have windows installed on this machine, you can retrieve 2gmgsmt.sf2 from the windows/system32/drivers/ folder. Else, you can get a soundfont from the internet. For help getting soundfonts from the internet: Websites: http://www.personalcopy.com (try Unison.sf2) http://www.hammersound.net/ or look up soundfonts in a search engine. A big list may be found at http://timidity.s11.xrea.com/files/readme_cfgp.htm in which the fifth soundfont from the top (SGM-whatever) is quite complete for general use with TiMidity++. If you end up with a file ending with .sfArk, it's compressed in an annoying proprietary format. You may need a windows machine to decompress it, depending which version they've used. Details at http://melodymachine.com/sfark.htm There is a Linux version available on the website. You are advised to choose a small soundfont. Some models in the Sound Blaster Awe series have only 512 kByte of soundfont memory... Now, once you've got a soundfont, issue this command at the terminal:

sfxload file.sf2

And now, you're ready to listen to some midi files. If you need a MIDI file to test this with, here's a short one: http://www.webpost.net/av/avatarmaster/patricksworld.mid Now, type "aplaymidi -l" in the terminal. This will tell you the ALSA MIDI port number for the synth. In my experience on all versions of Ubuntu before Edgy, it is 65:0. On Edgy, it is 17:0. In the output of "aplaymidi -l", you should see something similar to this:

Port    Client name                      Port name
14:0    Midi Through                     Midi Through Port-0
16:0    Sound Blaster 16                 Sound Blaster 16 MIDI
17:0    Emu8000 WaveTable                Emu8000 Port 0
17:1    Emu8000 WaveTable                Emu8000 Port 1
17:2    Emu8000 WaveTable                Emu8000 Port 2
17:3    Emu8000 WaveTable                Emu8000 Port 3

As you see, it tells you the port number for the emu8000 wavetable, which is what will play your MIDI. At the terminal, do this:

aplaymidi -p 17:0 file.mid

(where 17:0 is the port number that aplaymidi -l reports to you, and file.mid is the filename of the midi file you want to play You should be hearing wonderful synthesized music.

For Soundcards with OPL3 FM synth

Some older soundcards (from around 1995 or so, I think) had the OPL3 chip on them for MIDI synthesis. http://en.wikipedia.org/wiki/Yamaha_YMF262 If you have an old pentium computer, or a PCI soundcard that came from an old Pentium computer, it may have the OPL3 chip on it, so you can use it for MIDI synthesis. However, it doesn't sound very good. The instrument sounds are very synthetic and only about 7 sounds can be played at one time. You might as well just go and set up Software MIDI synthesis. But if you still want to get it working anyway, here is this guide. NOTE: This can only apply to Dapper, and versions of Ubuntu after Dapper, since older ones do not have a package that we need in their repositories; alsa-tools. First, let us load the modules needed. Open a terminal and run this command:

sudo modprobe -a snd-seq snd-seq-device snd-seq-midi snd-seq-oss snd-seq-midi-event snd-opl3-synth

Now, run this command:

aplaymidi -l

It should tell you something similar to this:

Port    Client name                      Port name
14:0    Midi Through                     Midi Through Port-0
16:0    Avance Logic ALS4000             Avance Logic ALS4000 MIDI
17:0    OPL3 FM synth                    OPL3 FM Port
20:0    MPU-401 UART                     MPU-401 UART MIDI

Note the "OPL3 FM synth" part. That should be in the output. If it isn't, then you don't have a soundcard that has the OPL3 FM chip on it, so stop following this guide. If it is, you do indeed have the OPL3 FM chip; so continue following this guide. Now you need to make the required modules load at boot. To do this, issue this command at the terminal:

gksudo gedit /etc/modules

When prompted, enter your password. Now, at the end of the file, add this:

snd-seq
snd-seq-device
snd-seq-midi
snd-seq-oss
snd-seq-midi-event
snd-opl3-synth

Then save the changes and exit gedit. Now, we need to install the package "alsa-tools". You may need the multiverse and universe repositories enabled for this. If you haven't got them enabled and need help doing that, please refer to AddingRepositoriesHowto Run this command in the terminal.

sudo aptitude install alsa-tools

Now, we are ready to load the instrument patches for it. Run this command in the terminal:

sbiload -p 17:0 --opl3 /usr/share/sounds/opl3/std.o3 /usr/share/sounds/opl3/drums.o3

Please note, the port number (shown here as 17:0) may differ for you. Check the output of aplaymidi -l to make sure what the port number for the OPL3 is on your system. Once that is done, we're ready to test it out. Here is a MIDI file to test it with: http://www.webpost.net/av/avatarmaster/patricksworld.mid Now, run this command in the terminal:

aplaymidi -p 17:0 file.mid

Remember, the port number might be different for you. Check the output of aplaymidi -l to make sure which one. If you can't hear anything, run "alsamixer" in a terminal and make sure the "synth" mixer item is not muted or set to a volume level of 0 or something. If it all worked, you should be hearing some tinny old synth noises.