特殊:Badtitle/NS100:MidiSoftwareSynthesisHowTo:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第2行: | 第2行: | ||
{{Languages|UbuntuHelp:MidiSoftwareSynthesisHowTo}} | {{Languages|UbuntuHelp:MidiSoftwareSynthesisHowTo}} | ||
Use this guide to get MIDI sound working unless: | Use this guide to get MIDI sound working unless: | ||
<ol><li>you have a [[UbuntuHelp:SoundcardsWithHardwareSynth|soundcard with a linux-supported hardware synth]] | |||
</li><li>you are using external MIDI instruments</li></ol> | |||
Most people need to setup MIDI sound using software synthesis. | Most people need to setup MIDI sound using software synthesis. | ||
There are two main programs that do software synthesis, TiMidity++ and Fluidsynth. The installation and setup of TiMidity++ is covered in the majority of this guide, since FluidSynth has a nice GUI for it. | There are two main programs that do software synthesis, TiMidity++ and Fluidsynth. The installation and setup of TiMidity++ is covered in the majority of this guide, since FluidSynth has a nice GUI for it. |
2007年12月6日 (四) 15:31的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/MidiSoftwareSynthesisHowTo }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/af | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|Afrikaans| [[::MidiSoftwareSynthesisHowTo/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/ar | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|العربية| [[::MidiSoftwareSynthesisHowTo/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/az | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|azərbaycanca| [[::MidiSoftwareSynthesisHowTo/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/bcc | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|جهلسری بلوچی| [[::MidiSoftwareSynthesisHowTo/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/bg | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|български| [[::MidiSoftwareSynthesisHowTo/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/br | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|brezhoneg| [[::MidiSoftwareSynthesisHowTo/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/ca | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|català| [[::MidiSoftwareSynthesisHowTo/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/cs | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|čeština| [[::MidiSoftwareSynthesisHowTo/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/de | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|Deutsch| [[::MidiSoftwareSynthesisHowTo/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/el | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|Ελληνικά| [[::MidiSoftwareSynthesisHowTo/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/es | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|español| [[::MidiSoftwareSynthesisHowTo/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/fa | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|فارسی| [[::MidiSoftwareSynthesisHowTo/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/fi | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|suomi| [[::MidiSoftwareSynthesisHowTo/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/fr | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|français| [[::MidiSoftwareSynthesisHowTo/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/gu | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|ગુજરાતી| [[::MidiSoftwareSynthesisHowTo/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/he | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|עברית| [[::MidiSoftwareSynthesisHowTo/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/hu | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|magyar| [[::MidiSoftwareSynthesisHowTo/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/id | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|Bahasa Indonesia| [[::MidiSoftwareSynthesisHowTo/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/it | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|italiano| [[::MidiSoftwareSynthesisHowTo/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/ja | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|日本語| [[::MidiSoftwareSynthesisHowTo/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/ko | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|한국어| [[::MidiSoftwareSynthesisHowTo/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/ksh | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|Ripoarisch| [[::MidiSoftwareSynthesisHowTo/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/mr | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|मराठी| [[::MidiSoftwareSynthesisHowTo/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/ms | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|Bahasa Melayu| [[::MidiSoftwareSynthesisHowTo/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/nl | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|Nederlands| [[::MidiSoftwareSynthesisHowTo/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/no | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|norsk| [[::MidiSoftwareSynthesisHowTo/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/oc | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|occitan| [[::MidiSoftwareSynthesisHowTo/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/pl | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|polski| [[::MidiSoftwareSynthesisHowTo/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/pt | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|português| [[::MidiSoftwareSynthesisHowTo/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/ro | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|română| [[::MidiSoftwareSynthesisHowTo/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/ru | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|русский| [[::MidiSoftwareSynthesisHowTo/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/si | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|සිංහල| [[::MidiSoftwareSynthesisHowTo/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/sq | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|shqip| [[::MidiSoftwareSynthesisHowTo/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/sr | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|српски / srpski| [[::MidiSoftwareSynthesisHowTo/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/sv | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|svenska| [[::MidiSoftwareSynthesisHowTo/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/th | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|ไทย| [[::MidiSoftwareSynthesisHowTo/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/tr | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|Türkçe| [[::MidiSoftwareSynthesisHowTo/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/vi | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|Tiếng Việt| [[::MidiSoftwareSynthesisHowTo/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/yue | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|粵語| [[::MidiSoftwareSynthesisHowTo/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/zh | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|中文| [[::MidiSoftwareSynthesisHowTo/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/zh-hans | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|中文(简体)| [[::MidiSoftwareSynthesisHowTo/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo | UbuntuHelp:MidiSoftwareSynthesisHowTo | {{#if: | :}}MidiSoftwareSynthesisHowTo}}/zh-hant | • {{#if: UbuntuHelp:MidiSoftwareSynthesisHowTo|中文(繁體)| [[::MidiSoftwareSynthesisHowTo/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:MidiSoftwareSynthesisHowTo|:MidiSoftwareSynthesisHowTo|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :MidiSoftwareSynthesisHowTo/zh | | {{#ifexist: MidiSoftwareSynthesisHowTo/zh | | {{#ifeq: {{#titleparts:MidiSoftwareSynthesisHowTo|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:MidiSoftwareSynthesisHowTo|1|-1|}} | zh | | }}
Use this guide to get MIDI sound working unless:
- you have a soundcard with a linux-supported hardware synth
- you are using external MIDI instruments
Most people need to setup MIDI sound using software synthesis. There are two main programs that do software synthesis, TiMidity++ and Fluidsynth. The installation and setup of TiMidity++ is covered in the majority of this guide, since FluidSynth has a nice GUI for it.
Installing TiMidity++
Install TiMidity++
You will need the Universe repository enabled (see AddingRepositoriesHowto). Install the package `timidity` (see SynapticHowto).
Install samples
Next you need a set of samples. The easiest way is to install package 'freepats' (a 28 MB download), and you're done. Note that this sample set is incomplete at the moment and doesn't cover the whole General MIDI standard yet. If you want better sound, add the following repository line to your /etc/apt/sources.list file:
deb http://www.fbriere.net/debian/dists/etch misc/
You may then install the package 'eawpatches' (a 31 MB download). Alternatively, if you don't want to add this repository, you may download the package here: http://www.fbriere.net/debian/dists/etch/misc/deb/ Once you have installed the package, change the following line in the /etc/timidity/timidity.cfg file:
source /etc/timidity/freepats.cfg
It should read:
source /etc/timidity/eawpatches.cfg
To use other samples, read 'Finding and setting up a soundfont' below.
See if midi plays
Once you've done that, you can try playing a midi file:
timidity myfile.mid
If all is well, you should hear delicate strains of synthesised music. If you have problems, read 'Reducing CPU usage' below.
Setting up TiMidity++ as a MIDI server
Issue the following commands: You may not need all these (I found it worked with just the first two).
sudo modprobe snd-seq-device sudo modprobe snd-seq-midi sudo modprobe snd-seq-oss sudo modprobe snd-seq-midi-event sudo modprobe snd-seq
This loads missing modules. Then enter:
timidity -iA -B2,8 -Os1l -s 44100
This loads TiMidity++ as a midi server and opens 2 midi ports, 128:0 and 128:1. After issuing it, you should have midi players working. You can open another terminal and issue a command such as:
pmidi -p 128:0 music.mid kmid music.mid
To close TiMidity++, press CTRL-C in the terminal it's running in. Launching the server as root may improve performance because of higher priorities given to the process. Notedit, or your score editor of choice can then be loaded and recognised the midi ports. If the computer is busy doing something else other than playing music, you may hear scratches or have latency problems. This might be solved with a realtime kernel patch, but that is out of the scope of this HOWTO. If you're running Feisty, there is a supported kernel image available to you if you install the package 'linux-lowlatency'.
Automatically starting TiMidity++ on boot
Ubuntu sets up scripts in /etc/init.d when you install TiMidity++. To start it on boot, edit /etc/default/timidity and uncomment the line
TIM_ALSASEQ=true
You'll also need to add the modules you loaded earlier to /etc/modules.
Finding and setting up a soundfont
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. Then you need to edit the file /etc/timidity/timidity.cfg and add the following line (edit as appropriate):
soundfont /pathtothesoundfontfile/soundfontfile.sf2
sfArk on Linux
If you need to decompress sfArk compressed Soundfonts whenever the Linux version of the extractor does not work, then you can easily install sfArk into linux using WINE. If you don't have WINE installed on your machine then you can install it with the following command:
sudo apt-get install wine
Next, you must obtain sfArk from this URL listed above. Once you have WINE installed, all you must do is change to the directory where you have downloaded sfArk and issue the following command:
wine nameoffile
sfArk also works beautifully in Crossover Office 5 as well.
Reducing CPU usage
If TiMidity++ uses too much CPU on your slow machine, and you're running a version prior to Breezy Badger, try adding these lines to the start of /etc/timidity/timidity.cfg (you may need to create this file)
opt EFresamp=l #use linear resampling opt EFvlpf=d #disable VLPF opt EFreverb=d #disable reverb opt EFchorus=d #disable chorus opt EFdelay=d #disable delay
On Breezy Badger and Dapper Drake, simply uncomment all the lines in the section of the file that deals with a slow CPU. However, one of the lines contains a mistake. The "opt no-antialias" line should read "opt --no-anti-alias" instead. Also, make "opt p32a" say "opt p64a" because 32 voices just isn't enough, and keep "opt s32kHz" commented out because it greatly reduces quality for no noticeable gain at all.
FluidSynth
If you wish to use FluidSynth instead, which is better for SoundFont files, there's a nice GUI front-end for it. The easiest way to use this on Feisty and above is to install the low-latency kernel (package "linux-lowlatency") and qsynth, then reboot. Then run Qsynth from the Multimedia or Sound and Video menu. It will probably complain about JACK not running, but JACK isn't required to run Qsynth. Change the audio output driver to "alsa" if you want to run it without JACK. Once you do this, you should be able to use any MIDI player to play MIDI files.
Discussion
Ask questions at [1]