============================================================================== TiMidity++ Installation guide Masanao Izumo <mo@goice.co.jp> Last updated on Feb.4.1999 ============================================================================== This document describes how to install TiMidity++ (version 1.3.0 or later) for your UNIX-like machine. Methods for Macintosh are not described in this document. This version and later versions have been set up to allow you to configure and make timidity.exe on a CYGNUS + egcs-compiler(gcc) environment of Windows98/95/NT. If you are using Windows, install cygnus and egcs (or mingw) if you don't have them (they're available from http://www.cygnus.com), run `cygnus' on the MS-DOS console, and make a symbolic link /bin/sh to bash. Installing process: 1. configure 2. edit common.makefile, Makefile, timidity.h (usually not necessary) 3. make (requires GNU make) 4. installation 5. search for various voice data patches :) Each process is explained in the following sections. (Note that '%' is the shell prompt.) 1. configure ------------ First, execute the following command: % sh configure --help Many options of the "configure" script will be displayed. The main ones are the following: --help Displays help messages. --prefix=PREFIX Specifies the location of the directory to install files into. By default, PREFIX is "/usr/local/". The installed files include : PREFIX/bin : executable file PREFIX/lib/timidity : configuration files and patches PREFIX/man : online manual Example: % sh configure --prefix=/opt/gnu # installs to /opt/gnu/bin, /opt/gnu/lib/timidity, /opt/gnu/man --x-includes=DIR Specifies include directory of X library. --x-libraries=DIR X library files are in DIR Specifies library directory of X library. --enable-debug Compiles TiMidity++ with debugging methods/information. --disable-dynamic Disables dynamically loaded interfaces. --with-x You should specify this option if you have X Windows. --with-tcl-includes=dir Specifies include directory of Tcl. (If configure fails to detect it automatically, try to specify this.) --with-tcl-libs=dir Specifies library directory of Tcl. (If configure fails to detect it automatically, try to specify this.) --with-tk-includes=dir Specifies include directory of Tk. (If configure fails to detect it automatically, try to specify this.) --with-tk-libs=dir Specifies library directory of Tk. (If configure fails to detect it automatically, try to specify this.) --enable-audio Enables TiMidity++ to play MIDI files directly. If this option is disabled, TiMidity++ is only a MIDI-to-WAVE converter. This option should not be specified if the target machine does not support an audio device. --enable-ncurses Enables the Ncurses interface. If you build this interface as a dynamically linked interface, please specify --enable-ncurses=dynamic. --enable-slang Enables the slang interface. If you build this interface as a dynamically linked interface, please specify --enable-slang=dynamic. --enable-motif Enables the Motif interface. If you build this interface as a dynamically linked interface, please specify --enable-motif=dynamic. If you don't have Motif owing to lack of funds :), LessTif is an alternative. --enable-tcltk Enables the Tcl/Tk interface. If you build this interface as a dynamically linked interface, please specify --enable-tcltk=dynamic. --enable-emacs Enables the Emacs interface. If you build this interface as a dynamically linked interface, please specify --enable-emacs=dynamic. If you want use TiMidity++ on Emacs, install this interface and press M-x timidity. You may also have to edit timidity.el and you'll need to install timidity.el in an appropriate directory. --enable-vt100 Enables the VT100 interface. If you build this interface as a dynamically linked interface, please specify --enable-vt100=dynamic. This is the full-screen interface using VT100 terminal control codes. --enable-xaw Enables the X Athena Widget interface. If you build this interface as a dynamically linked interface, please specify --enable-xaw=dynamic. --enable-xskin Enables the skin interface. This is the small X interface using skins of WinAmp/x11amp. If you build this interface as a dynamically linked interface, please specify --enable-xaw=dynamic. --enable-gtk Enables the Gtk+ interface. If you build this interface as a dynamically linked interface, please specify --enable-gtk=dynamic. --enable-network This option allows TiMidity++ to play MIDI files obtained over a network. You can specify the location of the MIDI files by a URL e.g. http://foo.bar/baz.mid. --enable-spectrogram This option allows TiMidity++ to open the sound-spectrogram window in X. --enable-wrd Enables the WRD interface(on X). WRD is a Japanese local lyric- contents format. For example: % sh configure --with-x --enable-audio \ --enable-ncurses --enable-slang --enable-motif \ --enable-tcltk --enable-emacs --enable-vt100 --enable-xaw \ --enable-xskin --enable-gtk \ --enable-network --enable-spectrogram --enable-wrd Some MIDI files eat too much CPU power. If you choose the correct optimizing method, TiMidity++ can often play such MIDI files smoothly. Optimizing options can be specified on the configuration line: (for example : supersparc/gcc) (csh, tcsh) % env CFLAGS='-O3 -Wall -mv8 -funroll-all-loops -fomit-frame-pointer -msupersparc' \ sh configure [configure-options]... (sh, bash) % CFLAGS='-O3 -Wall -mv8 -funroll-all-loops -fomit-frame-pointer -msupersparc' \ sh configure [configure-options]... 2. edit common.makefile, Makefile, timidity.h ------------------------------ If configure failed or your compile did not complete successfully, edit common.makefile, Makefile, and timidity.h to the appropriate values. This should not normally be necessary. 3. make ------- Once you are finished with the above settings, type % make Compiling Timidity requires GNU make. Some system have it as gmake. Note: Some systems announce warnings about vendorShellClassRec vendorShellWidgetClass in linking XAW, but it doesn't matter. Don't worry about this. 4. install ---------- On UNIX, you can type `make install' to install all files. Or you can select from the following list: make install.bin - installs executable files make install.tk - installs Tcl/Tk interface make install.el - installs Emacs interface make install.man - installs man files make install - installs all files I recommend checking the install directories and files before installation by executing % make -n ... On Windows, `make install' doesn't work in the current version (v1.3.0). Please copy timidity/timidity.exe to the desired directory by hand. 5. Search for various voice data patches TiMidity++ uses GUS/patch (Glavis Ultrasound) as the voice data to play. You must get GUS/patch files, and make the configuration (timidity.cfg) file. By default, timidity.cfg is located in /usr/local/lib/timidity/timidity.cfg (or C:\WINDOWS\TIMIDITY.CFG on Windows). Also, please check the following sites for lots of voice (patch) data: http://www.goice.co.jp/timidity/gus/ (33M patch) http://www.goice.co.jp/timidity/dist/cfg/ (Some samples of *.cfg) http://www.i.h.kyoto-u.ac.jp/~shom/timidity/ (10M or 4M patch) ftp://ftp.cdrom.com/pub/gus/sound/patches/files/ (GUS site) Once you download the voice archives, extract them to the appropriate directory and configure *.cfg files with the name and path of the voice data. ============================================================================== configuration of timidity.h ============================================================================== Edit CONFIG_FILE to your convenience. By default, #define CONFIG_FILE DEFAULT_PATH "/timidity.cfg" are recommended. DEFAULT_PATH is the same as TIMID_DIR in Makefile. If you want to place it in another path, specify it as follows: #define CONFIG_FILE "/etc/timidity.cfg" Set up the file extractor (please ignore if compiling on Windows). By default: #define DECOMPRESSOR_LIST { \ ".gz", "gunzip -c %s", \ ".bz2", "bunzip2 -c %s", \ ".Z", "zcat %s", \ ".zip", "unzip -p %s", \ ".lha", "lha -pq %s", \ ".lzh", "lha -pq %s", \ ".shn", "shorten -x %s -", \ 0 } TiMidity++ can handle some of archive formats directly, but other formats will use these extractors. Next, set the patch file converter (please ignore if compiling on Windows). By default: #define PATCH_CONVERTERS { \ ".wav", "wav2pat %s", \ 0 } Next, set the extensions of GUS/patch files. If specified in this configuration, the extension can be omitted in all *.cfg files. By default: #define PATCH_EXT_LIST { \ ".pat", \ ".shn", ".pat.shn", \ ".gz", ".pat.gz", \ ".bz2", ".pat.bz2", \ 0 } Next, set the default instrument. By default: #define DEFAULT_PROGRAM 0 If there are no Program Change events, this program is adopted. Usually 0 is Piano. Next, set the drum channels. By default: #define DEFAULT_DRUMCHANNELS {10, -1} The list of numbers is the list of drum channels, and -1 is the terminator. For example, if you wish to define the default drum channels as 10 and 16, #define DEFAULT_DRUMCHANNELS {10, 16, -1} These channels can be changed using the command line options. Next, set the presence hack option. This option is enabled if PRESENCE_HACK is defined. By default: #define PRESENCE_HACK -1 -1 means that this feature is only enabled if the -b command line option is specified. If defined with 0 to 2, the effect is following: #define PRESENCE_HACK 0 /* mainly heard from right */ #define PRESENCE_HACK 1 /* mainly heard from left */ #define PRESENCE_HACK 2 /* changes voices right and left each 10 seconds */ The following define (PRESENCE_DECAY) is the delay number for making presence effects. This number can be specified using a command line option by following the -b? option with a number in milliseconds. Next, specify the type of floating point number. Choose one of these: typedef double FLOAT_T; typedef float FLOAT_T; Many machines which have FPUs give faster operations with doubles than with floats, but some machines give the opposite results. Next, set the minimum and maximum range of the playback sampling rate. By default: #define MIN_OUTPUT_RATE 4000 #define MAX_OUTPUT_RATE 65000 Next, set the default value of the master volume. By default: #define DEFAULT_AMPLIFICATION 70 This number is the percentage of the maximum volume. This default value should work well in most situations. This number can be specified using a command line option (-A). Next, set the default sampling rate. By default: #define DEFAULT_RATE 32000 If you have lots of CPU power, CD quality GUS/patches and want to listen to funny sounds, #define DEFAULT_RATE 44100 is a good solution. Next, set the maximum polyphony numbers. By default: #define DEFAULT_VOICES 32 #define MAX_VOICES 256 DEFAULT_VOICE is the polyphony number at startup time. This value is configurable by the command line option (-p) from 0 to MAX_VOICES. If your machine has lots of CPU power, #define DEFAULT_VOICES 64 enables good harmony. Next, set the size of internal buffer. By default: #ifdef __WIN32__ #define AUDIO_BUFFER_BITS 12 #else #define AUDIO_BUFFER_BITS 11 #endif These values probably don't need to change. Next, set the value of CONTROLS_PER_SECOND. By default: #define CONTROLS_PER_SECOND 1000 Next, set the interpolation type for resampling. By default: #define LINEAR_INTERPOLATION This definition causes TiMidity++ to use linear interpolation in resampling, and the sound quality will be nice, but it uses a lot of CPU power. I recommend defining it if you have a powerful machine. Next, set LOOKUP_HACK if desired. By default, this feature is undefined: /* #define LOOKUP_HACK #define LOOKUP_INTERPOLATION */ This option saves a little CPU power, but the sound quality will decrease noticeably. If you don't have a very powerful machine, enable it. Next, set FAST_DECAY if desired. By default, it's disabled: /* #define FAST_DECAY */ This option makes envelopes twice as fast and saves CPU power. But since the release time of voices is shortened, the sound is poor. This feature can be set using a command line option. Next, set FRACTION_BITS. By default: #define FRACTION_BITS 12 I recommend you leave this value as is. Next, set whether to adjust the amplitude of GUS/patch files. By default: #define ADJUST_SAMPLE_VOLUMES This option makes TiMidity adjust amplitudes of each GUS/patch to the same volume. Next, set DANGEROUS_RENICE if desired. By default this feature is disabled: /* #define DANGEROUS_RENICE -15 */ If you want to increase the process priority of TiMidity++ by using setuid root enable this option. This option is only available under UNIX. Once you enable this option, you should install timidity with the following procedure: # chown root /usr/local/bin/timidity # chmod u+s /usr/local/bin/timidity Note: You should not set setuid on timidity if DANGEROUS_RENICE isn't enabled. Next, set MAX_DIE_TIME. By default: #define MAX_DIE_TIME 20 If this value is too small, you will hear clicking noises. I recommend you leave this value as is. Next, set optimizing resampling. By default: #define PRECALC_LOOPS This option saves some CPU power on some systems. Next, set the use of ldexp() if desired. By default this feature is disabled: /* #define USE_LDEXP */ If your machine can multiply floating point numbers with ldexp() faster than by using other methods, enable this option. Next, set the size of the pre-resampling cache. By default: #define DEFAULT_CACHE_DATA_SIZE (2*1024*1024) Next, configure network support. TiMidity++ can access files via networks using a URL identifier. This feature is configurable in the Makefile. If you have enabled this feature in the Makefile (configure --enable-network), configure the following macros: MAIL_DOMAIN specifies the domain name of your email address. If your email address is: "mo@goice.co.jp" set the macro: #define MAIL_DOMAIN "@goice.co.jp" MAIL_NAME specifies your email name. If your email address is "mo@goice.co.jp" set the macro: #define MAIL_NAME "mo" Email addresses are used when TiMidity++ accesses anonymous FTP sites. Next, set the temporary directory. By default, this option is disabled: /* #define TMPDIR "/var/tmp" */ In UNIX, if this option is disabled TiMidity++ creates temporary files in the path specified by the environment variable TMPDIR. If the environment variable TMPDIR also isn't defined, TiMidity++ creates temporary files in /tmp . In Windows, TMPDIR variables are ignored, so you should specify the temporary path with this macro. Next, recognizing GS drum parts by GS exclusive message: #define GS_DRUMPART lets Timidity recognize GS exclusive messages to set drum parts, while /* #define GS_DRUMPART */ disables this feature. Next, set the output text code. If your system is in a Japanese environment, define #define JAPANESE Otherwise, comment it out like this: /* #define JAPANESE */ Next, specify the output text code (in the Japanese environment). You should specify the appropriate code name in the OUTPUT_TEXT_CODE macro. The following strings are available: "AUTO" - Auto conversion by `LANG' environment variable (UNIX only) "ASCII" - Convert unreadable characters to '.'(0x2e) "NOCNV" - No conversion "EUC" - EUC "JIS" - JIS "SJIS" - shift JIS In a Japanized UNIX system, all of the above are available. In Windows, "ASCII", "NOCNV", "SJIS" are available. If your environment cannot handle Japanese, specify "ASCII" or "NOCNV" alternatively. Next, set the MIDI action controllers. By default: #define MODULATION_WHEEL_ALLOW #define PORTAMENTO_ALLOW #define NRPN_VIBRATO_ALLOW /* #define REVERB_CONTROL_ALLOW */ /* #define CHORUS_CONTROL_ALLOW */ /* #define GM_CHANNEL_PRESSURE_ALLOW */ /* #define XG_BANK_SELECT_LSB_ALLOW */ /* #define ALWAYS_TRACE_TEXT_META_EVENT */ #define OVERLAP_VOICE_ALLOW These values are also configurable using command line options, so you can leave the default values as they are. MODULATION_WHEEL_ALLOW Enables modulation wheel by default. (-Ew:on -EW:off) PORTAMENTO_ALLOW Enables portamento by default. (-Ep:on -EP:off) NRPN_VIBRATO_ALLOW Enables NRPN vibrato by default. (-Ev:on -EV:off) REVERB_CONTROL_ALLOW Enables reverb control by default. This feature requires too much CPU power, so this option prevents TiMidity++ from playing in real time if enabled (on the command line or using this define). (-Er:on -ER:off) CHORUS_CONTROL_ALLOW Enables chorus control by default. This feature also requires a large amount of CPU power. (-Ec:on -EC:off) GM_CHANNEL_PRESSURE_ALLOW Enables Channel pressure by default. (-Es:on -ES:off) XG_BANK_SELECT_LSB_ALLOW Enables XG bank select by default. (-Ex:on -EX:off) ALWAYS_TRACE_TEXT_META_EVENT Enables tracing the Text Meta Event by default. (-Et:on -ET:off) OVERLAP_VOICE_ALLOW Enables allowing pronounced overlapped voices. (-Eo:on -EO:off) ------------------------------------------------------------------------- This document was translated from original INSTALL.jp (written in Japanese). Translator: NAGANO Daisuke <breeze_geo@geocities.co.jp> (modified by Masanao Izumo <mo@goice.co.jp>) (proofread by Mike Vanier <mvanier@bbb.caltech.edu>) If you have any comments on this translation, please let us know.