OSDN Git Service

TiMidity++-2.6.1
authorMasanao Izumo <mo@goice.co.jp>
Mon, 27 Sep 1999 13:29:14 +0000 (22:29 +0900)
committerMasanao Izumo <mo@goice.co.jp>
Mon, 27 Sep 1999 13:29:14 +0000 (22:29 +0900)
12 files changed:
AUTHORS
ChangeLog
Makefile.in
NEWS
configs/msc-config.h
configure
configure.in
interface/w32g_i.c
timidity/playmidi.c
timidity/playmidi.h
timidity/readmidi.c
timidity/timidity.c

diff --git a/AUTHORS b/AUTHORS
index b388c77..8127a51 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,7 +2,7 @@ Version 0.2i and earlier:
      Tuukka Toivonen <tt@cgs.fi>
      Vincent Pagel <pagel@loria.fr>
      Takashi Iwai <iwai@ww.uni-erlangen.de>
-     Davide Moretti <dmoretti@iper.net>
+     Davide Moretti <dave@rimini.com>
      Chi Ming HUNG <cmhung@insti.physics.sunysb.edu>
      Riccardo Facchetti <riccardo@cdc8g5.cdc.polimi.it>
 
index 1a522a1..8739bcc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,20 +1,53 @@
-1999-09/21  Masanao Izumo <mo@goice.co.jp>
+1999-09-27  Masanao Izumo <mo@goice.co.jp>
+
+    * Version 2.6.1 released.
+
+1999-09-27  Masanao Izumo <mo@goice.co.jp>
+
+    * AUTHORS,timidity/timidity.c,timidity/w32g_i.c:
+      Changed E-mail address of Davide Moretti from <dmoretti@iper.net>
+      to <dave@rimini.com>
+
+1999-09-27  Eric A. Welsh <ewelsh@gpc.wustl.edu>
+
+    * timidity/{playmidi.h,playmidi.c}: Fixed bug of random panning.
+      Added new Channel structure member `int pan_random' for random pan flag.
+      Note that all of dynamic interfaces must be re-compiled,
+      because the size of `Channel' structure is changed.
+      
+1999-09-26  Eric A. Welsh <ewelsh@gpc.wustl.edu>
+
+    * timidity/readmidi.c (XG SysEx): Support for XG Multi Part Data
+      parameter change SysEx events.
+
+1999-09-25  Masanao Izumo <mo@goice.co.jp>
+
+    * timidity/{readmidi.c,playmidi.c}:
+      Set MSB/LSB bank zero by default, except that XG MSB Bank of channel 10
+      is 127 by default.
+
+1999-09-21  Eric A. Welsh <ewelsh@gpc.wustl.edu>
+
+    * timidity/timidity.c (-EFchorus=2): Bug fix.
+      Typo in timidity.c 2.6.0, opt_surround_chorus never set.
+
+1999-09-21  Masanao Izumo <mo@goice.co.jp>
 
     * Version 2.6.0 released.
 
-1999-09/21  Masanao Izumo <mo@goice.co.jp>
+1999-09-21  Masanao Izumo <mo@goice.co.jp>
 
     * timidity/rcp.c: Bug fix of SameMeassure.
     * interface/vt100_c.c (ctl_current_time): Bug fix of displaying bold.
 
-1999-09/20  Masanao Izumo <mo@goice.co.jp>
+1999-09-20  Masanao Izumo <mo@goice.co.jp>
 
     * timidity/aq.c (aq_samples): Save PM_REQ_GETSAMPLES value if the acntl()
       succeeds.
     * timidity/sun_a.c: Implement PM_REQ_GETFILLED and PM_REQ_GETSAMPLES of
       acntl().
 
-1999-09/17  Eric A. Welsh <ewelsh@gpc.wustl.edu>
+1999-09-17  Eric A. Welsh <ewelsh@gpc.wustl.edu>
 
     * timidity/{timidity.c,playmidi.c,playmidi.h} (new_chorus_voice_alternate):
       To use the surround sound instead of detuned chorus.
index 1eecb1a..bd6ff77 100644 (file)
@@ -350,7 +350,6 @@ distdir: $(DISTFILES)
          fi; \
        done
        $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
-
 info-am:
 info: info-recursive
 dvi-am:
