From f0bab5eee064471b4ef5f101517b3d78e7af498b Mon Sep 17 00:00:00 2001 From: r-lyeh Date: Sat, 27 Feb 2016 12:17:40 +0100 Subject: [PATCH] Update README.md --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7c3e1c2..cc87de4 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Regardless of input bit depth, the library hands over an interleaved float array * WavPack * Musepack * Multichannel modules (669, amf, ams, dbm, dmf, dsm, far, it, j2b, mdl, med, mod, mt2, mtm, okt, pat, psm, ptm, s3m, stm, ult, umx, xm) -* MIDI files [(*)](#about-midi-files) +* MIDI files [(SoundFonts required (*))](#about-midi-files-and-soundfonts) ## Encoding Simple but robust WAV format encoder now included. Extentions in the near future might include Ogg. @@ -34,11 +34,12 @@ Simple but robust WAV format encoder now included. Extentions in the near future ## Known Issues & Bugs * See the Github issue tracker. +## About MIDI files and SoundFonts +A SoundFont `.sf2` file is a file that contains many samples of different instruments playing different notes, enabling Libnyquist to render finally each instrument sound in the MIDI song. SoundFonts are available on the web, but the quality and size varies a lot, and they may have licensing issues (because of the copyright of the different samples), they may be designed for different styles of music (classical, jazz, pop...), and they may target different sets of instruments as well. As a general rule, most MIDI files are targeted to use the 128 sounds of [General MIDI standard (GM)](http://en.wikipedia.org/wiki/General_MIDI), so use a SoundFont that does conform to this standard. You probably want to try the [Fluid R3 GM (141 MB uncompressed)](http://google.com/search?q=Fluid+R3+GM+soundfont) as a starter pack, which is a very good general purpose SoundFont (and fully MIT licensed). + +SoundFont files are large and often compressed in `.zip`, `.tar.gz` or `.sfArk` formats. `.sfArk` files can be unpacked with [sfark tool](http://www.melodymachine.com/sfark.htm). For now, libnyquist supports `.pat` (GUS) soundfonts only, which can be converted from `.sf2` files with the [unsf tool](http://alsa.opensrc.org/Unsf). + +Back to the library, the compiler directive `PAT_CONFIG_FILE` tells libnyquist what soundfont file is hardcoded by default (defaults to `pat/timidity.cfg`, but might be `FluidR3_GM2/FluidR3_GM2-2.cfg`, or any other valid path during compilation). Additionally, there is a runtime check for the environment variable `MMPAT_PATH_TO_CFG`, which contains the path to the config file. For more info please check [this source file](third_party\libmodplug\src\load_pat.cpp) + ## License Libyquist is released under the 2-Clause BSD license. All dependencies and codecs are under similar open licenses. - -## About MIDI files -* [SoundFonts](https://en.wikipedia.org/wiki/SoundFont) are required to decode MIDI files. -* Libnyquist supports `.pat` (GUS) soundfonts only. Use [unsf tool](http://alsa.opensrc.org/Unsf) to convert from `.sf2` to `.pat` soundfonts, and [sfark tool](http://www.melodymachine.com/sfark.htm) to unpack compressed soundfonts (`.sf2ark`). -* The compiler directive `PAT_CONFIG_FILE` tells libnyquist what soundfont file is set by default (defaults to `pat/timidity.cfg`; valid options are `FluidR3_GM2/FluidR3_GM2-2.cfg`, etc). -* Additionally, there is runtime check for the environment variable `MMPAT_PATH_TO_CFG`, which contains the path to the config file. For more info please check [this source file](third_party\libmodplug\src\load_pat.cpp)