个人工具

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

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/MidiHardwareSynthesisSetup}} {{Languages|UbuntuHelp:MidiHardwareSynthesisSetup}} Use this guide to setup your MIDI synth, if you have a soundcard ...)
 
(正在重定向到 UbuntuHelp:Midi/HardwareSynthesisSetup
 
(未显示2个用户的4个中间版本)
第1行: 第1行:
 +
#REDIRECT [[UbuntuHelp:Midi/HardwareSynthesisSetup]]
 
{{From|https://help.ubuntu.com/community/MidiHardwareSynthesisSetup}}
 
{{From|https://help.ubuntu.com/community/MidiHardwareSynthesisSetup}}
 
{{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 )
 
 
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:
 
<pre><nowiki>
 
aplaymidi -l
 
</nowiki></pre>
 
 
If you see something similar to this:
 
<pre><nowiki>
 
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
 
</nowiki></pre>
 
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:
 
<pre><nowiki>
 
gksudo gedit /etc/modules
 
</nowiki></pre>
 
 
When prompted, enter your password. Now, at the end of the file, add this:
 
<pre><nowiki>
 
snd-seq
 
snd-seq-device
 
snd-seq-midi
 
snd-seq-oss
 
snd-seq-midi-event
 
</nowiki></pre>
 
(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:
 
<pre><nowiki>
 
sudo modprobe -a snd-seq snd-seq-device snd-seq-midi snd-seq-oss snd-seq-midi-event
 
</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
 
 
Issue the following command into a terminal:
 
 
<pre><nowiki>
 
sudo aptitude install awesfx
 
</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.
 
 
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:
 
<pre><nowiki>
 
sfxload file.sf2
 
</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
 
 
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:
 
 
<pre><nowiki>
 
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
 
</nowiki></pre>
 
 
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:
 
<pre><nowiki>
 
aplaymidi -p 65:0 file.mid
 
</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
 
 
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:
 
<pre><nowiki>
 
sudo modprobe -a snd-seq snd-seq-device snd-seq-midi snd-seq-oss snd-seq-midi-event snd-opl3-synth
 
</nowiki></pre>
 
 
Now, run this command:
 
<pre><nowiki>
 
aplaymidi -l
 
</nowiki></pre>
 
It should tell you something similar to this:
 
<pre><nowiki>
 
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
 
</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.
 
 
Now you need to make the required modules load at boot. To do this, issue this command at the terminal:
 
<pre><nowiki>
 
gksudo gedit /etc/modules
 
</nowiki></pre>
 
 
When prompted, enter your password. Now, at the end of the file, add this:
 
<pre><nowiki>
 
snd-seq
 
snd-seq-device
 
snd-seq-midi
 
snd-seq-oss
 
snd-seq-midi-event
 
snd-opl3-synth
 
</nowiki></pre>
 
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.
 
<pre><nowiki>
 
sudo aptitude install alsa-tools
 
</nowiki></pre>
 
 
Now, we are ready to load the instrument patches for it.
 
 
Run this command in the terminal:
 
<pre><nowiki>
 
sbiload -p 17:0 --opl3 /usr/share/sounds/opl3/std.o3 /usr/share/sounds/opl3/drums.o3
 
</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.
 
 
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:
 
 
<pre><nowiki>
 
aplaymidi -p 17:0 file.mid
 
</nowiki></pre>
 
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.
 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2008年5月9日 (五) 19:10的最新版本