diff --git a/NEWS b/NEWS
index bb49a85..38d5e03 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+9/27, 1999
+    * Version 2.6.1 released.
+    * Support for XG Multi Part Data parameter change SysEx events.
+    * Added new Channel structure member `int pan_random' for random pan flag.
+      Note that all of dynamic interfaces must be re-compiled,
+      because the size of `Channel' structure is changed.
+    * Bug fix.
+
 9/21, 1999
     * Version 2.6.0 released.
     * Some configurations and installations are changed.
index 0672511..e21b1c2 100644 (file)
 #define HAVE_MMSYSTEM_H\r
 \r
 /* In VDS Macro AAA=BBB is not available. */\r
-#define TIMID_VERSION  "2.6.0"\r
+#define TIMID_VERSION  "2.6.1"\r
 #define DEFAULT_PATH   ".\\"\r
 #define AU_W32\r
 #define WINSOCK\r
index 470b31d..25bbf16 100755 (executable)
--- a/configure
+++ b/configure
@@ -881,7 +881,7 @@ fi
 
 PACKAGE=TiMidity++
 
-VERSION=2.6.0
+VERSION=2.6.1
 
 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 708a794..d4a9c7b 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.6.0, no-define)
+AM_INIT_AUTOMAKE(TiMidity++, 2.6.1, no-define)
 
 dnl To use CONTAINS() macro (See acinclude.m4)
 CONTAINS_INIT
