OSDN Git Service

TiMidity++-2.9.0
authorMasanao Izumo <mo@goice.co.jp>
Sun, 27 Feb 2000 13:50:52 +0000 (22:50 +0900)
committerMasanao Izumo <mo@goice.co.jp>
Sun, 27 Feb 2000 13:50:52 +0000 (22:50 +0900)
22 files changed:
ChangeLog
NEWS
configs/msc-config.h
configure
configure.in
doc/C/timidity.cfg.5
doc/ja_JP.ujis/timidity.cfg.5
interface/Makefile.in
interface/gtk_c.c
interface/mac_trace.c
interface/ncurs_c.c
interface/w32g_c.c
interface/x_sherry.c
interface/xaw_c.c
libunimod/mloader.c
libunimod/unimod.h
libunimod/unimod_priv.h
timidity/controls.h
timidity/mod.c
timidity/mod2midi.h
timidity/playmidi.c
timidity/readmidi.c

index da77c18..0bc2c8d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,37 @@
+2000-02-27  Masanao Izumo <mo@goice.co.jp>
+
+    * Version 2.9.0 released.
+
+2000-02-24  Masanao Izumo <mo@goice.co.jp>
+
+    * doc/C/timidity.cfg.5,doc/ja_JP.ujis/timidity.cfg.5 (#extension opt):
+      Fixed documentation error.
+    * libunimod/unimod.h (CHAR): Fixed redefiend error on Windows.
+
+2000-02-19  Masanao Izumo <mo@goice.co.jp>
+
+    * timidity/{playmidi.c,controls.h (CTLE_PROGRAM): Change control interface
+      of program event.
+    * timidity/{playmidi.c,controls.h (CTLE_DRUMPART): New event interface.
+    * interface/ncurs_c.c: Change somethings...
+    * interface/{gtk_c.cx_sherry.c},libunimod/{mloader.c,unimod.h},
+      timidity/mod2midi.h:
+       Shut gcc warning up.
+    * libunimod/{unimod.h,unimod_priv.h}: WIN32 => __W32__
+    * timidity/playmici.c: Fixed key up/down for MOD file playing.
+
 2000-02-18  Masanao Izumo <mo@goice.co.jp>
 
     * timidity/resample.c (FINALINTERP): Ignore.
-      Now, TiMidity does not hit the end of data, and ignores a final
+      Now, TiMidity does not hit the end out of data, and ignores a final
       interpolation.
+    * timidity/playmidi.c: Avoid overlapped voice when MOD file is playing.
+    * interface/ncurs_c.c,timidity/playmidi.c: Fixed a indicator probrem.
 
 2000-02-16  Paolo Bonzini <bonzini@gnu.org>
 
     * configure.in,libunimod/*,timidity/{Makefile.am,mod.c,mod.h,mod2midi.c,
-       mod2midi.h,readmici.c}: Support full module player.
+       mod2midi.h,readmici.c,readmidi.c}: Support full module player.
 
 2000-02-16  Paolo Bonzini <bonzini@gnu.org>
 
diff --git a/NEWS b/NEWS
index 786a6ba..460250b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-02/??, 2000
+02/27, 2000
     * Version 2.9.0 released.
     * Support full module player.
 
index 53ff9f2..5036da1 100644 (file)
 #define HAVE_MMSYSTEM_H\r
 \r
 /* In VDS Macro AAA=BBB is not available. */\r
-#define TIMID_VERSION  "2.9.0a2"\r
+#define TIMID_VERSION  "2.9.0"\r
 #define DEFAULT_PATH   ".\\"\r
 #define AU_W32\r
 #define WINSOCK\r
index a38a8df..3d91ad4 100755 (executable)
--- a/configure
+++ b/configure
@@ -884,7 +884,7 @@ fi
 
 PACKAGE=TiMidity++
 
-VERSION=2.9.0a2
+VERSION=2.9.0
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
index 1172297..9d2a409 100644 (file)
@@ -55,7 +55,7 @@ dnl
 AC_INIT(timidity/timidity.c)
 SHELL=${CONFIG_SHELL-/bin/sh}
 AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE(TiMidity++, 2.9.0a2, no-define)
+AM_INIT_AUTOMAKE(TiMidity++, 2.9.0, no-define)
 
 dnl To use CONTAINS() macro (See acinclude.m4)
 CONTAINS_INIT
index 961aa5d..4fa38f7 100644 (file)
@@ -188,7 +188,7 @@ Specifies user's mail address. This address is sended to the
 FTP server if TiMidity access any file via FTp.
 
 .TP
-.BI "#extension [\-]{option}" " [optarg]"
+.BI "#extension opt [\-]{option}" " [optarg]"
 Sets the value of boot\-time options.
 
 .TP
index 1d9166c..9136b2a 100644 (file)
-.TH timidity.cfg 5 "Nov 24 1998" "1.0.0"\r
-.SH NAME\r
-timidity.cfg \- configure file of TiMidity++\r
-\r
-.SH SYNOPSIS\r
-.TP\r
-.B /etc/timidity.cfg\r
-.TP\r
-.B /usr/local/lib/timidity/timidity.cfg\r
-\r
-.P\r
-.SH DESCRIPTION\r
-\fItimidity.cfg\fP ¤Ï¡¢timidity(1) ¤Î¼Â¹Ô»þ¤ÎÍÍ¡¹¤ÊÀßÄê¤ò¹Ô¤¦¤¿¤á¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£\r
-²»¿§¥Ç¡¼¥¿¤ÎÃÖ¤­¾ì½ê¡¢²»¿§¼«ÂΤÎÀßÄê¡¢¤½¤Î¾½ô¡¹¤òÀßÄꤹ¤ë»ö¤¬½ÐÍè¤Þ¤¹¡£\r
-.br\r
-\fITiMidity++\fP ¤Ï¡¢µ¯Æ°»þ¤Ë¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤ò¸«¤ëÁ°¤Ë¡¢\r
-\fItimidity.cfg\fP ¤òõº÷¤·¤Þ¤¹¡£\r
-¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¾ì¹ç¡¢¤Þ¤¿¡¢¥é¥¤¥Ö¥é¥ê¥Ñ¥¹¤¬\r
-¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç \fB\-L\fP ¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤ÆÊѹ¹¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢\r
-Á´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤ò¸«¤¿¸å¤Ë¡¢\r
-¿·¤·¤¤¥é¥¤¥Ö¥é¥ê¥Ñ¥¹¤Ë½¾¤Ã¤Æ¥Ç¥Õ¥©¥ë¥È¥Õ¥¡¥¤¥ë¤ò\r
-(\fB\-c\fP ¥ª¥×¥·¥ç¥ó¤ÇÊ̤ÎÀßÄê¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤Ê¤é¤Ð)\r
-ºÆõº÷¤·¤Þ¤¹¡£\r
-.br\r
-¤â¤·Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢\r
-¸å¤ËÆɤ߹þ¤Þ¤ì¤¿ÀßÄê¤Ë¤è¤Ã¤ÆÁ°¤ÎÀßÄ꤬¾å½ñ¤­¤µ¤ì¤Þ¤¹¡£\r
-\r
-.P\r
-ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Ë¤Ï°Ê²¼¤Î½ñ¼°¤¬»ØÄê²Äǽ¤Ç¤¹:\r
-\r
-.TP\r
-.BI dir " directory"\r
-\fIdirectory\fP ¤òõº÷¥Ñ¥¹¤Ë²Ã¤¨¤Þ¤¹¡£²Ã¤¨Êý¤Ï\fB\-L\fP ¥ª¥×¥·¥ç¥ó¤ÈƱÍÍ¡£\r
-.br\r
-TiMidity++ ¤Ç¤Ï¡¢¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë¤ò¥Ñ¥Ã¥Á¥»¥Ã¥È¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£\r
-\r
-Îã:\r
-.br\r
-dir /usr/local/lib/timidity/inst/foo.zip#\r
-.br\r
-bank 0\r
-.br\r
-0 bar.pat\r
-.br\r
-1 baz.pat\r
-.br\r
-2 zoo.pat\r
-.br\r
-¤Þ¤º¡¢dir ¤ÇÄ̾ï¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤è¤¦¤Ë¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë (¾å¤ÎÎã¤Ç¤Ï\r
-/usr/local/lib/timidity/inst/foo.zip)\r
-¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤Î¤È¤­¡¢¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë̾\r
-¤ÎºÇ¸å¤Ë \fB#\fP ¤ò¤Ä¤±¤Æ¤¯¤À¤µ¤¤¡£¤³¤Î \fB#\fP ¤¬¤¢¤ë¤³¤È¤Ç¡¢¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë¤Ç\r
-¤¢¤ë¤³¤È¤ò \fITiMidity++\fP ¤Ïǧ¼±¤·¤Þ¤¹¡£¤³¤¦¤·¤Æ¤ª¤¯¤È¡¢\fIdir\fP ¤Ç»ØÄꤵ¤ì¤¿\r
-¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë¤ÎÃæ¤Î¥Ñ¥Ã¥Á¥Õ¥¡¥¤¥ë¤âÆɤ߹þ¤ßÂоݤˤʤê¤Þ¤¹¡£\r
-¾å¤ÎÎã¤Ç¤Ï¡¢foo.zip ¤ÎÃæ¤Ë¤¢¤ë bar.pat¡¢ baz.pat¡¢zoo.pat ¤¬Æɤ߹þ¤Þ¤ì¤Þ¤¹¡£\r
-\r
-.TP\r
-.BI source " file"\r
-¾¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ò¤½¤Î¾ì½ê¤ËÁÞÆþ¤·¡¢Â³¹Ô¤·¤Þ¤¹¡£\r
-\r
-.TP\r
-.BI bank " number"\r
-¤³¤ì°Ê¹ßÊѹ¹¤¹¤ë¥È¡¼¥ó¥Ð¥ó¥¯¤òÁªÂò¤·¤Þ¤¹¡£\r
-¤³¤Îʸ°Ê¸å¤Î patch ¤ÎÂбþÉÕ¤±¤Ï¡¢»ØÄꤵ¤ì¤¿¥È¡¼¥ó¥Ð¥ó¥¯¤ËÂФ·¤Æ¹Ô¤ï¤ì¤Þ¤¹¡£\r
-\r
-.TP\r
-.BI progbase " number"\r
-¤³¤ì°Ê¹ß¡¢¥×¥í¥°¥é¥àÈÖ¹æ¤ò \fInumber\fP ¤«¤é \fInumber+128\fP ¤ÇÀßÄꡦɽ¼¨¤·¤Þ¤¹¡£\r
-¤¿¤È¤¨¤Ð¡¢\fBprogbase 1\fP ¤È¤·¤¿¾ì¹ç¤Ï¡¢¤½¤ì°Ê¹ß¥×¥í¥°¥é¥àÈÖ¹æ¤Ï 1 ¤«¤é 128 ¤ÇÀßÄꡦɽ¼¨¤µ¤ì¤Þ¤¹¡£\r
-\r
-.TP\r
-.BI drumset " number"\r
-Êѹ¹¤¹¤ë¥É¥é¥à¥»¥Ã¥È¤òÁªÂò¤·¤Þ¤¹¡£\r
-¤³¤Îʸ°Ê¸å¤Î patch ¤ÎÂбþÉÕ¤±¤Ï¡¢»ØÄꤵ¤ì¤¿¥É¥é¥à¥»¥Ã¥È¤ËÂФ·¤Æ¹Ô¤ï¤ì¤Þ¤¹¡£\r
-\r
-.TP\r
-.BI number " file [options]"\r
-¸½ºß¤Î¥È¡¼¥ó¥Ð¥ó¥¯¤ä¥É¥é¥à¥»¥Ã¥È¤Ç¡¢ MIDI ¥×¥í¥°¥é¥à¥Ê¥ó¥Ð¡¼ \fInumber\fP ¤Ç\r
-»ÈÍѤ¹¤ë \fIpatch file\fP ¤ò»ØÄꤷ¤Þ¤¹¡£\r
-\fIoptions\fP ¤Ï¼¡¤Î¤â¤Î¤¬»ÈÍѲÄǽ¤Ç¤¹:\r
-.RS\r
-.TP\r
-\fBamp=\fP\fIamplification\fP\r
-¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤Î¥Ü¥ê¥å¡¼¥à¤ò \fIamplification\fP % ¤Ë¤·¤Þ¤¹¡£\r
-¤â¤·Ãͤ¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢\r
-¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤¬Æɤ߹þ¤Þ¤ì¤ë»þ¤Ë¼«Æ°Åª¤ËÀßÄꤵ¤ì¤Þ¤¹¡£\r
-.TP\r
-\fBnote=\fP\fInote\fP\r
-¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤ò±éÁÕ¤¹¤ë»þ¤Ë·è¤Þ¤Ã¤¿ MIDI ¥Î¡¼¥È(²»³¬) ¤ò»ÈÍѤ·¤Þ¤¹¡£\r
-\fInote\fP ¤ò \fB0\fP ¤Ë¤¹¤ë¤È¡¢\r
-ºÇ½é¤Ë Note On ¥¤¥Ù¥ó¥È¤¬È¯À¸¤·¤¿»þÅÀ¤Ç¤Î¥Î¡¼¥È¤ò»ÈÍѤ·¤Þ¤¹¡£\r
-¥Ñ¡¼¥«¥Ã¥·¥ç¥ó¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤ËÂФ·¤Æ¤Ï¡¢\r
-¤â¤·ÀßÄê¥Õ¥¡¥¤¥ë¤ÇÃͤ¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢\r
-\fBpatch\fP ¥Õ¥¡¥¤¥ë¤ËÆþ¤Ã¤Æ¤¤¤ëÃͤò»ÈÍѤ·¤Þ¤¹¡£\r
-.TP\r
-\fBpan=\fP\fIpanning\fP\r
-¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥ó¥Ë¥ó¥°¤òÀßÄꤷ¤Þ¤¹¡£\r
-\fIpanning\fP ¤Ï \fBleft\fP¡¢\fBright\fP¡¢\fBcenter\fP¡¢¤¢¤ë¤¤¤Ï\r
-\fB\-100\fP ¤«¤é \fB100\fP ¤Þ¤Ç¤ÎÀ°¿ôÃͤò¼è¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£\fB-100\fP ¤¬ºÇ¤âº¸¡¢\r
-\fB100\fP ¤¬ºÇ¤â±¦¤Ë¤Ê¤ê¤Þ¤¹¡£\r
-Ãͤ¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢\fBpatch\fP ¥Õ¥¡¥¤¥ë¤ËÆþ¤Ã¤Æ¤¤¤ëÃͤò»ÈÍѤ·¤Þ¤¹¡£\r
-¤â¤Á¤í¤ó¡¢MIDI ¥Õ¥¡¥¤¥ëÃæ¤Î¥Ñ¥ó¥Ë¥ó¥°¥³¥ó¥È¥í¡¼¥ë¤ÎÊý¤¬Í¥À褵¤ì¤Þ¤¹¡£\r
-.TP\r
-\fBkeep=\fP{\fBloop\fP|\fBenv\fP}\r
-¥Ñ¡¼¥«¥Ã¥·¥ç¥ó¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤Ç¤Ï¡¢\r
-¥Ç¥Õ¥©¥ë¥È¤Ç¥ë¡¼¥×¾ðÊó¤È¥¨¥ó¥Ù¥í¡¼¥×¾ðÊó¤¬ÇË´þ¤µ¤ì¤Þ¤¹¡£\r
-¤Þ¤¿¡¢¥á¥í¥Ç¥£¡¼¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤Ë°Û¾ï¤Ê¥¨¥ó¥Ù¥í¡¼¥×¤¬Â¸ºß¤·¤¿¾ì¹ç¤Ë¤â¡¢\r
-¥¨¥ó¥Ù¥í¡¼¥×¾ðÊó¤Ï¼«Æ°Åª¤ËÇË´þ¤µ¤ì¤Þ¤¹¡£\r
-\fBkeep\fP ¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢¥¨¥ó¥Ù¥í¡¼¥×¾ðÊó¤ä¥ë¡¼¥×¾ðÊó¤¬ÇË´þ¤µ¤ì¤ë¤Î¤òËɤ®¤Þ¤¹¡£\r
-Î㤨¤Ð¡¢Short¡¢Long Whistle ¥Ñ¡¼¥«¥Ã¥·¥ç¥ó¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È\r
-(General MIDI ¤Î 71¡¢72 ÈÖ) ¤ËÂФ·¤Æ¤Ï¡¢\r
-ÀßÄê¥Õ¥¡¥¤¥ë¤Ç ``\fBkeep=loop keep=env\fP'' ¤È¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£\r
-.TP\r
-\fBstrip=\fP{\fBloop\fP|\fBenv\fP|\fBtail\fP}\r
-¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤È¤·¤Æ»ÈÍѤ¹¤ë \fIpatch\fP ¤Î¡¢¥ë¡¼¥×¾ðÊó¤ä¥¨¥ó¥Ù¥í¡¼¥×¾ðÊó¤ä\r
-¥Æ¡¼¥ë(¥ë¡¼¥×¤Î¸å¤Ë¤¢¤ë¥Ç¡¼¥¿)¤òÁ´¤Æ¶¯À©Åª¤ËÇË´þ¤·¤Þ¤¹¡£\r
-¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¡¼¤Î¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤Ë¤Ï¥ë¡¼¥×¤Î¸å¤Ë¥´¥ß¤¬ÉÕ¤¤¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ê¡¢\r
-¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤ò±éÁÕ¤¹¤ëÅ٤˥¯¥ê¥Ã¥­¥ó¥°¥Î¥¤¥º¤¬Æþ¤Ã¤Æ¤·¤Þ¤¦¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£\r
-¤½¤Î¾ì¹ç¡¢\fBstrip=tail\fP ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ì¤Ð²»¼Á¤¬²þÁ±¤µ¤ì¤Þ¤¹¡£\r
-.RE\r
-.LP\r
-.P\r
-\r
-TiMidity++ ¤Ç¤Ï¡¢°Ê²¼¤Î³Èĥ̿Î᤬Äɲ䵤ì¤Æ¤¤¤Þ¤¹:\r
-\r
-.TP\r
-.BI "#extension altassign" " program1 program2 ..."\r
-¥É¥é¥à¥»¥Ã¥È¤Ë¤Ä¤¤¤Æ¡¢¥ª¥ë¥¿¥Í¡¼¥È¥¢¥µ¥¤¥ó¤òÀßÄꤷ¤Þ¤¹¡£\r
-.br\r
-drumset 0\r
-.br\r
-altassign 42 44 46\r
-.br\r
-¤È½ñ¤¯¤È¡¢¥É¥é¥à¥»¥Ã¥È 0 ¤Î 42/44/46 ¤¬ÇÓ¾Ū¤ËÌĤê¤Þ¤¹¡£\r
-¥É¥é¥à¥»¥Ã¥È 0 ¤ÇÄêµÁ¤µ¤ì¤¿¥ª¥ë¥¿¥Í¡¼¥È¥¢¥µ¥¤¥ó¤Ï\r
-¥Ç¥Õ¥©¥ë¥È¤Ç»ÈÍѤµ¤ì¤Þ¤¹¡£\r
-\r
-.TP\r
-.BI "#extension comm" " program comment"\r
-Instrument ÈÖ¹æ \fIprogram\fP ¤Ë¥³¥á¥ó¥È \fIcomment\fP ¤ò»ØÄꤷ¤Þ¤¹¡¥\r
-¤³¤³¤ÇÀßÄꤷ¤¿ \fIcomment\fP ¤Ï \fB\-iNt\fP ¤ä \fI\-iTt\fP ¥ª¥×¥·¥ç¥ó\r
-¤Çµ¯Æ°¤·¤¿»þ¤Ë¡¢¥¤¥ó¥¸¥±¡¼¥¿¥é¥¤¥ó¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£\r
-.TP\r
-.BI "#extension timeout" " program secound"\r
-Instrument ÈÖ¹æ \fIprogram\fP ¤Ç \fIsecound\fP Éðʾå Suspend ¾õÂÖ\r
-¤¬Â³¤¤¤¿¾ì¹ç¡¢¤½¤Î²»¤ò¥ª¥Õ¤Ë¤·¤Þ¤¹¡£\r
-.TP\r
-.BI "#extension copydrumset" " drumset"\r
-\fIdrumset\fP ÈÖ¹æ¤Î¾õÂÖ¤¹¤Ù¤Æ¤ò¸½ºß¤Î \fIdrumset\fP ¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£\r
-.TP\r
-.BI "#extension copybank" " bank"\r
-\fIbank\fP ÈÖ¹æ¤Î¾õÂÖ¤¹¤Ù¤Æ¤ò¸½ºß¤Î \fIbank\fP ¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£\r
-.TP\r
-.BI "#extension HTTPproxy" " hostname:port"\r
-HTTP ¤Î proxy ¤òÀßÄꤷ¤Þ¤¹¡£proxy ¤Î¥Û¥¹¥È̾¤ò \fIhostname\fP¤Ë¡¢\r
-¥Ý¡¼¥ÈÈÖ¹æ¤ò \fIport\fP ¤Ë»ØÄꤷ¤Þ¤¹¡£\r
-.TP\r
-.BI "#extension FTPproxy" " hostname:port"\r
-FTP ¤Î proxy ¤òÀßÄꤷ¤Þ¤¹¡£proxy ¤Î¥Û¥¹¥È̾¤ò \fIhostname\fP¤Ë¡¢\r
-¥Ý¡¼¥ÈÈÖ¹æ¤ò \fIport\fP ¤Ë»ØÄꤷ¤Þ¤¹¡£\r
-.TP\r
-.BI "#extension mailaddr" " your\-mail\-address"\r
-¥æ¡¼¥¶¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤ò \fIyour\-mail\-address\fP ¤Ë»ØÄꤷ¤Þ¤¹¡£\r
-¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ï¡¢\r
-FTP Àܳ¤ò proxy ¤ò²ð¤µ¤º¤Ë¥À¥¤¥ì¥¯¥È¤Ë·Ò¤°¾ì¹ç¤ËÍѤ¤¤é¤ì¤Þ¤¹¡£\r
-.TP\r
-.BI "#extension [\-]{option}" " [optarg]"\r
-µ¯Æ°»þ¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£\r
-.TP\r
-.BI "#extension undef" " progno"\r
-¸½ºß¤Î¥Ð¥ó¥¯¤Î¥×¥í¥°¥é¥àÈÖ¹æ\fIprogno\fP ¤ò̤ÄêµÁ¤Ë¤·¤Þ¤¹¡£\r
-\r
-.P\r
-¤³¤ì¤é¤Î³Èĥ̿Îá¤Ï \fB#\fP ¤«¤é»Ï¤Þ¤Ã¤Æ¤ª¤ê¡¢¸Å¤¤ \fITiMidity++\fP ¤Ç¤Ï\r
-ñ¤Ê¤ë¥³¥á¥ó¥È¤È°·¤ï¤ì̵»ë¤µ¤ì¤Þ¤¹¡£¤è¤Ã¤Æ¡¢¸Å¤¤ \fITiMidity\fP\r
-¤È¤Î¸ß´¹À­¤òÊݤĤ³¤È¤¬¤Ç¤­¤Þ¤¹¡£\r
-.br\r
-¤Ê¤ª¡¢TiMidity++ ¤Ç¤Ï #extension ¤Ï¶õÇò¤È¤·¤Æ°·¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£\r
-\r
-.P\r
-\fITiMidity++\fP ¤ÎÀßÄê¥Õ¥¡¥¤¥ë (*.cfg) Ãæ¤Î source ¤Î°ú¿ô¤Ë UNIX ¤Î¥³¥Þ¥ó¥É\r
-¤«¤é¤Î½ÐÎϤòÍøÍѤǤ­¤Þ¤¹(UNIX ¤Î¤ß)¡£¥Õ¥¡¥¤¥ë̾¤ÎºÇ¸å¤Ë\r
-\fI\|\fP(ASCII 0x7c) ¤òµ­½Ò¤¹¤ë¤È UNIX ¥³¥Þ¥ó¥É¤È¤ß¤Ê¤µ¤ì¡¢\r
-¤½¤Î¥³¥Þ¥ó¥É¤Î½ÐÎϤ¬ source ¤Î°ú¿ô¤Ë¤Ê¤ê¤Þ¤¹¡£\r
-.br\r
-\fBsource\fP \fIcommand|\fP\r
-¤Î¤è¤¦¤Ë¤¹¤ë¤È¡¤\fIcommand\fP ¤Î½ÐÎϤ¬ \fBsource\fP ¤Î°ú¿ô¤Ë¤Ê¤ê¤Þ¤¹¡£\r
-´Ä¶­¤Ë¤è¤Ã¤Æ \fITiMidity++\fP ¤ÎÀßÄê¤òÁªÂò¤·¤¿¤¤¾ì¹ç¤Ê¤É¤ËÊØÍø¤Ç¤¹¡£¤Ê¤ª¡¢\r
-\fIcommand\fP \fI|\fP ¤Î¤è¤¦¤Ë¡¢ÅÓÃæ¤Ë¥¹¥Ú¡¼¥¹¤¬Æþ¤ë¤È¡¢\r
-ÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß»þ¤Ë\r
-¶èÀÚ¤é¤ì¤Æ¤·¤Þ¤¤¡¢¥³¥Þ¥ó¥É¤È¸«¤Ê¤µ¤ì¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£\r
-¤³¤Îµ¡Ç½¤Ï¥Õ¥¡¥¤¥ë̾¤ò»ØÄê¤Ç¤­¤ëÁ´¤Æ¤Î¾ì½ê¤ËŬÍѤǤ­¤Þ¤¹¡£\r
-\r
-         timidity 'cat fild.mid|'\r
-.br\r
-\r
-¤Ï¡¢cat fild.mid ¤Î½ÐÎÏ·ë²Ì¤«¤éÆɤ߼è¤ê¤Þ¤¹¡£\r
-\r
-.P\r
-*.cfg ¤Î \fIsoundfont\fP ¤Î¥ª¥×¥·¥ç¥ó¤Ë \fIremove\fP ¤ò»ØÄꤹ¤ë¤È¡¢\r
-»ØÄꤵ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ò̤ÄêµÁ¤Ë¤·¤Þ¤¹¡£\r
-\r
-.P\r
-.SH SEE ALSO\r
-timidity(1), lsmidiprog(1), mididump(1), patinfo(1), sf2text(1), wav2pat(1)\r
-\r
-.P\r
-.SH COPYRIGHT\r
-Copyright (C) 1999 Masanao Izumo <mo@goice.co.jp>\r
-Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>\r
-.P\r
-Original version was developed under the name of Tuukka Toivonen\r
-<tt@cgs.fi> until the version of TiMidity-0.2i. His development was\r
-discontinued because of his busy work.\r
-.P\r
-This program is free software; you can redistribute it and/or modify\r
-it under the terms of the \fIGNU General Public License\fP as published by\r
-the Free Software Foundation; either version 2 of the License, or (at\r
-your option) any later version.\r
-.P\r
-This program is distributed in the hope that it will be useful, but\r
-WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \fIGNU\r
-General Public License\fP for more details.\r
-.P\r
-You should have received a copy of the GNU General Public License\r
-along with this program; if not, write to the Free Software\r
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
-\r
-.SH AVAILABILITY\r
-The latest release is available on the TiMidity++ Page,\r
-.br\r
-URL http://www.goice.co.jp/member/mo/timidity/\r
-.br\r
+.TH timidity.cfg 5 "Nov 24 1998" "1.0.0"
+.SH NAME
+timidity.cfg \- configure file of TiMidity++
+
+.SH SYNOPSIS
+.TP
+.B /etc/timidity.cfg
+.TP
+.B /usr/local/lib/timidity/timidity.cfg
+
+.P
+.SH DESCRIPTION
+\fItimidity.cfg\fP ¤Ï¡¢timidity(1) ¤Î¼Â¹Ô»þ¤ÎÍÍ¡¹¤ÊÀßÄê¤ò¹Ô¤¦¤¿¤á¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£
+²»¿§¥Ç¡¼¥¿¤ÎÃÖ¤­¾ì½ê¡¢²»¿§¼«ÂΤÎÀßÄê¡¢¤½¤Î¾½ô¡¹¤òÀßÄꤹ¤ë»ö¤¬½ÐÍè¤Þ¤¹¡£
+.br
+\fITiMidity++\fP ¤Ï¡¢µ¯Æ°»þ¤Ë¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó¤ò¸«¤ëÁ°¤Ë¡¢
+\fItimidity.cfg\fP ¤òõº÷¤·¤Þ¤¹¡£
+¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¾ì¹ç¡¢¤Þ¤¿¡¢¥é¥¤¥Ö¥é¥ê¥Ñ¥¹¤¬
+¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç \fB\-L\fP ¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤ÆÊѹ¹¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢
+Á´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤ò¸«¤¿¸å¤Ë¡¢
+¿·¤·¤¤¥é¥¤¥Ö¥é¥ê¥Ñ¥¹¤Ë½¾¤Ã¤Æ¥Ç¥Õ¥©¥ë¥È¥Õ¥¡¥¤¥ë¤ò
+(\fB\-c\fP ¥ª¥×¥·¥ç¥ó¤ÇÊ̤ÎÀßÄê¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤Ê¤é¤Ð)
+ºÆõº÷¤·¤Þ¤¹¡£
+.br
+¤â¤·Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢
+¸å¤ËÆɤ߹þ¤Þ¤ì¤¿ÀßÄê¤Ë¤è¤Ã¤ÆÁ°¤ÎÀßÄ꤬¾å½ñ¤­¤µ¤ì¤Þ¤¹¡£
+
+.P
+ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Ë¤Ï°Ê²¼¤Î½ñ¼°¤¬»ØÄê²Äǽ¤Ç¤¹:
+
+.TP
+.BI dir " directory"
+\fIdirectory\fP ¤òõº÷¥Ñ¥¹¤Ë²Ã¤¨¤Þ¤¹¡£²Ã¤¨Êý¤Ï\fB\-L\fP ¥ª¥×¥·¥ç¥ó¤ÈƱÍÍ¡£
+.br
+TiMidity++ ¤Ç¤Ï¡¢¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë¤ò¥Ñ¥Ã¥Á¥»¥Ã¥È¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+
+Îã:
+.br
+dir /usr/local/lib/timidity/inst/foo.zip#
+.br
+bank 0
+.br
+0 bar.pat
+.br
+1 baz.pat
+.br
+2 zoo.pat
+.br
+¤Þ¤º¡¢dir ¤ÇÄ̾ï¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤è¤¦¤Ë¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë (¾å¤ÎÎã¤Ç¤Ï
+/usr/local/lib/timidity/inst/foo.zip)
+¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤Î¤È¤­¡¢¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë̾
+¤ÎºÇ¸å¤Ë \fB#\fP ¤ò¤Ä¤±¤Æ¤¯¤À¤µ¤¤¡£¤³¤Î \fB#\fP ¤¬¤¢¤ë¤³¤È¤Ç¡¢¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë¤Ç
+¤¢¤ë¤³¤È¤ò \fITiMidity++\fP ¤Ïǧ¼±¤·¤Þ¤¹¡£¤³¤¦¤·¤Æ¤ª¤¯¤È¡¢\fIdir\fP ¤Ç»ØÄꤵ¤ì¤¿
+¥¢¡¼¥«¥¤¥Ö¥Õ¥¡¥¤¥ë¤ÎÃæ¤Î¥Ñ¥Ã¥Á¥Õ¥¡¥¤¥ë¤âÆɤ߹þ¤ßÂоݤˤʤê¤Þ¤¹¡£
+¾å¤ÎÎã¤Ç¤Ï¡¢foo.zip ¤ÎÃæ¤Ë¤¢¤ë bar.pat¡¢ baz.pat¡¢zoo.pat ¤¬Æɤ߹þ¤Þ¤ì¤Þ¤¹¡£
+
+.TP
+.BI source " file"
+¾¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ò¤½¤Î¾ì½ê¤ËÁÞÆþ¤·¡¢Â³¹Ô¤·¤Þ¤¹¡£
+
+.TP
+.BI bank " number"
+¤³¤ì°Ê¹ßÊѹ¹¤¹¤ë¥È¡¼¥ó¥Ð¥ó¥¯¤òÁªÂò¤·¤Þ¤¹¡£
+¤³¤Îʸ°Ê¸å¤Î patch ¤ÎÂбþÉÕ¤±¤Ï¡¢»ØÄꤵ¤ì¤¿¥È¡¼¥ó¥Ð¥ó¥¯¤ËÂФ·¤Æ¹Ô¤ï¤ì¤Þ¤¹¡£
+
+.TP
+.BI progbase " number"
+¤³¤ì°Ê¹ß¡¢¥×¥í¥°¥é¥àÈÖ¹æ¤ò \fInumber\fP ¤«¤é \fInumber+128\fP ¤ÇÀßÄꡦɽ¼¨¤·¤Þ¤¹¡£
+¤¿¤È¤¨¤Ð¡¢\fBprogbase 1\fP ¤È¤·¤¿¾ì¹ç¤Ï¡¢¤½¤ì°Ê¹ß¥×¥í¥°¥é¥àÈÖ¹æ¤Ï 1 ¤«¤é 128 ¤ÇÀßÄꡦɽ¼¨¤µ¤ì¤Þ¤¹¡£
+
+.TP
+.BI drumset " number"
+Êѹ¹¤¹¤ë¥É¥é¥à¥»¥Ã¥È¤òÁªÂò¤·¤Þ¤¹¡£
+¤³¤Îʸ°Ê¸å¤Î patch ¤ÎÂбþÉÕ¤±¤Ï¡¢»ØÄꤵ¤ì¤¿¥É¥é¥à¥»¥Ã¥È¤ËÂФ·¤Æ¹Ô¤ï¤ì¤Þ¤¹¡£
+
+.TP
+.BI number " file [options]"
+¸½ºß¤Î¥È¡¼¥ó¥Ð¥ó¥¯¤ä¥É¥é¥à¥»¥Ã¥È¤Ç¡¢ MIDI ¥×¥í¥°¥é¥à¥Ê¥ó¥Ð¡¼ \fInumber\fP ¤Ç
+»ÈÍѤ¹¤ë \fIpatch file\fP ¤ò»ØÄꤷ¤Þ¤¹¡£
+\fIoptions\fP ¤Ï¼¡¤Î¤â¤Î¤¬»ÈÍѲÄǽ¤Ç¤¹:
+.RS
+.TP
+\fBamp=\fP\fIamplification\fP
+¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤Î¥Ü¥ê¥å¡¼¥à¤ò \fIamplification\fP % ¤Ë¤·¤Þ¤¹¡£
+¤â¤·Ãͤ¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
+¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤¬Æɤ߹þ¤Þ¤ì¤ë»þ¤Ë¼«Æ°Åª¤ËÀßÄꤵ¤ì¤Þ¤¹¡£
+.TP
+\fBnote=\fP\fInote\fP
+¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤ò±éÁÕ¤¹¤ë»þ¤Ë·è¤Þ¤Ã¤¿ MIDI ¥Î¡¼¥È(²»³¬) ¤ò»ÈÍѤ·¤Þ¤¹¡£
+\fInote\fP ¤ò \fB0\fP ¤Ë¤¹¤ë¤È¡¢
+ºÇ½é¤Ë Note On ¥¤¥Ù¥ó¥È¤¬È¯À¸¤·¤¿»þÅÀ¤Ç¤Î¥Î¡¼¥È¤ò»ÈÍѤ·¤Þ¤¹¡£
+¥Ñ¡¼¥«¥Ã¥·¥ç¥ó¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤ËÂФ·¤Æ¤Ï¡¢
+¤â¤·ÀßÄê¥Õ¥¡¥¤¥ë¤ÇÃͤ¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢
+\fBpatch\fP ¥Õ¥¡¥¤¥ë¤ËÆþ¤Ã¤Æ¤¤¤ëÃͤò»ÈÍѤ·¤Þ¤¹¡£
+.TP
+\fBpan=\fP\fIpanning\fP
+¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥ó¥Ë¥ó¥°¤òÀßÄꤷ¤Þ¤¹¡£
+\fIpanning\fP ¤Ï \fBleft\fP¡¢\fBright\fP¡¢\fBcenter\fP¡¢¤¢¤ë¤¤¤Ï
+\fB\-100\fP ¤«¤é \fB100\fP ¤Þ¤Ç¤ÎÀ°¿ôÃͤò¼è¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£\fB-100\fP ¤¬ºÇ¤âº¸¡¢
+\fB100\fP ¤¬ºÇ¤â±¦¤Ë¤Ê¤ê¤Þ¤¹¡£
+Ãͤ¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢\fBpatch\fP ¥Õ¥¡¥¤¥ë¤ËÆþ¤Ã¤Æ¤¤¤ëÃͤò»ÈÍѤ·¤Þ¤¹¡£
+¤â¤Á¤í¤ó¡¢MIDI ¥Õ¥¡¥¤¥ëÃæ¤Î¥Ñ¥ó¥Ë¥ó¥°¥³¥ó¥È¥í¡¼¥ë¤ÎÊý¤¬Í¥À褵¤ì¤Þ¤¹¡£
+.TP
+\fBkeep=\fP{\fBloop\fP|\fBenv\fP}
+¥Ñ¡¼¥«¥Ã¥·¥ç¥ó¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤Ç¤Ï¡¢
+¥Ç¥Õ¥©¥ë¥È¤Ç¥ë¡¼¥×¾ðÊó¤È¥¨¥ó¥Ù¥í¡¼¥×¾ðÊó¤¬ÇË´þ¤µ¤ì¤Þ¤¹¡£
+¤Þ¤¿¡¢¥á¥í¥Ç¥£¡¼¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤Ë°Û¾ï¤Ê¥¨¥ó¥Ù¥í¡¼¥×¤¬Â¸ºß¤·¤¿¾ì¹ç¤Ë¤â¡¢
+¥¨¥ó¥Ù¥í¡¼¥×¾ðÊó¤Ï¼«Æ°Åª¤ËÇË´þ¤µ¤ì¤Þ¤¹¡£
+\fBkeep\fP ¤ò»ØÄꤹ¤ë¤³¤È¤Ç¡¢¥¨¥ó¥Ù¥í¡¼¥×¾ðÊó¤ä¥ë¡¼¥×¾ðÊó¤¬ÇË´þ¤µ¤ì¤ë¤Î¤òËɤ®¤Þ¤¹¡£
+Î㤨¤Ð¡¢Short¡¢Long Whistle ¥Ñ¡¼¥«¥Ã¥·¥ç¥ó¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È
+(General MIDI ¤Î 71¡¢72 ÈÖ) ¤ËÂФ·¤Æ¤Ï¡¢
+ÀßÄê¥Õ¥¡¥¤¥ë¤Ç ``\fBkeep=loop keep=env\fP'' ¤È¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
+.TP
+\fBstrip=\fP{\fBloop\fP|\fBenv\fP|\fBtail\fP}
+¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤È¤·¤Æ»ÈÍѤ¹¤ë \fIpatch\fP ¤Î¡¢¥ë¡¼¥×¾ðÊó¤ä¥¨¥ó¥Ù¥í¡¼¥×¾ðÊó¤ä
+¥Æ¡¼¥ë(¥ë¡¼¥×¤Î¸å¤Ë¤¢¤ë¥Ç¡¼¥¿)¤òÁ´¤Æ¶¯À©Åª¤ËÇË´þ¤·¤Þ¤¹¡£
+¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¡¼¤Î¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤Ë¤Ï¥ë¡¼¥×¤Î¸å¤Ë¥´¥ß¤¬ÉÕ¤¤¤Æ¤¤¤ë¤â¤Î¤¬¤¢¤ê¡¢
+¥¤¥ó¥¹¥Ä¥ë¥á¥ó¥È¤ò±éÁÕ¤¹¤ëÅ٤˥¯¥ê¥Ã¥­¥ó¥°¥Î¥¤¥º¤¬Æþ¤Ã¤Æ¤·¤Þ¤¦¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
+¤½¤Î¾ì¹ç¡¢\fBstrip=tail\fP ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ì¤Ð²»¼Á¤¬²þÁ±¤µ¤ì¤Þ¤¹¡£
+.RE
+.LP
+.P
+
+TiMidity++ ¤Ç¤Ï¡¢°Ê²¼¤Î³Èĥ̿Î᤬Äɲ䵤ì¤Æ¤¤¤Þ¤¹:
+
+.TP
+.BI "#extension altassign" " program1 program2 ..."
+¥É¥é¥à¥»¥Ã¥È¤Ë¤Ä¤¤¤Æ¡¢¥ª¥ë¥¿¥Í¡¼¥È¥¢¥µ¥¤¥ó¤òÀßÄꤷ¤Þ¤¹¡£
+.br
+drumset 0
+.br
+altassign 42 44 46
+.br
+¤È½ñ¤¯¤È¡¢¥É¥é¥à¥»¥Ã¥È 0 ¤Î 42/44/46 ¤¬ÇÓ¾Ū¤ËÌĤê¤Þ¤¹¡£
+¥É¥é¥à¥»¥Ã¥È 0 ¤ÇÄêµÁ¤µ¤ì¤¿¥ª¥ë¥¿¥Í¡¼¥È¥¢¥µ¥¤¥ó¤Ï
+¥Ç¥Õ¥©¥ë¥È¤Ç»ÈÍѤµ¤ì¤Þ¤¹¡£
+
+.TP
+.BI "#extension comm" " program comment"
+Instrument ÈÖ¹æ \fIprogram\fP ¤Ë¥³¥á¥ó¥È \fIcomment\fP ¤ò»ØÄꤷ¤Þ¤¹¡¥
+¤³¤³¤ÇÀßÄꤷ¤¿ \fIcomment\fP ¤Ï \fB\-iNt\fP ¤ä \fI\-iTt\fP ¥ª¥×¥·¥ç¥ó
+¤Çµ¯Æ°¤·¤¿»þ¤Ë¡¢¥¤¥ó¥¸¥±¡¼¥¿¥é¥¤¥ó¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£
+.TP
+.BI "#extension timeout" " program secound"
+Instrument ÈÖ¹æ \fIprogram\fP ¤Ç \fIsecound\fP Éðʾå Suspend ¾õÂÖ
+¤¬Â³¤¤¤¿¾ì¹ç¡¢¤½¤Î²»¤ò¥ª¥Õ¤Ë¤·¤Þ¤¹¡£
+.TP
+.BI "#extension copydrumset" " drumset"
+\fIdrumset\fP ÈÖ¹æ¤Î¾õÂÖ¤¹¤Ù¤Æ¤ò¸½ºß¤Î \fIdrumset\fP ¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£
+.TP
+.BI "#extension copybank" " bank"
+\fIbank\fP ÈÖ¹æ¤Î¾õÂÖ¤¹¤Ù¤Æ¤ò¸½ºß¤Î \fIbank\fP ¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£
+.TP
+.BI "#extension HTTPproxy" " hostname:port"
+HTTP ¤Î proxy ¤òÀßÄꤷ¤Þ¤¹¡£proxy ¤Î¥Û¥¹¥È̾¤ò \fIhostname\fP¤Ë¡¢
+¥Ý¡¼¥ÈÈÖ¹æ¤ò \fIport\fP ¤Ë»ØÄꤷ¤Þ¤¹¡£
+.TP
+.BI "#extension FTPproxy" " hostname:port"
+FTP ¤Î proxy ¤òÀßÄꤷ¤Þ¤¹¡£proxy ¤Î¥Û¥¹¥È̾¤ò \fIhostname\fP¤Ë¡¢
+¥Ý¡¼¥ÈÈÖ¹æ¤ò \fIport\fP ¤Ë»ØÄꤷ¤Þ¤¹¡£
+.TP
+.BI "#extension mailaddr" " your\-mail\-address"
+¥æ¡¼¥¶¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤ò \fIyour\-mail\-address\fP ¤Ë»ØÄꤷ¤Þ¤¹¡£
+¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤Ï¡¢
+FTP Àܳ¤ò proxy ¤ò²ð¤µ¤º¤Ë¥À¥¤¥ì¥¯¥È¤Ë·Ò¤°¾ì¹ç¤ËÍѤ¤¤é¤ì¤Þ¤¹¡£
+.TP
+.BI "#extension opt [\-]{option}" " [optarg]"
+µ¯Æ°»þ¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£
+.TP
+.BI "#extension undef" " progno"
+¸½ºß¤Î¥Ð¥ó¥¯¤Î¥×¥í¥°¥é¥àÈÖ¹æ\fIprogno\fP ¤ò̤ÄêµÁ¤Ë¤·¤Þ¤¹¡£
+
+.P
+¤³¤ì¤é¤Î³Èĥ̿Îá¤Ï \fB#\fP ¤«¤é»Ï¤Þ¤Ã¤Æ¤ª¤ê¡¢¸Å¤¤ \fITiMidity++\fP ¤Ç¤Ï
+ñ¤Ê¤ë¥³¥á¥ó¥È¤È°·¤ï¤ì̵»ë¤µ¤ì¤Þ¤¹¡£¤è¤Ã¤Æ¡¢¸Å¤¤ \fITiMidity\fP
+¤È¤Î¸ß´¹À­¤òÊݤĤ³¤È¤¬¤Ç¤­¤Þ¤¹¡£
+.br
+¤Ê¤ª¡¢TiMidity++ ¤Ç¤Ï #extension ¤Ï¶õÇò¤È¤·¤Æ°·¤ï¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
+
+.P
+\fITiMidity++\fP ¤ÎÀßÄê¥Õ¥¡¥¤¥ë (*.cfg) Ãæ¤Î source ¤Î°ú¿ô¤Ë UNIX ¤Î¥³¥Þ¥ó¥É
+¤«¤é¤Î½ÐÎϤòÍøÍѤǤ­¤Þ¤¹(UNIX ¤Î¤ß)¡£¥Õ¥¡¥¤¥ë̾¤ÎºÇ¸å¤Ë
+\fI\|\fP(ASCII 0x7c) ¤òµ­½Ò¤¹¤ë¤È UNIX ¥³¥Þ¥ó¥É¤È¤ß¤Ê¤µ¤ì¡¢
+¤½¤Î¥³¥Þ¥ó¥É¤Î½ÐÎϤ¬ source ¤Î°ú¿ô¤Ë¤Ê¤ê¤Þ¤¹¡£
+.br
+\fBsource\fP \fIcommand|\fP
+¤Î¤è¤¦¤Ë¤¹¤ë¤È¡¤\fIcommand\fP ¤Î½ÐÎϤ¬ \fBsource\fP ¤Î°ú¿ô¤Ë¤Ê¤ê¤Þ¤¹¡£
+´Ä¶­¤Ë¤è¤Ã¤Æ \fITiMidity++\fP ¤ÎÀßÄê¤òÁªÂò¤·¤¿¤¤¾ì¹ç¤Ê¤É¤ËÊØÍø¤Ç¤¹¡£¤Ê¤ª¡¢
+\fIcommand\fP \fI|\fP ¤Î¤è¤¦¤Ë¡¢ÅÓÃæ¤Ë¥¹¥Ú¡¼¥¹¤¬Æþ¤ë¤È¡¢
+ÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß»þ¤Ë
+¶èÀÚ¤é¤ì¤Æ¤·¤Þ¤¤¡¢¥³¥Þ¥ó¥É¤È¸«¤Ê¤µ¤ì¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
+¤³¤Îµ¡Ç½¤Ï¥Õ¥¡¥¤¥ë̾¤ò»ØÄê¤Ç¤­¤ëÁ´¤Æ¤Î¾ì½ê¤ËŬÍѤǤ­¤Þ¤¹¡£
+
+         timidity 'cat fild.mid|'
+.br
+
+¤Ï¡¢cat fild.mid ¤Î½ÐÎÏ·ë²Ì¤«¤éÆɤ߼è¤ê¤Þ¤¹¡£
+
+.P
+*.cfg ¤Î \fIsoundfont\fP ¤Î¥ª¥×¥·¥ç¥ó¤Ë \fIremove\fP ¤ò»ØÄꤹ¤ë¤È¡¢
+»ØÄꤵ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ò̤ÄêµÁ¤Ë¤·¤Þ¤¹¡£
+
+.P
+.SH SEE ALSO
+timidity(1), lsmidiprog(1), mididump(1), patinfo(1), sf2text(1), wav2pat(1)
+
+.P
+.SH COPYRIGHT
+Copyright (C) 1999 Masanao Izumo <mo@goice.co.jp>
+Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>
+.P
+Original version was developed under the name of Tuukka Toivonen
+<tt@cgs.fi> until the version of TiMidity-0.2i. His development was
+discontinued because of his busy work.
+.P
+This program is free software; you can redistribute it and/or modify
+it under the terms of the \fIGNU General Public License\fP as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+.P
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \fIGNU
+General Public License\fP for more details.
+.P
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+.SH AVAILABILITY
+The latest release is available on the TiMidity++ Page,
+.br
+URL http://www.goice.co.jp/member/mo/timidity/
+.br
index d8ba899..1c1f460 100644 (file)
@@ -374,7 +374,8 @@ emacs_c.o: emacs_c.c ../config.h ../timidity/timidity.h \
 gtk_c.o: gtk_c.c ../config.h ../timidity/timidity.h ../utils/support.h \
        ../timidity/common.h ../libarc/url.h ../utils/mblock.h \
        ../timidity/instrum.h ../timidity/playmidi.h \
-       ../timidity/output.h ../timidity/controls.h gtk_h.h
+       ../timidity/output.h ../timidity/controls.h gtk_h.h \
+       ../timidity/readmidi.h
 gtk_i.o: gtk_i.c ../config.h ../timidity/timidity.h ../utils/support.h \
        ../timidity/common.h ../libarc/url.h ../utils/mblock.h gtk_h.h \
        pixmaps/playpaus.xpm pixmaps/prevtrk.xpm pixmaps/nexttrk.xpm \
index be21bb1..2d3167f 100644 (file)
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdarg.h>
-
+#ifndef NO_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
 #include "timidity.h"
 #include "common.h"
 #include "instrum.h"
@@ -49,6 +53,7 @@
 #include "output.h"
 #include "controls.h"
 #include "gtk_h.h"
+#include "readmidi.h"
 
 static int ctl_open(int using_stdin, int using_stdout);
 static void ctl_close(void);
index aaaa1ab..d67d5ab 100644 (file)
@@ -161,8 +161,8 @@ void mac_ctl_program(int ch, int val, void *comm)
     if(!ctl->trace_playing)
        return;
 
-    if(channel[ch].special_sample)
-               pr = val = channel[ch].special_sample;
+    if(IS_CURRENT_MOD_FILE)
+               pr = val;
     else
                pr = val + progbase;
 
index 7799a11..b141e78 100644 (file)
@@ -97,8 +97,8 @@ int PDC_set_ctrl_break(bool setting);
 #define CHECK_NOTE_SLEEP_TIME 5.0
 #define NCURS_MIN_LINES 8
 
+#define CTL_STATUS_UPDATE -98
 #define CTL_STATUS_INIT -99
-#define CTL_LAST_STATUS -1
 
 #ifndef MIDI_TITLE
 #undef DISPLAY_MID_MODE
@@ -128,11 +128,13 @@ extern int set_extension_modes(char *flag);
 
 static struct
 {
-    int prog;
-    int disp_cnt;
+    int bank, bank_lsb, bank_msb, prog, vol, exp, pan, sus, pitch, wheel;
+    int is_drum;
+    int bend_mark;
+
     double last_note_on;
     char *comm;
-} instr_comment[MAX_CHANNELS];
+} ChannelStatus[MAX_CHANNELS];
 
 enum indicator_mode_t
 {
@@ -146,7 +148,6 @@ static char *comment_indicator_buffer = NULL;
 static char *current_indicator_message = NULL;
 static char *indicator_msgptr = NULL;
 static int current_indicator_chan = 0;
-static int next_indicator_chan = -1;
 static double indicator_last_update;
 static int indicator_mode = INDICATOR_DEFAULT;
 static int display_velocity_flag = 0;
@@ -161,7 +162,6 @@ static int scr_modified_flag = 1; /* delay flush for trace mode */
 static void update_indicator(void);
 static void reset_indicator(void);
 static void indicator_chan_update(int ch);
-static void indicator_set_prog(int ch, int val, char *comm);
 static void display_lyric(char *lyric, int sep);
 static void display_play_system(int mode);
 static void display_aq_ratio(void);
@@ -190,12 +190,15 @@ static const char note_name_char[12] =
 };
 
 static void ctl_note(int status, int ch, int note, int vel);
-static void ctl_program(int ch, int val, char *vp);
+static void ctl_drumpart(int ch, int is_drum);
+static void ctl_program(int ch, int prog, char *vp, unsigned int banks);
 static void ctl_volume(int channel, int val);
 static void ctl_expression(int channel, int val);
 static void ctl_panning(int channel, int val);
 static void ctl_sustain(int channel, int val);
+static void update_bend_mark(int ch);
 static void ctl_pitch_bend(int channel, int val);
+static void ctl_mod_wheel(int channel, int wheel);
 static void ctl_lyric(int lyricid);
 static void ctl_gslcd(int id);
 static void ctl_reset(void);
@@ -287,6 +290,7 @@ static struct double_list_string *ctl_mode_L_histc = NULL; /* current */
 
 static void ctl_ncurs_mode_init(void);
 static void init_trace_window_chan(int ch);
+static void init_chan_status(void);
 static void ctl_cmd_J_move(int diff);
 static int ctl_cmd_J_enter(void);
 static void ctl_cmd_L_dir(int move);
@@ -428,8 +432,8 @@ static void N_ctl_scrinit(void)
     N_ctl_werase(dftwin);
     wmove(dftwin, VERSION_LINE,0);
     waddstr(dftwin, "TiMidity++ v"); waddstr(dftwin, timidity_version);
-    wmove(dftwin, VERSION_LINE,COLS-52);
-    waddstr(dftwin, "(C) 1995,1999 Tuukka Toivonen and Masanao Izumo");
+    wmove(dftwin, VERSION_LINE,COLS-54);
+    waddstr(dftwin, "(C) 1995,1999,2000 Tuukka Toivonen, Masanao Izumo");
     wmove(dftwin, FILE_LINE,0);
     waddstr(dftwin, "File:");
 #ifdef MIDI_TITLE
@@ -457,13 +461,14 @@ static void N_ctl_scrinit(void)
     indicator_width = COLS - 2;
     if(indicator_width < 40)
        indicator_width = 40;
-    if(comment_indicator_buffer == NULL)
-      {
-       memset(comment_indicator_buffer =
-              (char *)safe_malloc(indicator_width), 0, indicator_width);
-       memset(current_indicator_message =
-              (char *)safe_malloc(indicator_width), 0, indicator_width);
-      }
+    if(comment_indicator_buffer != NULL)
+       free(comment_indicator_buffer);
+    if(current_indicator_message != NULL)
+       free(current_indicator_message);
+    memset(comment_indicator_buffer =
+          (char *)safe_malloc(indicator_width), 0, indicator_width);
+    memset(current_indicator_message =
+          (char *)safe_malloc(indicator_width), 0, indicator_width);
     
     if(ctl.trace_playing)
     {
@@ -524,152 +529,145 @@ static void init_trace_window_chan(int ch)
 
        for(i = 0; i < c; i++)
            waddch(dftwin, '.');
-       if(ISDRUMCHANNEL(ch))
-           ctl_program(ch, channel[ch].bank, channel_instrum_name(ch));
-       else
-           ctl_program(ch, channel[ch].program, channel_instrum_name(ch));
-       ctl_volume(0, CTL_STATUS_INIT);
-       ctl_volume(ch, channel[ch].volume);
-       ctl_expression(0, CTL_STATUS_INIT);
-       ctl_expression(ch, channel[ch].expression);
-       ctl_panning(ch, channel[ch].panning);
-       ctl_sustain(ch, channel[ch].sustain);
-       ctl_pitch_bend(ch, CTL_STATUS_INIT);
-       if(channel[ch].pitchbend == 0x2000 && channel[ch].modulation_wheel > 0)
-           ctl_pitch_bend(ch, -2);
-       else
-           ctl_pitch_bend(ch, channel[ch].pitchbend);
+       ctl_program(ch, CTL_STATUS_UPDATE, NULL, 0);
+       ctl_volume(ch, CTL_STATUS_UPDATE);
+       ctl_expression(ch, CTL_STATUS_UPDATE);
+       ctl_panning(ch, CTL_STATUS_UPDATE);
+       ctl_sustain(ch, CTL_STATUS_UPDATE);
+       update_bend_mark(ch);
        clear_bitset(channel_program_flags + ch, 0, 128);
     }
     else
     {
+       ToneBankElement *prog;
+       ToneBank *bank;
+       int b, type, pr;
+
        wattron(dftwin, A_BOLD);
        wprintw(dftwin, "%02d ", ch + 1);
        wattroff(dftwin, A_BOLD);
 
-       if(ISDRUMCHANNEL(ch))
+       b = ChannelStatus[ch].bank;
+       pr = ChannelStatus[ch].prog;
+       bank = tonebank[b];
+       if(bank == NULL || bank->tone[pr].instrument == NULL)
        {
-           if(drumset[channel[ch].bank])
-               wprintw(dftwin, "Drumset %d", channel[ch].bank + progbase);
-           else
-               wprintw(dftwin, "Drumset %d(=>%d)",
-                       channel[ch].bank + progbase, progbase);
+           b = 0;
+           bank = tonebank[0];
+       }
+
+       if(ChannelStatus[ch].is_drum)
+       {
+           wprintw(dftwin, "Drumset Bank %d=>%d",
+                   ChannelStatus[ch].bank + progbase, b + progbase);
        }
        else
        {
-           ToneBankElement *prog;
-           ToneBank *bank;
-           int b, type, pr;
-
-           b = channel[ch].bank;
-           pr = channel[ch].program;
-           if((bank = tonebank[b]) == NULL ||
-              bank->tone[pr].instrument == NULL)
-           {
-               b = 0;
-               bank = tonebank[0];
-           }
-           prog = &bank->tone[pr];
-
            if(IS_CURRENT_MOD_FILE)
            {
-               type = INST_MOD;
-               waddstr(dftwin, "MOD ");
+               wprintw(dftwin, "MOD %d (%s)",
+                       ChannelStatus[ch].prog,
+                       ChannelStatus[ch].comm ? ChannelStatus[ch].comm :
+                       "Not installed");
            }
            else
            {
+               prog = &bank->tone[pr];
+
                if(prog->instrument != NULL &&
                   !IS_MAGIC_INSTRUMENT(prog->instrument))
                {
                    type = prog->instrument->type;
-                   if(type == INST_SF2)
-                       waddstr(dftwin, "SF ");
+                   /* check instrument alias */
+                   if(b != 0 &&
+                      tonebank[0]->tone[pr].instrument == prog->instrument)
+                   {
+                       b = 0;
+                       bank = tonebank[0];
+                       prog = &bank->tone[pr];
+                   }
                }
                else
                    type = -1;
-           }
 
-           if(type == INST_GUS)
-           {
-               if(prog->name == NULL && b != 0)
-               {
-                   b = 0;
-                   bank = tonebank[0];
-                   prog = &bank->tone[pr];
-               }
-
-               wprintw(dftwin, "Bank %d%s Prog %d",
-                       channel[ch].bank,
-                       b == channel[ch].bank ? "" : "(=>0)",
-                       pr + progbase);
+               wprintw(dftwin, "%d Bank %d/%d=>%d Prog %d",
+                       type,
+                       ChannelStatus[ch].bank_msb,
+                       ChannelStatus[ch].bank_lsb,
+                       b,
+                       ChannelStatus[ch].prog + progbase);
 
-               if(prog->name)
+               if(type == INST_GUS)
                {
-                   waddch(dftwin, ' ');
-                   waddstr(dftwin, prog->name);
+                   if(prog->name)
+                   {
+                       waddch(dftwin, ' ');
+                       waddstr(dftwin, prog->name);
+                   }
+                   if(prog->comment != NULL)
+                       wprintw(dftwin, "(%s)", prog->comment);
                }
-               if(prog->comment != NULL)
-                   wprintw(dftwin, "(%s)", prog->comment);
-           }
-           else if(type == INST_SF2)
-           {
-               char *name, *fn;
-
-               if(prog->instype == 1)
+               else if(type == INST_SF2)
                {
-                   b = prog->font_bank;
-                   pr = prog->font_preset;
-               }
+                   char *name, *fn;
 
-               name = soundfont_preset_name(b, pr, -1, &fn);
-               if(name == NULL && b != 0)
-               {
-                   if((name = soundfont_preset_name(0, pr, -1, &fn)) != NULL)
-                       b = 0;
-               }
+                   waddstr(dftwin, " (SF ");
 
-               wprintw(dftwin, "Bank %d%s Prog %d",
-                       channel[ch].bank,
-                       b == channel[ch].bank ? "" : "(=>0)",
-                       pr + progbase);
+                   if(prog->instype == 1)
+                   {
+                       /* Restore original one */
+                       b = prog->font_bank;
+                       pr = prog->font_preset;
+                   }
 
-               if(name != NULL)
-               {
-                   char *p;
-                   if((p = pathsep_strrchr(fn)) != NULL)
-                       p++;
-                   else
-                       p = fn;
-                   wprintw(dftwin, " (%s:%s)", name, p);
-               }
-           }
-           else if(type == INST_MOD)
-           {
-               pr = channel[ch].special_sample;
-               if(pr > 0 && special_patch[pr] != NULL)
-               {
-                   if(special_patch[pr]->name != NULL)
-                       wprintw(dftwin, "SampleID %d (%s)",
-                               pr, special_patch[pr]->name);
-                   else
-                       wprintw(dftwin, "SampleID %d", pr);
+                   name = soundfont_preset_name(b, pr, -1, &fn);
+                   if(name == NULL && b != 0)
+                   {
+                       if((name = soundfont_preset_name(0, pr, -1, &fn)) != NULL)
+                           b = 0;
+                   }
+
+                   wprintw(dftwin, "%d,%d", b, pr + progbase);
+
+                   if(name != NULL)
+                   {
+                       char *p;
+                       if((p = pathsep_strrchr(fn)) != NULL)
+                           p++;
+                       else
+                           p = fn;
+                       wprintw(dftwin, ",%s", name, p);
+                   }
+                   waddch(dftwin, ')');
                }
-               else if(pr == 0)
-                   wprintw(dftwin, "(Not installed)", pr);
-               else
-                   wprintw(dftwin, "SampleID %d (Not installed)", pr);
-           }
-           else
-           {
-               wprintw(dftwin, "Bank %d%s Prog %d",
-                       channel[ch].bank,
-                       b == channel[ch].bank ? "" : "(=>0)",
-                       pr + progbase);
            }
        }
     }
 }
 
+static void init_chan_status(void)
+{
+    int ch;
+
+    for(ch = 0; ch < MAX_CHANNELS; ch++)
+    {
+       ChannelStatus[ch].bank = 0;
+       ChannelStatus[ch].bank_msb = 0;
+       ChannelStatus[ch].bank_lsb = 0;
+       ChannelStatus[ch].prog = 0;
+       ChannelStatus[ch].is_drum = ISDRUMCHANNEL(ch);
+       ChannelStatus[ch].vol = 0;
+       ChannelStatus[ch].exp = 0;
+       ChannelStatus[ch].pan = NO_PANNING;
+       ChannelStatus[ch].sus = 0;
+       ChannelStatus[ch].pitch = 0x2000;
+       ChannelStatus[ch].wheel = 0;
+       ChannelStatus[ch].bend_mark = ' ';
+       ChannelStatus[ch].last_note_on = 0.0;
+       ChannelStatus[ch].comm = NULL;
+    }
+}
+
 static void display_play_system(int mode)
 {
     wmove(dftwin, TIME_LINE, 23);
@@ -997,8 +995,8 @@ static void ctl_list_mode(int type)
 static void redraw_all(void)
 {
     N_ctl_scrinit();
-    ctl_total_time(CTL_LAST_STATUS);
-    ctl_master_volume(CTL_LAST_STATUS);
+    ctl_total_time(CTL_STATUS_UPDATE);
+    ctl_master_volume(CTL_STATUS_UPDATE);
     display_key_helpmsg();
     ctl_file_name(NULL);
     ctl_ncurs_mode_init();
@@ -1017,6 +1015,8 @@ static void ctl_event(CtlEvent *e)
        redraw_all();
        break;
       case CTLE_PLAY_START:
+       init_chan_status();
+       ctl_ncurs_mode_init();
        ctl_total_time((int)e->v1);
        break;
       case CTLE_PLAY_END:
@@ -1037,7 +1037,10 @@ static void ctl_event(CtlEvent *e)
        ctl_master_volume((int)e->v1);
        break;
       case CTLE_PROGRAM:
-       ctl_program((int)e->v1, (int)e->v2, (char *)e->v3);
+       ctl_program((int)e->v1, (int)e->v2, (char *)e->v3, (unsigned int)e->v4);
+       break;
+      case CTLE_DRUMPART:
+       ctl_drumpart((int)e->v1, (int)e->v2);
        break;
       case CTLE_VOLUME:
        ctl_volume((int)e->v1, (int)e->v2);
@@ -1055,7 +1058,7 @@ static void ctl_event(CtlEvent *e)
        ctl_pitch_bend((int)e->v1, (int)e->v2);
        break;
       case CTLE_MOD_WHEEL:
-       ctl_pitch_bend((int)e->v1, e->v2 ? -2 : CTL_LAST_STATUS);
+       ctl_mod_wheel((int)e->v1, (int)e->v2);
        break;
       case CTLE_CHORUS_EFFECT:
        break;
@@ -1085,10 +1088,10 @@ static void ctl_event(CtlEvent *e)
 
 static void ctl_total_time(int tt)
 {
-    static int last_tt = CTL_LAST_STATUS;
+    static int last_tt = CTL_STATUS_UPDATE;
     int mins, secs;
 
-    if(tt == CTL_LAST_STATUS)
+    if(tt == CTL_STATUS_UPDATE)
        tt = last_tt;
     else
        last_tt = tt;
@@ -1107,9 +1110,9 @@ static void ctl_total_time(int tt)
 
 static void ctl_master_volume(int mv)
 {
-    static int lastvol = CTL_LAST_STATUS;
+    static int lastvol = CTL_STATUS_UPDATE;
 
-    if(mv == CTL_LAST_STATUS)
+    if(mv == CTL_STATUS_UPDATE)
        mv = lastvol;
     else
        lastvol = mv;
@@ -1147,48 +1150,45 @@ static void ctl_file_name(char *name)
 
 static void ctl_current_time(int secs, int v)
 {
-  int mins;
-  static int last_voices = CTL_STATUS_INIT, last_v = CTL_STATUS_INIT;
-  static int last_secs = CTL_STATUS_INIT;
+    int mins;
+    static int last_voices = CTL_STATUS_INIT, last_v = CTL_STATUS_INIT;
+    static int last_secs = CTL_STATUS_INIT;
 
-  if(secs == CTL_STATUS_INIT)
-  {
-      last_voices = last_v = last_secs = CTL_STATUS_INIT;
-      return;
-  }
-
-  if(midi_trace.flush_flag)
-      return;
+    if(secs == CTL_STATUS_INIT)
+    {
+       last_voices = last_v = last_secs = CTL_STATUS_INIT;
+       return;
+    }
 
-  if(last_secs != secs)
-  {
-      last_secs = secs;
-      mins=secs/60;
-      secs-=mins*60;
-      wmove(dftwin, TIME_LINE,5);
-      wattron(dftwin, A_BOLD);
-      wprintw(dftwin, "%3d:%02d", mins, secs);
-      wattroff(dftwin, A_BOLD);
-      scr_modified_flag = 1;
-  }
+    if(last_secs != secs)
+    {
+       last_secs = secs;
+       mins = secs/60;
+       secs -= mins*60;
+       wmove(dftwin, TIME_LINE, 5);
+       wattron(dftwin, A_BOLD);
+       wprintw(dftwin, "%3d:%02d", mins, secs);
+       wattroff(dftwin, A_BOLD);
+       scr_modified_flag = 1;
+    }
 
-  if(last_v != v)
-  {
-      last_v = v;
-      wmove(dftwin, VOICE_LINE,47);
-      wattron(dftwin, A_BOLD);
-      wprintw(dftwin, "%3d", v);
-      wattroff(dftwin, A_BOLD);
-      scr_modified_flag = 1;
-  }
+    if(last_v != v)
+    {
+       last_v = v;
+       wmove(dftwin, VOICE_LINE, 47);
+       wattron(dftwin, A_BOLD);
+       wprintw(dftwin, "%3d", v);
+       wattroff(dftwin, A_BOLD);
+       scr_modified_flag = 1;
+    }
 
-  if(last_voices != voices)
-  {
-      last_voices = voices;
-      wmove(dftwin, VOICE_LINE, 52);
-      wprintw(dftwin, "%3d", voices);
-      scr_modified_flag = 1;
-  }
+    if(last_voices != voices)
+    {
+       last_voices = voices;
+       wmove(dftwin, VOICE_LINE, 52);
+       wprintw(dftwin, "%3d", voices);
+       scr_modified_flag = 1;
+    }
 }
 
 static void ctl_note(int status, int ch, int note, int vel)
@@ -1281,184 +1281,250 @@ static void ctl_note(int status, int ch, int note, int vel)
     }
 }
 
-static void ctl_program(int ch, int val, char *comm)
+static void ctl_drumpart(int ch, int is_drum)
 {
-    int pr;
+    if(ch >= display_channels)
+       return;
+    ChannelStatus[ch].is_drum = is_drum;
+}
+
+static void ctl_program(int ch, int prog, char *comm, unsigned int banks)
+{
+    int val;
+    int bank;
 
     if(ch >= display_channels)
        return;
 
-    if(comm != NULL)
-       indicator_set_prog(ch, val, comm);
+    if(prog != CTL_STATUS_UPDATE)
+    {
+       bank = banks & 0xff;
+       ChannelStatus[ch].prog = prog;
+       ChannelStatus[ch].bank = bank;
+       ChannelStatus[ch].bank_lsb = (banks >> 8) & 0xff;
+       ChannelStatus[ch].bank_msb = (banks >> 16) & 0xff;
+       ChannelStatus[ch].comm = (comm ? comm : "");
+    } else {
+       prog = ChannelStatus[ch].prog;
+       bank = ChannelStatus[ch].bank;
+    }
+    ChannelStatus[ch].last_note_on = 0.0;      /* reset */
 
-    if(!ctl.trace_playing)
+    if(ctl_ncurs_mode != NCURS_MODE_TRACE)
        return;
 
-    if(channel[ch].special_sample)
-       pr = val = channel[ch].special_sample;
+    if(selected_channel == ch)
+    {
+       init_trace_window_chan(ch);
+       return;
+    }
+
+    if(ChannelStatus[ch].is_drum)
+       val = bank;
     else
-       pr = val + progbase;
+       val = prog;
+    if(!IS_CURRENT_MOD_FILE)
+       val += progbase;
 
-    if(ctl_ncurs_mode == NCURS_MODE_TRACE)
+    wmove(dftwin, NOTE_LINE + ch, COLS - 21);
+    if(ChannelStatus[ch].is_drum)
     {
-       if(ch == selected_channel)
-           init_trace_window_chan(ch);
-       else
-       {
-           wmove(dftwin, NOTE_LINE+ch, COLS-21);
-           if(ISDRUMCHANNEL(ch))
-           {
-               wattron(dftwin, A_BOLD);
-               wprintw(dftwin, " %03d", pr);
-               wattroff(dftwin, A_BOLD);
-           }
-           else
-               wprintw(dftwin, " %03d", pr);
-       }
+       wattron(dftwin, A_BOLD);
+       wprintw(dftwin, " %03d", val);
+       wattroff(dftwin, A_BOLD);
     }
-
+    else
+       wprintw(dftwin, " %03d", val);
     scr_modified_flag = 1;
 }
 
 static void ctl_volume(int ch, int vol)
 {
-    static int last_vols[MAX_CHANNELS];
-    int i;
-
     if(ch >= display_channels)
        return;
 
-    if(vol == CTL_STATUS_INIT)
+    if(vol != CTL_STATUS_UPDATE)
     {
-       for(i = 0; i < MAX_CHANNELS; i++)
-           last_vols[i] = CTL_STATUS_INIT;
-       return;
+       if(ChannelStatus[ch].vol == vol)
+           return;
+       ChannelStatus[ch].vol = vol;
     }
+    else
+       vol = ChannelStatus[ch].vol;
 
     if(ctl_ncurs_mode != NCURS_MODE_TRACE || selected_channel == ch)
        return;
 
-    if(last_vols[ch] != vol)
-    {
-       last_vols[ch] = vol;
-       wmove(dftwin, NOTE_LINE + ch, COLS - 16);
-       wprintw(dftwin, "%3d", vol);
-       scr_modified_flag = 1;
-    }
+    wmove(dftwin, NOTE_LINE + ch, COLS - 16);
+    wprintw(dftwin, "%3d", vol);
+    scr_modified_flag = 1;
 }
 
-static void ctl_expression(int ch, int vol)
+static void ctl_expression(int ch, int exp)
 {
-    static int last_vols[MAX_CHANNELS];
-    int i;
-
     if(ch >= display_channels)
        return;
 
-    if(vol == CTL_STATUS_INIT)
+    if(exp != CTL_STATUS_UPDATE)
     {
-       for(i = 0; i < MAX_CHANNELS; i++)
-           last_vols[i] = CTL_STATUS_INIT;
-       return;
+       if(ChannelStatus[ch].exp == exp)
+           return;
+       ChannelStatus[ch].exp = exp;
     }
+    else
+       exp = ChannelStatus[ch].exp;
 
     if(ctl_ncurs_mode != NCURS_MODE_TRACE || selected_channel == ch)
        return;
 
-    if(last_vols[ch] != vol)
-    {
-       last_vols[ch] = vol;
-       wmove(dftwin, NOTE_LINE + ch, COLS - 12);
-       wprintw(dftwin, "%3d", vol);
-       scr_modified_flag = 1;
-    }
+    wmove(dftwin, NOTE_LINE + ch, COLS - 12);
+    wprintw(dftwin, "%3d", exp);
+    scr_modified_flag = 1;
 }
 
-static void ctl_panning(int ch, int val)
+static void ctl_panning(int ch, int pan)
 {
-    if(ch >= display_channels || ctl_ncurs_mode != NCURS_MODE_TRACE ||
-       selected_channel == ch)
+    if(ch >= display_channels)
        return;
+
+    if(pan != CTL_STATUS_UPDATE)
+    {
+       if(pan == NO_PANNING)
+           ;
+       else if(pan < 5)
+           pan = 0;
+       else if(pan > 123)
+           pan = 127;
+       else if(pan > 60 && pan < 68)
+           pan = 64;
+       if(ChannelStatus[ch].pan == pan)
+           return;
+       ChannelStatus[ch].pan = pan;
+    }
+    else
+       pan = ChannelStatus[ch].pan;
+
+    if(ctl_ncurs_mode != NCURS_MODE_TRACE || selected_channel == ch)
+       return;
+
     wmove(dftwin, NOTE_LINE + ch, COLS - 8);
-    if(val == NO_PANNING)
+    switch(pan)
+    {
+      case NO_PANNING:
        waddstr(dftwin, "   ");
-    else if(val < 5)
+       break;
+      case 0:
        waddstr(dftwin, " L ");
-    else if(val > 123)
-       waddstr(dftwin, " R ");
-    else if(val > 60 && val < 68)
+       break;
+      case 64:
        waddstr(dftwin, " C ");
-    else
-    {
-       val -= 64;
-       if(val < 0)
+       break;
+      case 127:
+       waddstr(dftwin, " R ");
+       break;
+      default:
+       pan -= 64;
+       if(pan < 0)
        {
            waddch(dftwin, '-');
-           val = -val;
+           pan = -pan;
        }
        else 
            waddch(dftwin, '+');
-       wprintw(dftwin, "%02d", val);
+       wprintw(dftwin, "%02d", pan);
+       break;
     }
     scr_modified_flag = 1;
 }
 
-static void ctl_sustain(int ch, int val)
+static void ctl_sustain(int ch, int sus)
 {
-    if(ch >= display_channels ||
-       ctl_ncurs_mode != NCURS_MODE_TRACE || selected_channel == ch)
+    if(ch >= display_channels)
+       return;
+
+    if(sus != CTL_STATUS_UPDATE)
+    {
+       if(ChannelStatus[ch].sus == sus)
+           return;
+       ChannelStatus[ch].sus = sus;
+    }
+    else
+       sus = ChannelStatus[ch].sus;
+
+    if(ctl_ncurs_mode != NCURS_MODE_TRACE || selected_channel == ch)
        return;
-    wmove(dftwin, NOTE_LINE+ch, COLS - 4);
-    if(val)
+
+    wmove(dftwin, NOTE_LINE + ch, COLS - 4);
+    if(sus)
        waddch(dftwin, 'S');
     else
        waddch(dftwin, ' ');
     scr_modified_flag = 1;
 }
 
-static void ctl_pitch_bend(int ch, int val)
+static void update_bend_mark(int ch)
 {
-    static int lastbends[MAX_CHANNELS];
-    int i, restore;
+    wmove(dftwin, NOTE_LINE + ch, COLS - 2);
+    waddch(dftwin, ChannelStatus[ch].bend_mark);
+    scr_modified_flag = 1;
+}
+
+static void ctl_pitch_bend(int ch, int pitch)
+{
+    int mark;
 
     if(ch >= display_channels)
        return;
 
-    if(val == CTL_STATUS_INIT)
-    {
-       for(i = 0; i < MAX_CHANNELS; i++)
-           lastbends[i] = CTL_STATUS_INIT;
+    ChannelStatus[ch].pitch = pitch;
+
+    if(ctl_ncurs_mode != NCURS_MODE_TRACE || selected_channel == ch)
        return;
-    }
+
+    if(ChannelStatus[ch].wheel)
+       mark = '=';
+    else if(pitch > 0x2000)
+       mark = '>';
+    else if(pitch < 0x2000)
+       mark = '<';
+    else
+       mark = ' ';
+
+    if(ChannelStatus[ch].bend_mark == mark)
+       return;
+    ChannelStatus[ch].bend_mark = mark;
+    update_bend_mark(ch);
+}
+
+static void ctl_mod_wheel(int ch, int wheel)
+{
+    int mark;
+
+    if(ch >= display_channels)
+       return;
+
+    ChannelStatus[ch].wheel = wheel;
 
     if(ctl_ncurs_mode != NCURS_MODE_TRACE || selected_channel == ch)
        return;
 
-    if(val == CTL_LAST_STATUS)
-    {
-       restore = 1;
-       val = lastbends[ch];
-       if(!val || (val != '<' && val != '>'))
-           val = ' ';
-    }
+    if(wheel)
+       mark = '=';
     else
     {
-       restore = 0;
-       if (val==-2) val = '=';
-       else if (val>0x2000) val = '>';
-       else if (val<0x2000) val = '<';
-       else val = ' ';
+       /* restore pitch bend mark */
+       if(ChannelStatus[ch].pitch > 0x2000)
+           mark = '>';
+       else if(ChannelStatus[ch].pitch < 0x2000)
+           mark = '<';
+       else
+           mark = ' ';
     }
 
-    if(restore || lastbends[ch] != val)
-    {
-       if(val != '=')
-           lastbends[ch] = val;
-       else lastbends[ch] = ' ';
-       wmove(dftwin, NOTE_LINE+ch, COLS-2);
-       waddch(dftwin, val);
-       scr_modified_flag = 1;
-    }
+    if(ChannelStatus[ch].bend_mark == mark)
+       return;
+    ChannelStatus[ch].bend_mark = mark;
+    update_bend_mark(ch);
 }
 
 static void ctl_lyric(int lyricid)
@@ -1671,6 +1737,7 @@ static int ctl_open(int using_stdin, int using_stdout)
        ctl_ncurs_mode = NCURS_MODE_MAIN;
 
     ctl_ncurs_back = ctl_ncurs_mode;
+    init_chan_status();
     N_ctl_scrinit();
 
     if(ctl.trace_playing)
@@ -1741,7 +1808,10 @@ static void move_select_channel(int diff)
        selected_channel -= display_channels + 1;
 
     if(selected_channel != -1)
+    {
        init_trace_window_chan(selected_channel);
+       current_indicator_chan = selected_channel;
+    }
     N_ctl_refresh();
 }
 
@@ -1986,7 +2056,7 @@ static int ctl_cmd_D_enter(int32 *val)
        if(*text == '+')
        {
            ch = atoi(text + 1) - 1;
-           if(ch >= 0 && ISDRUMCHANNEL(ch))
+           if(ch >= 0 && ChannelStatus[ch].is_drum)
            {
                *val = ch;
                rc = RC_TOGGLE_DRUMCHAN;
@@ -1995,7 +2065,7 @@ static int ctl_cmd_D_enter(int32 *val)
        else if(*text == '-')
        {
            ch = atoi(text + 1) - 1;
-           if(ch >= 0 && ISDRUMCHANNEL(ch))
+           if(ch >= 0 && ChannelStatus[ch].is_drum)
            {
                *val = ch;
                rc = RC_TOGGLE_DRUMCHAN;
@@ -2368,8 +2438,8 @@ static int ctl_read(int32 *valp)
          ctl.trace_playing = !ctl.trace_playing;
          if(ctl_open(0, 0))
              return RC_QUIT; /* Error */
-         ctl_total_time(CTL_LAST_STATUS);
-         ctl_master_volume(CTL_LAST_STATUS);
+         ctl_total_time(CTL_STATUS_UPDATE);
+         ctl_master_volume(CTL_STATUS_UPDATE);
          ctl_file_name(NULL);
          display_key_helpmsg();
          if(ctl.trace_playing)
@@ -2872,15 +2942,14 @@ static void reset_indicator(void)
     memset(comment_indicator_buffer, ' ', indicator_width - 1);
     comment_indicator_buffer[indicator_width - 1] = '\0';
 
-    next_indicator_chan = -1;
     indicator_last_update = get_current_calender_time();
     indicator_mode = INDICATOR_DEFAULT;
     indicator_msgptr = NULL;
 
     for(i = 0; i < MAX_CHANNELS; i++)
     {
-       instr_comment[i].last_note_on = 0.0;
-       instr_comment[i].comm = channel_instrum_name(i);
+       ChannelStatus[i].last_note_on = 0.0;
+       ChannelStatus[i].comm = channel_instrum_name(i);
     }
 }
 
@@ -2945,12 +3014,9 @@ static void update_indicator(void)
     t = get_current_calender_time();
     if(indicator_mode != INDICATOR_DEFAULT)
     {
-       int save_chan;
        if(indicator_last_update + LYRIC_OUT_THRESHOLD > t)
            return;
-       save_chan = next_indicator_chan;
        reset_indicator();
-       next_indicator_chan = save_chan;
     }
     indicator_last_update = t;
 
@@ -2959,57 +3025,41 @@ static void update_indicator(void)
 
     if(indicator_msgptr == NULL)
     {
-       if(next_indicator_chan >= 0 &&
-          instr_comment[next_indicator_chan].comm != NULL &&
-          *instr_comment[next_indicator_chan].comm)
+       int i, prog, first_ch;
+
+       first_ch = -1;
+       prog = ChannelStatus[current_indicator_chan].prog;
+       /* Find next message */
+       for(i = 0; i < MAX_CHANNELS; i++,
+           current_indicator_chan = (current_indicator_chan + 1) % MAX_CHANNELS)
        {
-           current_indicator_chan = next_indicator_chan;
+           if(ChannelStatus[current_indicator_chan].is_drum ||
+              ChannelStatus[current_indicator_chan].comm == NULL ||
+              *ChannelStatus[current_indicator_chan].comm == '\0')
+               continue;
+
+           if(first_ch == -1 && 
+              ChannelStatus[current_indicator_chan].last_note_on > 0)
+               first_ch = current_indicator_chan;
+           if(ChannelStatus[current_indicator_chan].prog != prog &&
+              (ChannelStatus[current_indicator_chan].last_note_on
+               + CHECK_NOTE_SLEEP_TIME > t))
+               break;
        }
-       else
-       {
-           int prog, first_ch;
-
-           prog = instr_comment[current_indicator_chan].prog;
-           first_ch = -1;
-           /* Find next message */
-           for(i = 0; i < MAX_CHANNELS; i++)
-           {
-               current_indicator_chan++;
-               if(current_indicator_chan == MAX_CHANNELS)
-                   current_indicator_chan = 0;
-
-               if(first_ch != -1 && 
-                  instr_comment[current_indicator_chan].last_note_on > 0)
-                   first_ch = current_indicator_chan;
-
-               if(instr_comment[current_indicator_chan].comm != NULL &&
-                  *instr_comment[current_indicator_chan].comm &&
-                  instr_comment[current_indicator_chan].prog != prog &&
-                  (instr_comment[current_indicator_chan].last_note_on
-                   + CHECK_NOTE_SLEEP_TIME > t ||
-                   instr_comment[current_indicator_chan].disp_cnt == 0))
-                   break;
-           }
 
-           if(i == MAX_CHANNELS)
-           {
-               if(first_ch == -1)
-                   first_ch = 0;
-               current_indicator_chan = first_ch;
-           }
+       if(i == MAX_CHANNELS)
+       {
+           if(first_ch == -1)
+               first_ch = 0;
+           if(ChannelStatus[first_ch].comm == NULL ||
+              *ChannelStatus[first_ch].comm == '\0')
+               return;
+           current_indicator_chan = first_ch;
        }
-       next_indicator_chan = -1;
 
-       if(instr_comment[current_indicator_chan].comm == NULL ||
-          *instr_comment[current_indicator_chan].comm == '\0')
-           return;
-
-       i = instr_comment[current_indicator_chan].prog;
-       if(!IS_CURRENT_MOD_FILE)
-           i += progbase;
        snprintf(current_indicator_message, indicator_width, "%03d:%s   ",
-               i, instr_comment[current_indicator_chan].comm);
-       instr_comment[current_indicator_chan].disp_cnt++;
+                ChannelStatus[current_indicator_chan].prog,
+                ChannelStatus[current_indicator_chan].comm);
        indicator_msgptr = current_indicator_message;
     }
 
@@ -3026,33 +3076,19 @@ static void update_indicator(void)
 
 static void indicator_chan_update(int ch)
 {
-    double t;
-
-    t = get_current_calender_time();
-    if(next_indicator_chan == -1 &&
-       instr_comment[ch].last_note_on + CHECK_NOTE_SLEEP_TIME < t)
-       next_indicator_chan = ch;
-    instr_comment[ch].last_note_on = t;
-    instr_comment[ch].disp_cnt = 0;
-    if(instr_comment[ch].comm == NULL)
-    {
-       if((instr_comment[ch].comm = default_instrument_name) == NULL)
+    ChannelStatus[ch].last_note_on = get_current_calender_time();
+    if(ChannelStatus[ch].comm == NULL)
+    {
+       if((ChannelStatus[ch].comm = default_instrument_name) == NULL)
        {
-           if(!ISDRUMCHANNEL(ch))
-               instr_comment[ch].comm = "<GrandPiano>";
+           if(ChannelStatus[ch].is_drum)
+               ChannelStatus[ch].comm = "<Drum>";
            else
-               instr_comment[ch].comm = "<Drum>";
+               ChannelStatus[ch].comm = "<GrandPiano>";
        }
     }
 }
 
-static void indicator_set_prog(int ch, int val, char *comm)
-{
-    instr_comment[ch].comm = comm;
-    instr_comment[ch].prog = val;
-    instr_comment[ch].last_note_on = 0.0;
-}
-
 static void display_lyric(char *lyric, int sep)
 {
     char *p;
index bc6ec5e..23e3e9a 100644 (file)
@@ -38,6 +38,7 @@
 #include "output.h"\r
 #include "instrum.h"\r
 #include "playmidi.h"\r
+#include "readmidi.h"\r
 #include "controls.h"\r
 #include "miditrace.h"\r
 #include "strtab.h"\r
@@ -758,9 +759,7 @@ static void ctl_program(int ch, int val)
        return;\r
     if(!ctl.trace_playing)\r
        return;\r
-    if(channel[ch].special_sample)\r
-       val = channel[ch].special_sample;\r
-    else\r
+    if(!IS_CURRENT_MOD_FILE)\r
        val += progbase;\r
 \r
     Panel->channel[ch].program = val;\r
index 56ae8bc..046d05e 100644 (file)
@@ -161,6 +161,9 @@ static ImagePixmap *create_shm_image_pixmap(int width, int height, int depth);
 static int isRealPaletteChanged, isRealScreenChanged;
 static int updateClipX1, updateClipY1, updateClipX2, updateClipY2;
 
+static int check_range(VirtualScreen *scr, int x1, int y1, int x2, int y2);
+
+
 static Window try_create_window(Display *disp, int width, int height,
                                int want_class, int want_depth,
                                Visual **newVisual,
index 72b30e1..deab1a6 100644 (file)
@@ -723,9 +723,7 @@ static void ctl_program(int ch, int val, void *comm)
   if(ch >= MAX_XAW_MIDI_CHANNELS) return;
   if(!ctl.trace_playing) return;
 
-  if(channel[ch].special_sample)
-    val = channel[ch].special_sample;
-  else
+  if(!IS_CURRENT_MOD_FILE)
     val += progbase;
   sprintf(local_buf, "PP%c%d", ch+'A', val);
   a_pipe_write(local_buf);
index ab6f2f5..b62013a 100644 (file)
@@ -568,8 +568,6 @@ RealSpeed (SAMPLOAD * s)
 BOOL 
 SL_LoadSamples (void)
 {
-  SAMPLOAD *c2smp = NULL;
-  ULONG maxsize, speed;
   SAMPLOAD *s;
 
   if (!musiclist)
@@ -593,6 +591,9 @@ SL_LoadSamples (void)
          the highest speed and dither it by half. */
       if (!s)
        {
+         SAMPLOAD *c2smp = NULL;
+         ULONG maxsize, speed;
+
          s = musiclist;
          speed = 0;
          while (s)
@@ -1007,8 +1008,6 @@ ML_AllocUniMod (void)
 CHAR *
 ML_LoadTitle (URL reader)
 {
-  CHAR *result = NULL;
-  FILE *fp;
   MLOADER *l;
 
   modreader = reader;
@@ -1035,10 +1034,7 @@ ML_LoadTitle (URL reader)
 BOOL 
 ML_Test (URL reader)
 {
-  int t;
   MLOADER *l;
-  BOOL ok;
-  MODULE *mf;
 
   modreader = reader;
   _mm_errno = 0;
@@ -1155,7 +1151,6 @@ ML_Load (URL reader, int maxchan, BOOL curious)
 void 
 ML_RegisterAllLoaders (void)
 {
-  static BOOL registered = 0;
   MLOADER *last = NULL;
 
   if (firstloader)
index 4531ca5..d2cffc8 100644 (file)
-/*      MikMod sound library\r
-   (c) 1998, 1999 Miodrag Vallat and others - see file AUTHORS for\r
-   complete list.\r
-\r
-   This library is free software; you can redistribute it and/or modify\r
-   it under the terms of the GNU Library General Public License as\r
-   published by the Free Software Foundation; either version 2 of\r
-   the License, or (at your option) any later version.\r
-\r
-   This program is distributed in the hope that it will be useful,\r
-   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-   GNU Library General Public License for more details.\r
-\r
-   You should have received a copy of the GNU Library General Public\r
-   License along with this library; if not, write to the Free Software\r
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\r
-   02111-1307, USA.\r
- */\r
-\r
-/*==============================================================================\r
-\r
-  $Id: unimod.h,v 1.35 1999/10/25 16:31:41 miod Exp $\r
-\r
-  MikMod sound library include file\r
-\r
-==============================================================================*/\r
-\r
-#ifndef _UNIMOD_H_\r
-#define _UNIMOD_H_\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include "url.h"\r
-\r
-#ifdef __cplusplus\r
-extern "C"\r
-{\r
-#endif\r
-\r
-/*\r
- *    ========== Platform independent-type definitions\r
- */\r
-\r
-#ifdef WIN32\r
-#define WIN32_LEAN_AND_MEAN\r
-#include <windows.h>\r
-#include <io.h>\r
-#endif\r
-\r
-#if defined(__OS2__)||defined(__EMX__)\r
-#define INCL_DOSSEMAPHORES\r
-#include <os2.h>\r
-#else\r
-typedef char CHAR;\r
-#endif\r
-\r
-#if defined(__alpha)\r
-/* 64 bit architectures */\r
-\r
-typedef signed char SBYTE;     /* 1 byte, signed */\r
-typedef unsigned char UBYTE;   /* 1 byte, unsigned */\r
-typedef signed short SWORD;    /* 2 bytes, signed */\r
-typedef unsigned short UWORD;  /* 2 bytes, unsigned */\r
-typedef signed int SLONG;      /* 4 bytes, signed */\r
-typedef unsigned int ULONG;    /* 4 bytes, unsigned */\r
-typedef int BOOL;              /* 0=false, <>0 true */\r
-\r
-#else\r
-/* 32 bit architectures */\r
-\r
-typedef signed char SBYTE;     /* 1 byte, signed */\r
-typedef unsigned char UBYTE;   /* 1 byte, unsigned */\r
-typedef signed short SWORD;    /* 2 bytes, signed */\r
-typedef unsigned short UWORD;  /* 2 bytes, unsigned */\r
-typedef signed long SLONG;     /* 4 bytes, signed */\r
-#if !defined(__OS2__)&&!defined(__EMX__)&&!defined(WIN32)\r
-typedef unsigned long ULONG;   /* 4 bytes, unsigned */\r
-typedef int BOOL;              /* 0=false, <>0 true */\r
-#endif\r
-#endif\r
-\r
-/*\r
- *    ========== Error handling and error codes\r
- */\r
-\r
-extern int ML_errno;\r
-extern char *ML_strerror (int);\r
-\r
-enum\r
-{\r
-  MMERR_OPENING_FILE = 1,\r
-  MMERR_OUT_OF_MEMORY,\r
-  MMERR_DYNAMIC_LINKING,\r
-\r
-  MMERR_SAMPLE_TOO_BIG,\r
-  MMERR_OUT_OF_HANDLES,\r
-  MMERR_UNKNOWN_WAVE_TYPE,\r
-\r
-  MMERR_LOADING_PATTERN,\r
-  MMERR_LOADING_TRACK,\r
-  MMERR_LOADING_HEADER,\r
-  MMERR_LOADING_SAMPLEINFO,\r
-  MMERR_NOT_A_MODULE,\r
-  MMERR_NOT_A_STREAM,\r
-  MMERR_MED_SYNTHSAMPLES,\r
-  MMERR_ITPACK_INVALID_DATA,\r
-\r
-  MMERR_MAX\r
-};\r
-\r
-/*========== Internal module representation (UniMod) interface */\r
-\r
-/* number of notes in an octave */\r
-#define OCTAVE 12\r
-\r
-extern void UniSetRow (UBYTE *);\r
-extern UBYTE UniGetByte (void);\r
-extern UWORD UniGetWord (void);\r
-extern UBYTE *UniFindRow (UBYTE *, UWORD);\r
-extern void UniSkipOpcode (UBYTE);\r
-extern void UniReset (void);\r
-extern void UniWriteByte (UBYTE);\r
-extern void UniWriteWord (UWORD);\r
-extern void UniNewline (void);\r
-extern UBYTE *UniDup (void);\r
-extern BOOL UniInit (void);\r
-extern void UniCleanup (void);\r
-extern void UniEffect (UWORD, UWORD);\r
-#define UniInstrument(x) UniEffect(UNI_INSTRUMENT,x)\r
-#define UniNote(x) UniEffect(UNI_NOTE,x)\r
-extern void UniPTEffect (UBYTE, UBYTE);\r
-extern void UniVolEffect (UWORD, UBYTE);\r
-\r
-/*========== Module Commands */\r
-\r
-enum\r
-{\r
-  /* Simple note */\r
-  UNI_NOTE = 1,\r
-  /* Instrument change */\r
-  UNI_INSTRUMENT,\r
-  /* Protracker effects */\r
-  UNI_PTEFFECT0,               /* arpeggio */\r
-  UNI_PTEFFECT1,               /* porta up */\r
-  UNI_PTEFFECT2,               /* porta down */\r
-  UNI_PTEFFECT3,               /* porta to note */\r
-  UNI_PTEFFECT4,               /* vibrato */\r
-  UNI_PTEFFECT5,               /* dual effect 3+A */\r
-  UNI_PTEFFECT6,               /* dual effect 4+A */\r
-  UNI_PTEFFECT7,               /* tremolo */\r
-  UNI_PTEFFECT8,               /* pan */\r
-  UNI_PTEFFECT9,               /* sample offset */\r
-  UNI_PTEFFECTA,               /* volume slide */\r
-  UNI_PTEFFECTB,               /* pattern jump */\r
-  UNI_PTEFFECTC,               /* set volume */\r
-  UNI_PTEFFECTD,               /* pattern break */\r
-  UNI_PTEFFECTE,               /* extended effects */\r
-  UNI_PTEFFECTF,               /* set speed */\r
-  /* Scream Tracker effects */\r
-  UNI_S3MEFFECTA,              /* set speed */\r
-  UNI_S3MEFFECTD,              /* volume slide */\r
-  UNI_S3MEFFECTE,              /* porta down */\r
-  UNI_S3MEFFECTF,              /* porta up */\r
-  UNI_S3MEFFECTI,              /* tremor */\r
-  UNI_S3MEFFECTQ,              /* retrig */\r
-  UNI_S3MEFFECTR,              /* tremolo */\r
-  UNI_S3MEFFECTT,              /* set tempo */\r
-  UNI_S3MEFFECTU,              /* fine vibrato */\r
-  UNI_KEYOFF,          /* note off */\r
-  /* Fast Tracker effects */\r
-  UNI_KEYFADE,         /* note fade */\r
-  UNI_VOLEFFECTS,              /* volume column effects */\r
-  UNI_XMEFFECT4,               /* vibrato */\r
-  UNI_XMEFFECTA,               /* volume slide */\r
-  UNI_XMEFFECTE1,              /* fine porta up */\r
-  UNI_XMEFFECTE2,              /* fine porta down */\r
-  UNI_XMEFFECTEA,              /* fine volume slide up */\r
-  UNI_XMEFFECTEB,              /* fine volume slide down */\r
-  UNI_XMEFFECTG,               /* set global volume */\r
-  UNI_XMEFFECTH,               /* global volume slide */\r
-  UNI_XMEFFECTL,               /* set envelope position */\r
-  UNI_XMEFFECTP,               /* pan slide */\r
-  UNI_XMEFFECTX1,              /* extra fine porta up */\r
-  UNI_XMEFFECTX2,              /* extra fine porta down */\r
-  /* Impulse Tracker effects */\r
-  UNI_ITEFFECTG,               /* porta to note */\r
-  UNI_ITEFFECTH,               /* vibrato */\r
-  UNI_ITEFFECTI,               /* tremor (xy not incremented) */\r
-  UNI_ITEFFECTM,               /* set channel volume */\r
-  UNI_ITEFFECTN,               /* slide / fineslide channel volume */\r
-  UNI_ITEFFECTP,               /* slide / fineslide channel panning */\r
-  UNI_ITEFFECTT,               /* slide tempo */\r
-  UNI_ITEFFECTU,               /* fine vibrato */\r
-  UNI_ITEFFECTW,               /* slide / fineslide global volume */\r
-  UNI_ITEFFECTY,               /* panbrello */\r
-  UNI_ITEFFECTZ,               /* resonant filters */\r
-  UNI_ITEFFECTS0,\r
-  /* UltraTracker effects */\r
-  UNI_ULTEFFECT9,              /* Sample fine offset */\r
-  /* OctaMED effects */\r
-  UNI_MEDSPEED,\r
-  UNI_MEDEFFECTF1,             /* play note twice */\r
-  UNI_MEDEFFECTF2,             /* delay note */\r
-  UNI_MEDEFFECTF3,             /* play note three times */\r
-\r
-  UNI_LAST\r
-};\r
-\r
-extern UWORD unioperands[UNI_LAST];\r
-\r
-/* IT / S3M Extended SS effects: */\r
-enum\r
-{\r
-  SS_GLISSANDO = 1,\r
-  SS_FINETUNE,\r
-  SS_VIBWAVE,\r
-  SS_TREMWAVE,\r
-  SS_PANWAVE,\r
-  SS_FRAMEDELAY,\r
-  SS_S7EFFECTS,\r
-  SS_PANNING,\r
-  SS_SURROUND,\r
-  SS_HIOFFSET,\r
-  SS_PATLOOP,\r
-  SS_NOTECUT,\r
-  SS_NOTEDELAY,\r
-  SS_PATDELAY\r
-};\r
-\r
-/* IT Volume column effects */\r
-enum\r
-{\r
-  VOL_VOLUME = 1,\r
-  VOL_PANNING,\r
-  VOL_VOLSLIDE,\r
-  VOL_PITCHSLIDEDN,\r
-  VOL_PITCHSLIDEUP,\r
-  VOL_PORTAMENTO,\r
-  VOL_VIBRATO\r
-};\r
-\r
-/* IT resonant filter information */\r
-\r
-#define FILT_CUT      0x80\r
-#define FILT_RESONANT 0x81\r
-\r
-typedef struct FILTER\r
-{\r
-    UBYTE filter, inf;\r
-}\r
-FILTER;\r
-\r
-/*========== Instruments */\r
-\r
-/* Instrument format flags */\r
-#define IF_OWNPAN       1\r
-#define IF_PITCHPAN     2\r
-\r
-/* Envelope flags: */\r
-#define EF_ON           1\r
-#define EF_SUSTAIN      2\r
-#define EF_LOOP         4\r
-#define EF_VOLENV       8\r
-\r
-/* New Note Action Flags */\r
-#define NNA_CUT         0\r
-#define NNA_CONTINUE    1\r
-#define NNA_OFF         2\r
-#define NNA_FADE        3\r
-\r
-#define NNA_MASK        3\r
-\r
-#define DCT_OFF         0\r
-#define DCT_NOTE        1\r
-#define DCT_SAMPLE      2\r
-#define DCT_INST        3\r
-\r
-#define DCA_CUT         0\r
-#define DCA_OFF         1\r
-#define DCA_FADE        2\r
-\r
-#define KEY_KICK        0\r
-#define KEY_OFF         1\r
-#define KEY_FADE        2\r
-#define KEY_KILL        (KEY_OFF|KEY_FADE)\r
-\r
-#define KICK_ABSENT     0\r
-#define KICK_NOTE       1\r
-#define KICK_KEYOFF     2\r
-#define KICK_ENV        4\r
-\r
-#define AV_IT           1      /* IT vs. XM vibrato info */\r
-\r
-\r
-/*\r
- *    ========== Samples\r
- */\r
-\r
-/* Sample format [loading and in-memory] flags: */\r
-#define SF_16BITS       0x0001\r
-#define SF_STEREO       0x0002\r
-#define SF_SIGNED       0x0004\r
-#define SF_BIG_ENDIAN   0x0008\r
-#define SF_DELTA        0x0010\r
-#define SF_ITPACKED    0x0020\r
-\r
-#define        SF_FORMATMASK   0x003F\r
-\r
-/* General Playback flags */\r
-\r
-#define SF_LOOP         0x0100\r
-#define SF_BIDI         0x0200\r
-#define SF_REVERSE      0x0400\r
-#define SF_SUSTAIN      0x0800\r
-\r
-#define SF_PLAYBACKMASK        0x0C00\r
-\r
-/* Module-only Playback Flags */\r
-\r
-#define SF_OWNPAN      0x1000\r
-#define SF_UST_LOOP     0x2000\r
-\r
-#define SF_EXTRAPLAYBACKMASK   0x3000\r
-\r
-/* Panning constants */\r
-#define PAN_LEFT       0\r
-#define PAN_CENTER   128\r
-#define PAN_RIGHT    255\r
-#define PAN_SURROUND 512       /* panning value for Dolby Surround */\r
-\r
-/* This stuff is all filled -- it's up to you whether to implement it. */\r
-typedef struct SAMPLE\r
-{\r
-  SWORD panning;               /* panning (0-255 or PAN_SURROUND) */\r
-  ULONG speed;         /* Base playing speed/frequency of note */\r
-  UBYTE volume;                /* volume 0-64 */\r
-  UWORD inflags;               /* sample format on disk */\r
-  UWORD flags;         /* sample format in memory */\r
-  ULONG length;                /* length of sample (in samples!) */\r
-  ULONG loopstart;             /* repeat position (relative to start, in samples) */\r
-  ULONG loopend;               /* repeat end */\r
-  ULONG susbegin;              /* sustain loop begin (in samples) */\r
-  ULONG susend;                /* sustain loop end                */\r
-\r
-  UBYTE globvol;               /* global volume */\r
-  UBYTE vibflags;              /* autovibrato flag stuffs */\r
-  UBYTE vibtype;               /* Vibratos moved from INSTRUMENT to SAMPLE */\r
-  UBYTE vibsweep;\r
-  UBYTE vibdepth;\r
-  UBYTE vibrate;\r
-  CHAR *samplename;            /* name of the sample */\r
-\r
-  UWORD id;                    /* available for user */\r
-  UBYTE divfactor;             /* for sample scaling */\r
-  ULONG seekpos;               /* seek position in file -- internal */\r
-  SWORD *data;                 /* ptr to actual sample data */\r
-}\r
-SAMPLE;\r
-\r
-/*\r
- *    ========== Internal module representation (UniMod)\r
- */\r
-\r
-/*\r
-   Instrument definition - for information only, the only field which may be\r
-   of use in user programs is the name field\r
- */\r
-\r
-/* Instrument note count */\r
-#define INSTNOTES 120\r
-\r
-/* Envelope point */\r
-typedef struct ENVPT\r
-{\r
-  SWORD pos;\r
-  SWORD val;\r
-}\r
-ENVPT;\r
-\r
-/* Envelope point count */\r
-#define ENVPOINTS 32\r
-\r
-/* Instrument structure */\r
-typedef struct INSTRUMENT\r
-{\r
-  CHAR *insname;\r
-\r
-  UBYTE flags;\r
-  UWORD samplenumber[INSTNOTES];\r
-  UBYTE samplenote[INSTNOTES];\r
-\r
-  UBYTE nnatype;\r
-  UBYTE dca;           /* duplicate check action */\r
-  UBYTE dct;           /* duplicate check type */\r
-  UBYTE globvol;\r
-  UWORD volfade;\r
-  SWORD panning;               /* instrument-based panning var */\r
-\r
-  UBYTE pitpansep;             /* pitch pan separation (0 to 255) */\r
-  UBYTE pitpancenter;  /* pitch pan center (0 to 119) */\r
-  UBYTE rvolvar;               /* random volume varations (0 - 100%) */\r
-  UBYTE rpanvar;               /* random panning varations (0 - 100%) */\r
-\r
-  /* volume envelope */\r
-  UBYTE volflg;                /* bit 0: on 1: sustain 2: loop */\r
-  UBYTE volpts;\r
-  UBYTE volsusbeg;\r
-  UBYTE volsusend;\r
-  UBYTE volbeg;\r
-  UBYTE volend;\r
-  ENVPT volenv[ENVPOINTS];\r
-  /* panning envelope */\r
-  UBYTE panflg;                /* bit 0: on 1: sustain 2: loop */\r
-  UBYTE panpts;\r
-  UBYTE pansusbeg;\r
-  UBYTE pansusend;\r
-  UBYTE panbeg;\r
-  UBYTE panend;\r
-  ENVPT panenv[ENVPOINTS];\r
-  /* pitch envelope */\r
-  UBYTE pitflg;                /* bit 0: on 1: sustain 2: loop */\r
-  UBYTE pitpts;\r
-  UBYTE pitsusbeg;\r
-  UBYTE pitsusend;\r
-  UBYTE pitbeg;\r
-  UBYTE pitend;\r
-  ENVPT pitenv[ENVPOINTS];\r
-}\r
-INSTRUMENT;\r
-\r
-/* Module flags */\r
-#define UF_XMPERIODS 0x0001    /* XM periods / finetuning */\r
-#define UF_LINEAR    0x0002    /* LINEAR periods (UF_XMPERIODS must be set) */\r
-#define UF_INST      0x0004    /* Instruments are used */\r
-#define UF_NNA       0x0008    /* IT: NNA used, set numvoices rather than numchn */\r
-#define UF_S3MSLIDES 0x0010    /* uses old S3M volume slides */\r
-#define UF_BGSLIDES  0x0020    /* continue volume slides in the background */\r
-#define UF_HIGHBPM   0x0040    /* MED: can use >255 bpm */\r
-#define UF_NOWRAP    0x0080    /* XM-type (i.e. illogical) pattern brk semantics */\r
-#define UF_ARPMEM    0x0100    /* IT: need arpeggio memory */\r
-#define UF_FT2QUIRKS 0x0200    /* emulate some FT2 replay quirks */\r
-\r
-typedef struct MODULE\r
-{\r
-  /* general module information */\r
-  CHAR *songname;              /* name of the song */\r
-  CHAR *modtype;               /* string type of module loaded */\r
-  CHAR *comment;               /* module comments */\r
-\r
-  UWORD flags;         /* See module flags above */\r
-  UBYTE numchn;                /* number of module channels */\r
-  UBYTE numvoices;             /* max # voices used for full NNA playback */\r
-  UWORD numpos;                /* number of positions in this song */\r
-  UWORD numpat;                /* number of patterns in this song */\r
-  UWORD numins;                /* number of instruments */\r
-  UWORD numsmp;                /* number of samples */\r
-  INSTRUMENT *instruments;     /* all instruments */\r
-  SAMPLE *samples;             /* all samples */\r
-\r
-  /* playback settings */\r
-  UWORD reppos;                /* restart position */\r
-  UBYTE initspeed;             /* initial song speed */\r
-  UWORD inittempo;             /* initial song tempo */\r
-  UBYTE initvolume;            /* initial global volume (0 - 128) */\r
-  UWORD panning[64];   /* 64 panning positions */\r
-  UBYTE chanvol[64];   /* 64 channel positions */\r
-  UWORD bpm;           /* current beats-per-minute speed */\r
-\r
-  /* internal module representation */\r
-  UWORD numtrk;                /* number of tracks */\r
-  UBYTE **tracks;              /* array of numtrk pointers to tracks */\r
-  UWORD *patterns;             /* array of Patterns */\r
-  UWORD *pattrows;             /* array of number of rows for each pattern */\r
-  UWORD *positions;            /* all positions */\r
-}\r
-  MODULE;\r
-\r
-/* used to convert c4spd to linear XM periods (IT and IMF loaders). */\r
-extern UWORD finetune[];\r
-extern UWORD getlinearperiod (UWORD, ULONG);\r
-extern UWORD getoldperiod (UWORD, ULONG);\r
-extern ULONG getfrequency (UBYTE, ULONG);\r
-extern ULONG getAmigaPeriod (UBYTE, ULONG);\r
-\r
-/*\r
- *    ========== External interface\r
- */\r
-\r
-extern UWORD finetune[];\r
-extern BOOL ML_8bitsamples;\r
-extern BOOL ML_monosamples;\r
-extern CHAR *ML_InfoLoader (void);\r
-extern void ML_RegisterAllLoaders (void);\r
-extern BOOL ML_Test (URL);\r
-extern MODULE *ML_Load (URL, int, BOOL);\r
-extern CHAR *ML_LoadTitle (URL);\r
-extern void ML_Free (MODULE *);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
-/* ex:set ts=4: */\r
+/*      MikMod sound library
+   (c) 1998, 1999 Miodrag Vallat and others - see file AUTHORS for
+   complete list.
+
+   This library is free software; you can redistribute it and/or modify
+   it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of
+   the License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+ */
+
+/*==============================================================================
+
+  $Id: unimod.h,v 1.35 1999/10/25 16:31:41 miod Exp $
+
+  MikMod sound library include file
+
+==============================================================================*/
+
+#ifndef _UNIMOD_H_
+#define _UNIMOD_H_
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "url.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*
+ *    ========== Platform independent-type definitions
+ */
+
+#ifdef __W32__
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <io.h>
+#elif defined(__OS2__)||defined(__EMX__)
+#define INCL_DOSSEMAPHORES
+#include <os2.h>
+#else
+typedef char CHAR;
+#endif
+
+#if defined(__alpha)
+/* 64 bit architectures */
+
+typedef signed char SBYTE;     /* 1 byte, signed */
+typedef unsigned char UBYTE;   /* 1 byte, unsigned */
+typedef signed short SWORD;    /* 2 bytes, signed */
+typedef unsigned short UWORD;  /* 2 bytes, unsigned */
+typedef signed int SLONG;      /* 4 bytes, signed */
+typedef unsigned int ULONG;    /* 4 bytes, unsigned */
+typedef int BOOL;              /* 0=false, <>0 true */
+
+#else
+/* 32 bit architectures */
+
+typedef signed char SBYTE;     /* 1 byte, signed */
+typedef unsigned char UBYTE;   /* 1 byte, unsigned */
+typedef signed short SWORD;    /* 2 bytes, signed */
+typedef unsigned short UWORD;  /* 2 bytes, unsigned */
+typedef signed long SLONG;     /* 4 bytes, signed */
+#if !defined(__OS2__)&&!defined(__EMX__)&&!defined(__W32__)
+typedef unsigned long ULONG;   /* 4 bytes, unsigned */
+typedef int BOOL;              /* 0=false, <>0 true */
+#endif
+#endif
+
+/*
+ *    ========== Error handling and error codes
+ */
+
+extern int ML_errno;
+extern char *ML_strerror (int);
+
+enum
+{
+  MMERR_OPENING_FILE = 1,
+  MMERR_OUT_OF_MEMORY,
+  MMERR_DYNAMIC_LINKING,
+
+  MMERR_SAMPLE_TOO_BIG,
+  MMERR_OUT_OF_HANDLES,
+  MMERR_UNKNOWN_WAVE_TYPE,
+
+  MMERR_LOADING_PATTERN,
+  MMERR_LOADING_TRACK,
+  MMERR_LOADING_HEADER,
+  MMERR_LOADING_SAMPLEINFO,
+  MMERR_NOT_A_MODULE,
+  MMERR_NOT_A_STREAM,
+  MMERR_MED_SYNTHSAMPLES,
+  MMERR_ITPACK_INVALID_DATA,
+
+  MMERR_MAX
+};
+
+/*========== Internal module representation (UniMod) interface */
+
+/* number of notes in an octave */
+#define OCTAVE 12
+
+extern void UniSetRow (UBYTE *);
+extern UBYTE UniGetByte (void);
+extern UWORD UniGetWord (void);
+extern UBYTE *UniFindRow (UBYTE *, UWORD);
+extern void UniSkipOpcode (UBYTE);
+extern void UniReset (void);
+extern void UniWriteByte (UBYTE);
+extern void UniWriteWord (UWORD);
+extern void UniNewline (void);
+extern UBYTE *UniDup (void);
+extern BOOL UniInit (void);
+extern void UniCleanup (void);
+extern void UniEffect (UWORD, UWORD);
+#define UniInstrument(x) UniEffect(UNI_INSTRUMENT,x)
+#define UniNote(x) UniEffect(UNI_NOTE,x)
+extern void UniPTEffect (UBYTE, UBYTE);
+extern void UniVolEffect (UWORD, UBYTE);
+
+/*========== Module Commands */
+
+enum
+{
+  /* Simple note */
+  UNI_NOTE = 1,
+  /* Instrument change */
+  UNI_INSTRUMENT,
+  /* Protracker effects */
+  UNI_PTEFFECT0,               /* arpeggio */
+  UNI_PTEFFECT1,               /* porta up */
+  UNI_PTEFFECT2,               /* porta down */
+  UNI_PTEFFECT3,               /* porta to note */
+  UNI_PTEFFECT4,               /* vibrato */
+  UNI_PTEFFECT5,               /* dual effect 3+A */
+  UNI_PTEFFECT6,               /* dual effect 4+A */
+  UNI_PTEFFECT7,               /* tremolo */
+  UNI_PTEFFECT8,               /* pan */
+  UNI_PTEFFECT9,               /* sample offset */
+  UNI_PTEFFECTA,               /* volume slide */
+  UNI_PTEFFECTB,               /* pattern jump */
+  UNI_PTEFFECTC,               /* set volume */
+  UNI_PTEFFECTD,               /* pattern break */
+  UNI_PTEFFECTE,               /* extended effects */
+  UNI_PTEFFECTF,               /* set speed */
+  /* Scream Tracker effects */
+  UNI_S3MEFFECTA,              /* set speed */
+  UNI_S3MEFFECTD,              /* volume slide */
+  UNI_S3MEFFECTE,              /* porta down */
+  UNI_S3MEFFECTF,              /* porta up */
+  UNI_S3MEFFECTI,              /* tremor */
+  UNI_S3MEFFECTQ,              /* retrig */
+  UNI_S3MEFFECTR,              /* tremolo */
+  UNI_S3MEFFECTT,              /* set tempo */
+  UNI_S3MEFFECTU,              /* fine vibrato */
+  UNI_KEYOFF,          /* note off */
+  /* Fast Tracker effects */
+  UNI_KEYFADE,         /* note fade */
+  UNI_VOLEFFECTS,              /* volume column effects */
+  UNI_XMEFFECT4,               /* vibrato */
+  UNI_XMEFFECTA,               /* volume slide */
+  UNI_XMEFFECTE1,              /* fine porta up */
+  UNI_XMEFFECTE2,              /* fine porta down */
+  UNI_XMEFFECTEA,              /* fine volume slide up */
+  UNI_XMEFFECTEB,              /* fine volume slide down */
+  UNI_XMEFFECTG,               /* set global volume */
+  UNI_XMEFFECTH,               /* global volume slide */
+  UNI_XMEFFECTL,               /* set envelope position */
+  UNI_XMEFFECTP,               /* pan slide */
+  UNI_XMEFFECTX1,              /* extra fine porta up */
+  UNI_XMEFFECTX2,              /* extra fine porta down */
+  /* Impulse Tracker effects */
+  UNI_ITEFFECTG,               /* porta to note */
+  UNI_ITEFFECTH,               /* vibrato */
+  UNI_ITEFFECTI,               /* tremor (xy not incremented) */
+  UNI_ITEFFECTM,               /* set channel volume */
+  UNI_ITEFFECTN,               /* slide / fineslide channel volume */
+  UNI_ITEFFECTP,               /* slide / fineslide channel panning */
+  UNI_ITEFFECTT,               /* slide tempo */
+  UNI_ITEFFECTU,               /* fine vibrato */
+  UNI_ITEFFECTW,               /* slide / fineslide global volume */
+  UNI_ITEFFECTY,               /* panbrello */
+  UNI_ITEFFECTZ,               /* resonant filters */
+  UNI_ITEFFECTS0,
+  /* UltraTracker effects */
+  UNI_ULTEFFECT9,              /* Sample fine offset */
+  /* OctaMED effects */
+  UNI_MEDSPEED,
+  UNI_MEDEFFECTF1,             /* play note twice */
+  UNI_MEDEFFECTF2,             /* delay note */
+  UNI_MEDEFFECTF3,             /* play note three times */
+
+  UNI_LAST
+};
+
+extern UWORD unioperands[UNI_LAST];
+
+/* IT / S3M Extended SS effects: */
+enum
+{
+  SS_GLISSANDO = 1,
+  SS_FINETUNE,
+  SS_VIBWAVE,
+  SS_TREMWAVE,
+  SS_PANWAVE,
+  SS_FRAMEDELAY,
+  SS_S7EFFECTS,
+  SS_PANNING,
+  SS_SURROUND,
+  SS_HIOFFSET,
+  SS_PATLOOP,
+  SS_NOTECUT,
+  SS_NOTEDELAY,
+  SS_PATDELAY
+};
+
+/* IT Volume column effects */
+enum
+{
+  VOL_VOLUME = 1,
+  VOL_PANNING,
+  VOL_VOLSLIDE,
+  VOL_PITCHSLIDEDN,
+  VOL_PITCHSLIDEUP,
+  VOL_PORTAMENTO,
+  VOL_VIBRATO
+};
+
+/* IT resonant filter information */
+
+#define FILT_CUT      0x80
+#define FILT_RESONANT 0x81
+
+typedef struct FILTER
+{
+    UBYTE filter, inf;
+}
+FILTER;
+
+/*========== Instruments */
+
+/* Instrument format flags */
+#define IF_OWNPAN       1
+#define IF_PITCHPAN     2
+
+/* Envelope flags: */
+#define EF_ON           1
+#define EF_SUSTAIN      2
+#define EF_LOOP         4
+#define EF_VOLENV       8
+
+/* New Note Action Flags */
+#define NNA_CUT         0
+#define NNA_CONTINUE    1
+#define NNA_OFF         2
+#define NNA_FADE        3
+
+#define NNA_MASK        3
+
+#define DCT_OFF         0
+#define DCT_NOTE        1
+#define DCT_SAMPLE      2
+#define DCT_INST        3
+
+#define DCA_CUT         0
+#define DCA_OFF         1
+#define DCA_FADE        2
+
+#define KEY_KICK        0
+#define KEY_OFF         1
+#define KEY_FADE        2
+#define KEY_KILL        (KEY_OFF|KEY_FADE)
+
+#define KICK_ABSENT     0
+#define KICK_NOTE       1
+#define KICK_KEYOFF     2
+#define KICK_ENV        4
+
+#define AV_IT           1      /* IT vs. XM vibrato info */
+
+
+/*
+ *    ========== Samples
+ */
+
+/* Sample format [loading and in-memory] flags: */
+#define SF_16BITS       0x0001
+#define SF_STEREO       0x0002
+#define SF_SIGNED       0x0004
+#define SF_BIG_ENDIAN   0x0008
+#define SF_DELTA        0x0010
+#define SF_ITPACKED    0x0020
+
+#define        SF_FORMATMASK   0x003F
+
+/* General Playback flags */
+
+#define SF_LOOP         0x0100
+#define SF_BIDI         0x0200
+#define SF_REVERSE      0x0400
+#define SF_SUSTAIN      0x0800
+
+#define SF_PLAYBACKMASK        0x0C00
+
+/* Module-only Playback Flags */
+
+#define SF_OWNPAN      0x1000
+#define SF_UST_LOOP     0x2000
+
+#define SF_EXTRAPLAYBACKMASK   0x3000
+
+/* Panning constants */
+#define PAN_LEFT       0
+#define PAN_CENTER   128
+#define PAN_RIGHT    255
+#define PAN_SURROUND 512       /* panning value for Dolby Surround */
+
+/* This stuff is all filled -- it's up to you whether to implement it. */
+typedef struct SAMPLE
+{
+  SWORD panning;               /* panning (0-255 or PAN_SURROUND) */
+  ULONG speed;         /* Base playing speed/frequency of note */
+  UBYTE volume;                /* volume 0-64 */
+  UWORD inflags;               /* sample format on disk */
+  UWORD flags;         /* sample format in memory */
+  ULONG length;                /* length of sample (in samples!) */
+  ULONG loopstart;             /* repeat position (relative to start, in samples) */
+  ULONG loopend;               /* repeat end */
+  ULONG susbegin;              /* sustain loop begin (in samples) */
+  ULONG susend;                /* sustain loop end                */
+
+  UBYTE globvol;               /* global volume */
+  UBYTE vibflags;              /* autovibrato flag stuffs */
+  UBYTE vibtype;               /* Vibratos moved from INSTRUMENT to SAMPLE */
+  UBYTE vibsweep;
+  UBYTE vibdepth;
+  UBYTE vibrate;
+  CHAR *samplename;            /* name of the sample */
+
+  UWORD id;                    /* available for user */
+  UBYTE divfactor;             /* for sample scaling */
+  ULONG seekpos;               /* seek position in file -- internal */
+  SWORD *data;                 /* ptr to actual sample data */
+}
+SAMPLE;
+
+/*
+ *    ========== Internal module representation (UniMod)
+ */
+
+/*
+   Instrument definition - for information only, the only field which may be
+   of use in user programs is the name field
+ */
+
+/* Instrument note count */
+#define INSTNOTES 120
+
+/* Envelope point */
+typedef struct ENVPT
+{
+  SWORD pos;
+  SWORD val;
+}
+ENVPT;
+
+/* Envelope point count */
+#define ENVPOINTS 32
+
+/* Instrument structure */
+typedef struct INSTRUMENT
+{
+  CHAR *insname;
+
+  UBYTE flags;
+  UWORD samplenumber[INSTNOTES];
+  UBYTE samplenote[INSTNOTES];
+
+  UBYTE nnatype;
+  UBYTE dca;           /* duplicate check action */
+  UBYTE dct;           /* duplicate check type */
+  UBYTE globvol;
+  UWORD volfade;
+  SWORD panning;               /* instrument-based panning var */
+
+  UBYTE pitpansep;             /* pitch pan separation (0 to 255) */
+  UBYTE pitpancenter;  /* pitch pan center (0 to 119) */
+  UBYTE rvolvar;               /* random volume varations (0 - 100%) */
+  UBYTE rpanvar;               /* random panning varations (0 - 100%) */
+
+  /* volume envelope */
+  UBYTE volflg;                /* bit 0: on 1: sustain 2: loop */
+  UBYTE volpts;
+  UBYTE volsusbeg;
+  UBYTE volsusend;
+  UBYTE volbeg;
+  UBYTE volend;
+  ENVPT volenv[ENVPOINTS];
+  /* panning envelope */
+  UBYTE panflg;                /* bit 0: on 1: sustain 2: loop */
+  UBYTE panpts;
+  UBYTE pansusbeg;
+  UBYTE pansusend;
+  UBYTE panbeg;
+  UBYTE panend;
+  ENVPT panenv[ENVPOINTS];
+  /* pitch envelope */
+  UBYTE pitflg;                /* bit 0: on 1: sustain 2: loop */
+  UBYTE pitpts;
+  UBYTE pitsusbeg;
+  UBYTE pitsusend;
+  UBYTE pitbeg;
+  UBYTE pitend;
+  ENVPT pitenv[ENVPOINTS];
+}
+INSTRUMENT;
+
+/* Module flags */
+#define UF_XMPERIODS 0x0001    /* XM periods / finetuning */
+#define UF_LINEAR    0x0002    /* LINEAR periods (UF_XMPERIODS must be set) */
+#define UF_INST      0x0004    /* Instruments are used */
+#define UF_NNA       0x0008    /* IT: NNA used, set numvoices rather than numchn */
+#define UF_S3MSLIDES 0x0010    /* uses old S3M volume slides */
+#define UF_BGSLIDES  0x0020    /* continue volume slides in the background */
+#define UF_HIGHBPM   0x0040    /* MED: can use >255 bpm */
+#define UF_NOWRAP    0x0080    /* XM-type (i.e. illogical) pattern brk semantics */
+#define UF_ARPMEM    0x0100    /* IT: need arpeggio memory */
+#define UF_FT2QUIRKS 0x0200    /* emulate some FT2 replay quirks */
+
+typedef struct MODULE
+{
+  /* general module information */
+  CHAR *songname;              /* name of the song */
+  CHAR *modtype;               /* string type of module loaded */
+  CHAR *comment;               /* module comments */
+
+  UWORD flags;         /* See module flags above */
+  UBYTE numchn;                /* number of module channels */
+  UBYTE numvoices;             /* max # voices used for full NNA playback */
+  UWORD numpos;                /* number of positions in this song */
+  UWORD numpat;                /* number of patterns in this song */
+  UWORD numins;                /* number of instruments */
+  UWORD numsmp;                /* number of samples */
+  INSTRUMENT *instruments;     /* all instruments */
+  SAMPLE *samples;             /* all samples */
+
+  /* playback settings */
+  UWORD reppos;                /* restart position */
+  UBYTE initspeed;             /* initial song speed */
+  UWORD inittempo;             /* initial song tempo */
+  UBYTE initvolume;            /* initial global volume (0 - 128) */
+  UWORD panning[64];   /* 64 panning positions */
+  UBYTE chanvol[64];   /* 64 channel positions */
+  UWORD bpm;           /* current beats-per-minute speed */
+
+  /* internal module representation */
+  UWORD numtrk;                /* number of tracks */
+  UBYTE **tracks;              /* array of numtrk pointers to tracks */
+  UWORD *patterns;             /* array of Patterns */
+  UWORD *pattrows;             /* array of number of rows for each pattern */
+  UWORD *positions;            /* all positions */
+}
+  MODULE;
+
+/* used to convert c4spd to linear XM periods (IT and IMF loaders). */
+extern UWORD finetune[];
+extern UWORD getlinearperiod (UWORD, ULONG);
+extern UWORD getlogperiod (UWORD note, ULONG fine);
+extern UWORD getoldperiod (UWORD, ULONG);
+extern ULONG getfrequency (UBYTE, ULONG);
+extern ULONG getAmigaPeriod (UBYTE, ULONG);
+
+/*
+ *    ========== External interface
+ */
+
+extern UWORD finetune[];
+extern BOOL ML_8bitsamples;
+extern BOOL ML_monosamples;
+extern CHAR *ML_InfoLoader (void);
+extern void ML_RegisterAllLoaders (void);
+extern BOOL ML_Test (URL);
+extern MODULE *ML_Load (URL, int, BOOL);
+extern CHAR *ML_LoadTitle (URL);
+extern void ML_Free (MODULE *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* ex:set ts=4: */
index e49db20..4aaf0df 100644 (file)
-/*      MikMod sound library\r
-   (c) 1998, 1999 Miodrag Vallat and others - see file AUTHORS for\r
-   complete list.\r
-\r
-   This library is free software; you can redistribute it and/or modify\r
-   it under the terms of the GNU Library General Public License as\r
-   published by the Free Software Foundation; either version 2 of\r
-   the License, or (at your option) any later version.\r
-\r
-   This program is distributed in the hope that it will be useful,\r
-   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-   GNU Library General Public License for more details.\r
-\r
-   You should have received a copy of the GNU Library General Public\r
-   License along with this library; if not, write to the Free Software\r
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA\r
-   02111-1307, USA.\r
- */\r
-\r
-/*==============================================================================\r
-\r
-  $Id: unimod_priv.h,v 1.23 1999/10/25 16:31:41 miod Exp $\r
-\r
-  MikMod sound library internal definitions\r
-\r
-==============================================================================*/\r
-\r
-#ifndef _UNIMOD_PRIV_H\r
-#define _UNIMOD_PRIV_H\r
-\r
-#ifdef __cplusplus\r
-extern "C"\r
-{\r
-#endif\r
-\r
-#ifdef HAVE_MALLOC_H\r
-#include <malloc.h>\r
-#endif\r
-#include <stdarg.h>\r
-#if defined(__OS2__)||defined(__EMX__)||defined(WIN32)\r
-#define strcasecmp(s,t) stricmp(s,t)\r
-#endif\r
-\r
-#include "unimod.h"\r
-#include "url.h"\r
-\r
-#ifdef WIN32\r
-#pragma warning(disable:4761)\r
-#endif\r
-\r
-/*========== Error handling */\r
-\r
-#define _mm_errno ML_errno\r
-\r
-/*========== Memory allocation */\r
-\r
-extern void *_mm_malloc (size_t);\r
-extern void *_mm_calloc (size_t, size_t);\r
-#define _mm_free(p) do { if (p) free(p); p = NULL; } while(0)\r
-\r
-/*========== Portable file I/O */\r
-\r
-#define _mm_read_SBYTE(x)      ((SBYTE)url_getc(x))\r
-#define _mm_read_UBYTE(x)      ((UBYTE)url_getc(x))\r
-#define _mm_read_SBYTES(x,y,z) url_nread(z,(void *)x,y)\r
-#define _mm_read_UBYTES(x,y,z) url_nread(z,(void *)x,y)\r
-#define _mm_fseek(x,y,z)       url_seek(x,y,z)\r
-#define _mm_ftell(x)           url_tell(x)\r
-#define _mm_eof(x)             url_eof(x)\r
-#define _mm_rewind(x)          _mm_fseek(x,0,SEEK_SET)\r
-\r
-extern int _mm_read_string (CHAR *, int, URL);\r
-\r
-extern SWORD _mm_read_M_SWORD (URL);\r
-extern SWORD _mm_read_I_SWORD (URL);\r
-extern UWORD _mm_read_M_UWORD (URL);\r
-extern UWORD _mm_read_I_UWORD (URL);\r
-\r
-extern SLONG _mm_read_M_SLONG (URL);\r
-extern SLONG _mm_read_I_SLONG (URL);\r
-extern ULONG _mm_read_M_ULONG (URL);\r
-extern ULONG _mm_read_I_ULONG (URL);\r
-\r
-extern int _mm_read_M_SWORDS (SWORD *, int, URL);\r
-extern int _mm_read_I_SWORDS (SWORD *, int, URL);\r
-extern int _mm_read_M_UWORDS (UWORD *, int, URL);\r
-extern int _mm_read_I_UWORDS (UWORD *, int, URL);\r
-\r
-extern int _mm_read_M_SLONGS (SLONG *, int, URL);\r
-extern int _mm_read_I_SLONGS (SLONG *, int, URL);\r
-extern int _mm_read_M_ULONGS (ULONG *, int, URL);\r
-extern int _mm_read_I_ULONGS (ULONG *, int, URL);\r
-\r
-\r
-/*========== Loaders */\r
-\r
-typedef struct MLOADER\r
-{\r
-  struct MLOADER *next;\r
-  CHAR *type;\r
-  CHAR *version;\r
-  BOOL (*Init) (void);\r
-  BOOL (*Test) (void);\r
-  BOOL (*Load) (BOOL);\r
-  void (*Cleanup) (void);\r
-  CHAR *(*LoadTitle) (void);\r
-}\r
-MLOADER;\r
-\r
-/* internal loader variables: */\r
-extern URL modreader;\r
-extern UWORD finetune[16];\r
-extern MODULE of;              /* static unimod loading space */\r
-\r
-extern SBYTE remap[64];        /* for removing empty channels */\r
-extern UBYTE *poslookup;       /* lookup table for pattern jumps after\r
-                                blank pattern removal */\r
-extern UBYTE poslookupcnt;\r
-extern UWORD *origpositions;\r
-\r
-extern BOOL filters;           /* resonant filters in use */\r
-extern UBYTE activemacro;      /* active midi macro number for Sxx */\r
-extern UBYTE filtermacros[16]; /* midi macros settings */\r
-extern FILTER filtersettings[256];     /* computed filter settings */\r
-\r
-extern int *noteindex;\r
-\r
-/*========== Internal loader interface */\r
-\r
-extern BOOL ReadComment (UWORD);\r
-extern BOOL ReadLinedComment (UWORD, UWORD);\r
-extern BOOL AllocPositions (int);\r
-extern BOOL AllocPatterns (void);\r
-extern BOOL AllocTracks (void);\r
-extern BOOL AllocInstruments (void);\r
-extern BOOL AllocSamples (void);\r
-extern CHAR *DupStr (CHAR *, UWORD, BOOL);\r
-\r
-/* loader utility functions */\r
-extern int *AllocLinear (void);\r
-extern void FreeLinear (void);\r
-extern int speed_to_finetune (ULONG, int);\r
-extern void S3MIT_ProcessCmd (UBYTE, UBYTE, BOOL);\r
-extern void S3MIT_CreateOrders (BOOL);\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif\r
-\r
-/* ex:set ts=4: */\r
+/*      MikMod sound library
+   (c) 1998, 1999 Miodrag Vallat and others - see file AUTHORS for
+   complete list.
+
+   This library is free software; you can redistribute it and/or modify
+   it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of
+   the License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+   02111-1307, USA.
+ */
+
+/*==============================================================================
+
+  $Id: unimod_priv.h,v 1.23 1999/10/25 16:31:41 miod Exp $
+
+  MikMod sound library internal definitions
+
+==============================================================================*/
+
+#ifndef _UNIMOD_PRIV_H
+#define _UNIMOD_PRIV_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#include <stdarg.h>
+#if defined(__OS2__)||defined(__EMX__)||defined(__W32__)
+#define strcasecmp(s,t) stricmp(s,t)
+#endif
+
+#include "unimod.h"
+#include "url.h"
+
+#ifdef __W32__
+#pragma warning(disable:4761)
+#endif
+
+/*========== Error handling */
+
+#define _mm_errno ML_errno
+
+/*========== Memory allocation */
+
+extern void *_mm_malloc (size_t);
+extern void *_mm_calloc (size_t, size_t);
+#define _mm_free(p) do { if (p) free(p); p = NULL; } while(0)
+
+/*========== Portable file I/O */
+
+#define _mm_read_SBYTE(x)      ((SBYTE)url_getc(x))
+#define _mm_read_UBYTE(x)      ((UBYTE)url_getc(x))
+#define _mm_read_SBYTES(x,y,z) url_nread(z,(void *)x,y)
+#define _mm_read_UBYTES(x,y,z) url_nread(z,(void *)x,y)
+#define _mm_fseek(x,y,z)       url_seek(x,y,z)
+#define _mm_ftell(x)           url_tell(x)
+#define _mm_eof(x)             url_eof(x)
+#define _mm_rewind(x)          _mm_fseek(x,0,SEEK_SET)
+
+extern int _mm_read_string (CHAR *, int, URL);
+
+extern SWORD _mm_read_M_SWORD (URL);
+extern SWORD _mm_read_I_SWORD (URL);
+extern UWORD _mm_read_M_UWORD (URL);
+extern UWORD _mm_read_I_UWORD (URL);
+
+extern SLONG _mm_read_M_SLONG (URL);
+extern SLONG _mm_read_I_SLONG (URL);
+extern ULONG _mm_read_M_ULONG (URL);
+extern ULONG _mm_read_I_ULONG (URL);
+
+extern int _mm_read_M_SWORDS (SWORD *, int, URL);
+extern int _mm_read_I_SWORDS (SWORD *, int, URL);
+extern int _mm_read_M_UWORDS (UWORD *, int, URL);
+extern int _mm_read_I_UWORDS (UWORD *, int, URL);
+
+extern int _mm_read_M_SLONGS (SLONG *, int, URL);
+extern int _mm_read_I_SLONGS (SLONG *, int, URL);
+extern int _mm_read_M_ULONGS (ULONG *, int, URL);
+extern int _mm_read_I_ULONGS (ULONG *, int, URL);
+
+
+/*========== Loaders */
+
+typedef struct MLOADER
+{
+  struct MLOADER *next;
+  CHAR *type;
+  CHAR *version;
+  BOOL (*Init) (void);
+  BOOL (*Test) (void);
+  BOOL (*Load) (BOOL);
+  void (*Cleanup) (void);
+  CHAR *(*LoadTitle) (void);
+}
+MLOADER;
+
+/* internal loader variables: */
+extern URL modreader;
+extern UWORD finetune[16];
+extern MODULE of;              /* static unimod loading space */
+
+extern SBYTE remap[64];        /* for removing empty channels */
+extern UBYTE *poslookup;       /* lookup table for pattern jumps after
+                                blank pattern removal */
+extern UBYTE poslookupcnt;
+extern UWORD *origpositions;
+
+extern BOOL filters;           /* resonant filters in use */
+extern UBYTE activemacro;      /* active midi macro number for Sxx */
+extern UBYTE filtermacros[16]; /* midi macros settings */
+extern FILTER filtersettings[256];     /* computed filter settings */
+
+extern int *noteindex;
+
+/*========== Internal loader interface */
+
+extern BOOL ReadComment (UWORD);
+extern BOOL ReadLinedComment (UWORD, UWORD);
+extern BOOL AllocPositions (int);
+extern BOOL AllocPatterns (void);
+extern BOOL AllocTracks (void);
+extern BOOL AllocInstruments (void);
+extern BOOL AllocSamples (void);
+extern CHAR *DupStr (CHAR *, UWORD, BOOL);
+
+/* loader utility functions */
+extern int *AllocLinear (void);
+extern void FreeLinear (void);
+extern int speed_to_finetune (ULONG, int);
+extern void S3MIT_ProcessCmd (UBYTE, UBYTE, BOOL);
+extern void S3MIT_CreateOrders (BOOL);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* ex:set ts=4: */
index c579b13..7eb4cff 100644 (file)
@@ -88,7 +88,7 @@ enum {
     CTLE_CURRENT_TIME,         /* v1:secs, v2:voices */
     CTLE_NOTE,                 /* v1:status, v2:ch, v3:note, v4:velo */
     CTLE_MASTER_VOLUME,                /* v1:amp(%) */
-    CTLE_PROGRAM,              /* v1:ch, v2:prog, v3:name */
+    CTLE_PROGRAM,              /* v1:ch, v2:prog, v3:name, v4:bank,lsb.msb */
     CTLE_VOLUME,               /* v1:ch, v2:value */
     CTLE_EXPRESSION,           /* v1:ch, v2:value */
     CTLE_PANNING,              /* v1:ch, v2:value */
@@ -103,7 +103,8 @@ enum {
     CTLE_SPEANA,               /* v1:double[] v2:len */
     CTLE_PAUSE,                        /* v1:pause on/off v2:time of pause */
     CTLE_GSLCD,                        /* GS L.C.D. */
-    CTLE_MAXVOICES             /* v1:voices, Change voices */
+    CTLE_MAXVOICES,            /* v1:voices, Change voices */
+    CTLE_DRUMPART              /* v1:ch, v2:is_drum */
 };
 
 typedef struct _CtlEvent {
index 225b31f..9fbbb8c 100644 (file)
@@ -60,7 +60,6 @@ static BOOL mod_do_play (MODULE *);
 int 
 load_module_file (struct timidity_file *tf, int mod_type)
 {
-  int i, err;
   MODULE *mf;
 
 #ifdef LOOKUP_HACK
@@ -85,8 +84,6 @@ load_module_file (struct timidity_file *tf, int mod_type)
 int 
 get_module_type (char *fn)
 {
-  char *p;
-
   if (check_file_extension (fn, ".xm", 1)      /* Most common first */
       || check_file_extension (fn, ".s3m", 1)
       || check_file_extension (fn, ".mod", 1)
index 349213a..76cb86d 100644 (file)
@@ -36,3 +36,4 @@ void Voice_TickDone ();
 void Voice_StartPlaying ();\r
 void Voice_EndPlaying ();\r
 void load_module_samples (SAMPLE *, int);\r
+void Voice_SetPeriod (UBYTE v, ULONG period);\r
index bc95bac..020abc0 100644 (file)
@@ -1308,7 +1308,12 @@ static int find_samples(MidiEvent *e, int *vlist)
                          channel[ch].special_sample);
                return 0;
            }
-           return select_play_sample(s->sample, s->samples, e->a, vlist, e);
+           note = e->a + note_key_offset;
+           if(note < 0)
+               note = 0;
+           else if(note > 127)
+               note = 127;
+           return select_play_sample(s->sample, s->samples, note, vlist, e);
        }
 
        bk = channel[ch].bank;
@@ -4146,8 +4151,9 @@ int play_event(MidiEvent *ev)
        {
            /* Update bank information */
            midi_program_change(ch, channel[ch].program);
+           ctl_mode_event(CTLE_DRUMPART, 1, ch, ISDRUMCHANNEL(ch));
+           ctl_prog_event(ch);
        }
-       ctl_prog_event(ch);
        break;
 
       case ME_KEYSHIFT:
@@ -4598,10 +4604,26 @@ static void ctl_updatetime(int32 samples)
 static void ctl_prog_event(int ch)
 {
     CtlEvent ce;
+    int bank, prog;
+
+    if(IS_CURRENT_MOD_FILE)
+    {
+       bank = 0;
+       prog = channel[ch].special_sample;
+    }
+    else
+    {
+       bank = channel[ch].bank;
+       prog = channel[ch].program;
+    }
+
     ce.type = CTLE_PROGRAM;
     ce.v1 = ch;
-    ce.v2 = channel[ch].program;
+    ce.v2 = prog;
     ce.v3 = (long)channel_instrum_name(ch);
+    ce.v4 = (bank |
+            (channel[ch].bank_lsb << 8) |
+            (channel[ch].bank_msb << 16));
     if(ctl->trace_playing)
        push_midi_trace_ce(ctl->event, &ce);
     else
@@ -4618,7 +4640,7 @@ static void ctl_pause_event(int pause, int32 s)
 char *channel_instrum_name(int ch)
 {
     char *comm;
-    int bank;
+    int bank, prog;
 
     if(ISDRUMCHANNEL(ch))
        return "";
@@ -4637,11 +4659,13 @@ char *channel_instrum_name(int ch)
     }
 
     bank = channel[ch].bank;
+    prog = channel[ch].program;
+    instrument_map(channel[ch].mapID, &bank, &prog);
     if(tonebank[bank] == NULL)
        bank = 0;
-    comm = tonebank[bank]->tone[channel[ch].program].comment;
+    comm = tonebank[bank]->tone[prog].comment;
     if(comm == NULL)
-       comm = tonebank[0]->tone[channel[ch].program].comment;
+       comm = tonebank[0]->tone[prog].comment;
     return comm;
 }
 
index 4daa016..aaa99c9 100644 (file)
@@ -2607,12 +2607,8 @@ char *get_midi_title(char *filename)
        return NULL;
 
     mtype = get_module_type(filename);
-    if(mtype > 0)
-       check_cache = 1;
-    else
-       check_cache = check_need_cache(tf->url, filename);
-
-    if(check_cache)
+    check_cache = check_need_cache(tf->url, filename);
+    if(check_cache || mtype > 0)
     {
        if(!IS_URL_SEEK_SAFE(tf->url))
        {