index 52df4d5..5c9f6a1 100644 (file)
@@ -2826,7 +2826,7 @@ static void VersionWnd(HWND hParentWnd)
   sprintf(VersionText,\r
 "TiMidity++ version %s" NLS NLS\r
 "TiMidity-0.2i by Tuukka Toivonen <tt@cgs.fi>." NLS\r
-"TiMidity Win32 version by Davide Moretti <dmoretti@iper.net>." NLS\r
+"TiMidity Win32 version by Davide Moretti <dave@rimini.com>." NLS\r
 "TiMidity Windows 95 port by Nicolas Witczak." NLS\r
 "TiMidity Win32 GUI by Daisuke Aoki <dai@y7.net>." NLS\r
 "TiMidity++ by Masanao Izumo <mo@goice.co.jp>." NLS\r
index dcd1825..7dc0388 100644 (file)
@@ -422,6 +422,7 @@ static void reset_midi(int playing)
           event */
        channel[i].program = default_program[i];
        channel[i].panning = NO_PANNING;
+       channel[i].pan_random = 0;
        /* tone bank or drum set */
        if(ISDRUMCHANNEL(i))
        {
@@ -435,7 +436,9 @@ static void reset_midi(int playing)
            else
                channel[i].bank = default_tonebank;
        }
-       channel[i].bank_lsb = channel[i].bank_msb = -1;
+       channel[i].bank_lsb = channel[i].bank_msb = 0;
+       if(play_system_mode == XG_SYSTEM_MODE && i % 16 == 9)
+           channel[i].bank_msb = 127; /* Use MSB=127 for XG */
        update_rpn_map(i, RPN_ADDR_FFFF, 0);
        channel[i].special_sample = 0;
        channel[i].key_shift = 0;
@@ -1626,6 +1629,11 @@ static void note_on(MidiEvent *e)
     for(i = 0; i < nv; i++)
     {
        v = vlist[i];
+       if(channel[ch].pan_random)
+       {
+           channel[ch].panning = int_rand(128);
+           ctl_mode_event(CTLE_PANNING, 1, ch, channel[ch].panning);
+       }
        start_note(e, v, vid, nv - i - 1);
        if(channel[ch].chorus_level && voice[v].sample->sample_rate)
        {
@@ -1960,13 +1968,10 @@ void midi_program_change(int ch, int prog)
          default:
            break;
        }
-       if(channel[ch].bank_msb >= 0)
-           newbank = channel[ch].bank_msb;
+       newbank = channel[ch].bank_msb;
        break;
 
       case XG_SYSTEM_MODE: /* XG */
-       if(channel[ch].bank_lsb == -1)
-           return;
        switch(channel[ch].bank_msb)
        {
          case 0: /* Normal */
@@ -1993,8 +1998,7 @@ void midi_program_change(int ch, int prog)
        break;
 
       default:
-       if(channel[ch].bank_msb >= 0)
-           newbank = channel[ch].bank_msb;
+       newbank = channel[ch].bank_msb;
        break;
     }
 
@@ -2279,7 +2283,12 @@ static void update_rpn_map(int ch, int addr, int update_now)
        if(channel[ch].drums[note] == NULL)
            play_midi_setup_drums(ch, note);
        if(val == 0)
+       {
            val = int_rand(128);
+           channel[ch].pan_random = 1;
+       }
+       else
+           channel[ch].pan_random = 0;
        channel[ch].drums[note]->drum_panning = val;
        if(update_now)
            adjust_drum_panning(ch, note);
@@ -2354,7 +2363,8 @@ static void seek_forward(int32 until_time)
            break;
 
          case ME_PAN:
-           channel[ch].panning=current_event->a;
+           channel[ch].panning = current_event->a;
+           channel[ch].pan_random = 0;
            break;
 
          case ME_EXPRESSION:
@@ -2472,6 +2482,7 @@ static void seek_forward(int32 until_time)
 
          case ME_RANDOM_PAN:
            channel[ch].panning = int_rand(128);
+           channel[ch].pan_random = 1;
            break;
 
          case ME_SET_PATCH:
@@ -3747,6 +3758,7 @@ int play_event(MidiEvent *ev)
 
       case ME_PAN:
        channel[ch].panning = ev->a;
+       channel[ch].pan_random = 0;
        if(adjust_panning_immediately)
            adjust_panning(ch);
        ctl_mode_event(CTLE_PANNING, 1, ch, ev->a);
@@ -3885,9 +3897,9 @@ int play_event(MidiEvent *ev)
        /* TiMidity Extensionals */
       case ME_RANDOM_PAN:
        channel[ch].panning = int_rand(128);
+       channel[ch].pan_random = 1;
        if(adjust_panning_immediately)
            adjust_panning(ch);
-       ctl_mode_event(CTLE_PANNING, 1, ch, channel[ch].panning);
        break;
 
       case ME_SET_PATCH:
index 327f8b8..7768983 100644 (file)
@@ -229,6 +229,9 @@ typedef struct {
   int mapID;                   /* Program map ID */
   AlternateAssign *altassign;  /* Alternate assign patch table */
   int32 lasttime;     /* Last sample time of computed voice on this channel */
+
+  /* flag for random pan */
+  int pan_random;
 } Channel;
 
 /* Causes the instrument's default panning to be used. */
index c3aad58..80b4581 100644 (file)
@@ -509,6 +509,91 @@ int convert_midi_control_change(int chn, int type, int val, MidiEvent *ev_ret)
     return 0;
 }
 
+/* XG SysEx parsing function by Eric A. Welsh
+ *
+ * This function provides basic support for XG Multi Part Data
+ * parameter change SysEx events
+ *
+ * NOTE - val[1] is documented as only being 0x10, but this rule is not
+ * followed in real life, since I have midi that set it to 0x00 and are
+ * interpreted correctly on my SW60XG ...
+ */
+int parse_sysex_event_xg(uint8 *val, int32 len, MidiEvent *ev, int32 at)
+{
+    int num_events = 0;                                /* Number of events added */
+
+    if(current_file_info->mid == 0 || current_file_info->mid >= 0x7e)
+       current_file_info->mid = val[0];
+
+    if(len >= 10 &&
+       val[0] == 0x43 && /* Yamaha ID */
+       val[2] == 0x4C && /* XG Model ID */
+       val[4] == 0x29 && /* Total size of data body to be analyzed */
+       val[5] == 0x08)   /* Multi Part Data parameter change */
+    {
+       uint8 addhigh, addmid, addlow;          /* Addresses */
+       uint8 *body;                            /* SysEx body */
+       uint8 p;                                /* Channel part number [0..15] */
+       int ent;                                /* Entry # of sub-event */
+       uint8 *body_end;                        /* End of SysEx body */
+
+       addhigh = val[3];
+       addmid = val[4];
+       addlow = val[5];
+       body = val + 8;
+       p = val[6];
+       body_end = val + len-3;
+
+       for (ent=0; body <= body_end; body++, ent++) {
+           switch(ent) {
+
+               case 0x01:      /* bank select MSB */
+                 MIDIEVENT(at+ent, ME_TONE_BANK_MSB, p, *body, 0);
+                 break;
+
+               case 0x02:      /* bank select LSB */
+                 MIDIEVENT(at+ent, ME_TONE_BANK_LSB, p, *body, 0);
+                 break;
+
+               case 0x03:      /* program number */
+                 MIDIEVENT(at+ent, ME_PROGRAM, p, *body, 0);
+                 break;
+
+               case 0x08:      /* note shift ? */
+                 MIDIEVENT(at+ent, ME_KEYSHIFT, p, *body, 0);
+
+               case 0x0B:      /* volume */
+                 MIDIEVENT(at+ent, ME_MAINVOLUME, p, *body, 0);
+                 break;
+
+               case 0x0E:      /* pan */
+                 if(*body == 0) {
+                       MIDIEVENT(at+ent, ME_RANDOM_PAN, p, 0, 0);
+                 }
+                 else {
+                       MIDIEVENT(at+ent, ME_PAN, p, *body, 0);
+                 }
+                 break;
+
+               case 0x12:      /* chorus send */
+                 MIDIEVENT(at+ent, ME_CHORUS_EFFECT, p, *body, 0);
+                 break;
+
+               case 0x13:      /* reverb send */
+                 MIDIEVENT(at+ent, ME_REVERB_EFFECT, p, *body, 0);
+                 break;
+
+               default:
+                 continue;
+                 break;
+           }
+           num_events++;
+       }
+    }
+
+return(num_events);
+}
+
 int parse_sysex_event(uint8 *val, int32 len, MidiEvent *ev)
 {
     if(current_file_info->mid == 0 || current_file_info->mid >= 0x7e)
@@ -812,6 +897,8 @@ static int read_sysex_event(int32 at, int me, int32 len,
        ev.time = at;
        readmidi_add_event(&ev);
     }
+    parse_sysex_event_xg(val, len, &ev, at);
+    
     reuse_mblock(&tmpbuffer);
 
     return 0;
@@ -1529,7 +1616,9 @@ static MidiEvent *groom_list(int32 divisions, int32 *eventsp, int32 *samplesp)
            }
 
        }
-       bank_lsb[j] = bank_msb[j] = -1;
+       bank_lsb[j] = bank_msb[j] = 0;
+       if(play_system_mode == XG_SYSTEM_MODE && j % 16 == 9)
+           channel[j].bank_msb = 127; /* Use MSB=127 for XG */
        current_program[j] = default_program[j];
     }
 
@@ -1586,7 +1675,9 @@ static MidiEvent *groom_list(int32 divisions, int32 *eventsp, int32 *samplesp)
                    if(tonebank[current_set[j]] == NULL)
                        current_set[j] = 0;
                }
-               bank_lsb[j] = bank_msb[j] = -1;
+               bank_lsb[j] = bank_msb[j] = 0;
+               if(play_system_mode == XG_SYSTEM_MODE && j % 16 == 9)
+                   channel[j].bank_msb = 127; /* Use MSB=127 for XG */
                current_program[j] = default_program[j];
            }
            break;
@@ -1628,13 +1719,10 @@ static MidiEvent *groom_list(int32 divisions, int32 *eventsp, int32 *samplesp)
                              ch, bank_lsb[ch]);
                    break;
                }
-               if(bank_msb[ch] >= 0)
-                   newbank = bank_msb[ch];
+               newbank = bank_msb[ch];
                break;
 
              case XG_SYSTEM_MODE: /* XG */
-               if(bank_lsb[ch] == -1)
-                   goto end_of_event_switch;
                switch(bank_msb[ch])
                {
                  case 0: /* Normal */
@@ -1666,13 +1754,11 @@ static MidiEvent *groom_list(int32 divisions, int32 *eventsp, int32 *samplesp)
                              ch, bank_msb[ch]);
                    break;
                }
-               if(bank_lsb[ch] >= 0)
-                   newbank = bank_lsb[ch];
+               newbank = bank_lsb[ch];
                break;
 
              default:
-               if(bank_msb[ch] >= 0)
-                   newbank = bank_msb[ch];
+               newbank = bank_msb[ch];
                break;
            }
 
index 3e7ea30..f20adbd 100644 (file)
@@ -307,7 +307,7 @@ static void help(void)
 " TiMidity is free software and comes with ABSOLUTELY NO WARRANTY.",
 "",
 #ifdef __W32__
-" Win32 version by Davide Moretti <dmoretti@iper.net>",
+" Win32 version by Davide Moretti <dave@rimini.com>",
 "              and Daisuke Aoki <dai@y7.net>",
 #endif /* __W32__ */
 "",
@@ -2175,7 +2175,7 @@ static int parse_effect_option(char *effect_opts)
 
          case '1':
          case '2':
-          opt_surround_chorus = (*effect_opts == '2');
+           opt_surround_chorus = (*effect_opts == '2');
            if(*(effect_opts + 1) == ',')
                opt_chorus_control = -(atoi(effect_opts + 2) & 0x7f);
            else