diff -ruN TiMidity++-2.6.1/ChangeLog TiMidity++-2.7.0/ChangeLog --- TiMidity++-2.6.1/ChangeLog Mon Sep 27 22:21:16 1999 +++ TiMidity++-2.7.0/ChangeLog Tue Oct 12 19:17:59 1999 @@ -1,3 +1,38 @@ +1999-10-12 Masanao Izumo + + * Version 2.7.0 released. + +1999-10-12 Masanao Izumo + + * NEWS,ChangeLog,ChangeLog.1,interface/xaw_redef.c: Fix typos. + * timidity/readmidi.c (groom_list): Bug fix + * interface/w32g_ini.c,timidity/{timidity.c,common.c,common.h (str2mID): + Utility function to convert string to Manufacture ID. This function + is moved from w32g_ini.c to common.c, and used global. + * timidity/{timidity.c,readmidi.h,readmidi.c}: -EM: New option. + Use midi system as : is `gs', `xg', or `gm'. + +1999-10-05 Masanao Izumo + + * interface/w32g_playlist.c (w32g_add_playlist): Bug fix + * timidity/playlist.c (adjust_panning_immediately): True by default. + adjust_panning_immediately toggle on/off with -F option. + If this flag is true, currently-sounding pan position is changed + when a Panpot message is received. Otherwise, the pan position is + changed when starting with the next note. + +1999-10-04 Masanao Izumo + + * timidity/{readmidi.c,readmidi.h}: Fixed bug of random drum panning. + +1999-10-01 Eric A. Welsh + + * timidity/readmidi.c: Modified GS Sysex for bank+program change. + +1999-09-29 Eric A. Welsh + + * timidity/readmidi.c: Added GS Sysex for bank+program change. + 1999-09-27 Masanao Izumo * Version 2.6.1 released. @@ -259,7 +294,7 @@ 1999-08-26 Masanao Izumo * timidity/linux_a.c(ignore_processed_probrem): Ignore to fix - the byte processed probrem if any errors occur. + the byte processed problem if any errors occur. Why count_info.bytes doesn't stop even if the process is suspended? * configure.in: Remove -rdynamic option from $g_so_libs. @@ -593,7 +628,7 @@ 1999-07-13 Norikatsu Shigemura - * timidity/nas_a.c: Fixed the probrem that occurs with + * timidity/nas_a.c: Fixed the problem that occurs with 'timidity -On /dev/null'. * configure.in: Fixed building for FreeBSD Objects. Please specify configure option '--with-elf' if you create ELF object, otherwise diff -ruN TiMidity++-2.6.1/ChangeLog.1 TiMidity++-2.7.0/ChangeLog.1 --- TiMidity++-2.6.1/ChangeLog.1 Tue Apr 6 03:09:48 1999 +++ TiMidity++-2.7.0/ChangeLog.1 Tue Oct 12 14:50:08 1999 @@ -1,7 +1,7 @@ -- 1.3.8 Tue Apr 6 1999 Summary: - * Fixed some bugs or probrems. + * Fixed some bugs or problems. Date: Sun, 4 Apr 1999 18:14:43 +1000 (EST) From: David Gibson @@ -39,7 +39,7 @@ -- 1.3.7 Summary: Tue Mar 30 1999 - * Fixed some bugs or probrems. + * Fixed some bugs or problems. * In GTK interface, enabled to delete loaded files from the play list. Date: Tue Mar 30 1999 @@ -55,7 +55,7 @@ From: Masanao Izumo Date: Mon Mar 29 1999 Files: timidity/support.h - Fixed prototype mismatch probrem for getopt(). + Fixed prototype mismatch problem for getopt(). Files: configure.in interface/ncurs_c.c Added configure test for PDcurses. Increased COMMAND_BUFFER_SIZE to 4096. @@ -151,7 +151,7 @@ Files: interface/{xaw_i.c,xaw_c.c,xaw.h} doc/C/README.xaw doc/ja_JP.ujis/README.xaw Patched for XAW interface. - Fixed some probrems and changed some interfaces. + Fixed some problems and changed some interfaces. Added documentation for XAW interface. From: Yoshishige Arai @@ -176,7 +176,7 @@ Added a new WM-icon provided by Tim Allen. Defined the wmclass & wmname to make TiMidity friendlier to window managers. - * Fixed otner bugs or probrems. + * Fixed otner bugs or problems. Date: Sat Feb 27 1999 From: Masanao Izumo @@ -204,7 +204,7 @@ Date: Thu, 25 Feb 1999 01:17:45 +0900 (JST) From: Yoshishige Arai Files: interface/xaw_i.c - Fixed probrem of cascade file selection popup menu. + Fixed problem of cascade file selection popup menu. -- 1.3.3 Wed Feb 24 1999 @@ -216,7 +216,7 @@ * Added strdup implementation is it was not exists. * Fixed bug that MIDI reset did not update the display of program. * Added `extern errno' in timidity.h - * Fixed XAW geometry probrem on non-trace mode. + * Fixed XAW geometry problem on non-trace mode. * Not to call glob() if GLOB_BRACE is not defined. Date: Wed Feb 24 1999 @@ -279,7 +279,7 @@ Date: Fri, 12 Feb 1999 12:46:51 +0900 From: "KINOSHITA, K." Files: interface/xaw_i.c - Fixed XAW geometry probrem on non-trace mode. + Fixed XAW geometry problem on non-trace mode. Files: interface/gtk_i.c Not to call glob() if GLOB_BRACE is not defined. @@ -289,7 +289,7 @@ * Patched for BSD/OS. * Changed icons of motif interface. * Changed sorting algorithm for xaw and Tck/Tk interface. - * Fixed bugs and probrems of Tcl/Tk interface + * Fixed bugs and problems of Tcl/Tk interface Date: Wed Feb 10 1999 From: Masanao Izumo @@ -335,7 +335,7 @@ Date: Sat, 6 Feb 1999 01:45:20 +0100 (CET) From: Peter Kleiweg Files: interface/tkpanel.tcl - Fixed Tck/Tk interface probrem: + Fixed Tck/Tk interface problem: The proc MakeShuffleList is broken. The list of numbers it generates has a `hole' in it. This generates an error when the last number in the list has been played. @@ -451,7 +451,7 @@ Date: Fri Jan 29 1999 From: Masanao Izumo Files: configure.in - On FreeBSD, There is probrem to make shared object library. + On FreeBSD, There is problem to make shared object library. Netscape Plugin needs `aout' format, but I don't have enough knowledge to build aout format under ELF environment FreeBSD. So I just removed -aout flag for compiler. @@ -480,13 +480,13 @@ -- 1.2.1 Mon Jan 25 1999 Summary: - * Fixed some configuration probrems. + * Fixed some configuration problems. * Added --enable-dynamic `configure' option. Date: Mon Jan 25 1999 From: Masanao Izumo Files: acinclude.m4 configure.in - Fixed some probrems of configuration: + Fixed some problems of configuration: * Remove duplicated -lXpm option. * Not to change the order of comple flags. * and so on... @@ -608,13 +608,13 @@ Files: interface/{dumb_c.c,dynamic_c.c,emacs_c.c} On some compilers, `stdout' can't assign to any variable in global - statement. Fixed this probrem. + statement. Fixed this problem. Files: configure.in config.h.in timidity/timidity.c Added HAVE_GETOPT_H macro. Files: configure.in Fixed bugs of configure without --with-x. Files: timidity/Makefile.am - Fixed probrem to `make install' instead of `make; make install' + Fixed problem to `make install' instead of `make; make install' -- 1.1.0 Mon Jan 18 1999 @@ -656,10 +656,10 @@ Thu Jan 14 1999 Summary: * Define function of vsnprintf() and snprintf() if it is not exists. - * Fixed message transfer probrem with '\n' for some interface. + * Fixed message transfer problem with '\n' for some interface. * Modified manual installation. * Check libXaw3d before checking libXaw. - * Fixed ALSA configuration probrem. + * Fixed ALSA configuration problem. * Modified for OffiX interface. * Tcl/tk interface can start with no midi file arguments. * Modified doc/C/README.xskin @@ -670,9 +670,9 @@ xaw_i.c,xaw_c.c,tk_c.c,wrdt_x.c} Define function of vsnprintf() and snprintf() if it is not exists. And use it some where. - Fixed Tck/Tk message transfer probrem with '\n' (Not completed) + Fixed Tck/Tk message transfer problem with '\n' (Not completed) Files: interface/xaw_c.c interface/xaw_i.c - Fixed XAW message transfer probrem with '\n'. + Fixed XAW message transfer problem with '\n'. Files: configure.in doc/Makefile* doc/*/Makefile* Modified manual installation. Files: configure.in interface/xaw.h @@ -682,7 +682,7 @@ Date: Tue, 12 Jan 1999 22:00:26 +0900 From: Yamahata Isaku Files: configure.in acinclude.m4 - Fixed ALSA configuration probrem. + Fixed ALSA configuration problem. Date: Tue, 12 Jan 1999 21:25:32 +0900 From: Takanori Watanabe diff -ruN TiMidity++-2.6.1/NEWS TiMidity++-2.7.0/NEWS --- TiMidity++-2.6.1/NEWS Mon Sep 27 22:21:18 1999 +++ TiMidity++-2.7.0/NEWS Tue Oct 12 19:18:13 1999 @@ -1,3 +1,9 @@ +10/12, 1999 + * Version 2.7.0 released. + * adjust_panning_immediately (-F) is true by default. + * GS Sysex for bank+program change. + * Bug fix. + 9/27, 1999 * Version 2.6.1 released. * Support for XG Multi Part Data parameter change SysEx events. @@ -37,7 +43,7 @@ 8/9, 1999 * Version 2.4.0 released. * Make archive library (libarc) code more simple. - * On linux, fixed probrem of audio queue analysing. + * On linux, fixed problem of audio queue analysing. 8/1, 1999 * Version 2.3.0 released. @@ -119,17 +125,17 @@ * 3/1, 1999 Released TiMidity++ v1.3.4. - * Fixed some bugs and probrems. + * Fixed some bugs and problems. * Added a new WM-icon for GTK. * 2/24, 1999 Released TiMidity++ v1.3.3. * Improve XAW interface. - * Fixed some bugs and probrems. + * Fixed some bugs and problems. * 2/10, 1999 Released TiMidity++ v1.3.2. - * Fixed some bugs and probrems. + * Fixed some bugs and problems. * Changed icons of motif interface. * Changed sorting algorithm for xaw and tcktl interface. @@ -149,7 +155,7 @@ * 1/25, 1999 Released TiMidity++ v1.2.1. Added missing files. - Fixed some configuration probrems. + Fixed some configuration problems. Added --enable-dynamic configure option. * 1/21, 1999 @@ -168,7 +174,7 @@ * 1/18, 1999 Released TiMidity++ v1.1.1. - v1.1.0 had configuration probrems, so v1.1.1 was released immediately. + v1.1.0 had configuration problems, so v1.1.1 was released immediately. Fixed some configure bugs. Modified that xaw interface is enable to run without any midi files. diff -ruN TiMidity++-2.6.1/configs/msc-config.h TiMidity++-2.7.0/configs/msc-config.h --- TiMidity++-2.6.1/configs/msc-config.h Mon Sep 27 22:29:14 1999 +++ TiMidity++-2.7.0/configs/msc-config.h Tue Oct 12 19:18:52 1999 @@ -217,7 +217,7 @@ #define HAVE_MMSYSTEM_H /* In VDS Macro AAA=BBB is not available. */ -#define TIMID_VERSION "2.6.1" +#define TIMID_VERSION "2.7.0" #define DEFAULT_PATH ".\\" #define AU_W32 #define WINSOCK diff -ruN TiMidity++-2.6.1/configure TiMidity++-2.7.0/configure --- TiMidity++-2.6.1/configure Wed Sep 22 23:00:02 1999 +++ TiMidity++-2.7.0/configure Tue Oct 5 15:58:44 1999 @@ -881,7 +881,7 @@ PACKAGE=TiMidity++ -VERSION=2.6.1 +VERSION=2.7.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; } diff -ruN TiMidity++-2.6.1/configure.in TiMidity++-2.7.0/configure.in --- TiMidity++-2.6.1/configure.in Wed Sep 22 22:59:56 1999 +++ TiMidity++-2.7.0/configure.in Tue Oct 5 15:58:34 1999 @@ -55,7 +55,7 @@ AC_INIT(timidity/timidity.c) SHELL=${CONFIG_SHELL-/bin/sh} AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(TiMidity++, 2.6.1, no-define) +AM_INIT_AUTOMAKE(TiMidity++, 2.7.0, no-define) dnl To use CONTAINS() macro (See acinclude.m4) CONTAINS_INIT diff -ruN TiMidity++-2.6.1/interface/w32g_ini.c TiMidity++-2.7.0/interface/w32g_ini.c --- TiMidity++-2.6.1/interface/w32g_ini.c Fri Sep 3 13:57:19 1999 +++ TiMidity++-2.7.0/interface/w32g_ini.c Tue Oct 12 14:53:44 1999 @@ -42,39 +42,6 @@ int w32g_has_ini_file; -static int str2mID(char *str) -{ - int i, v, val; - - if(strcmp(str + 1, "gs") == 0 || - strcmp(str + 1, "GS") == 0) - val = 0x41; - else if(strcmp(str + 1, "xg") == 0 || - strcmp(str + 1, "XG") == 0) - val = 0x43; - else if(strcmp(str + 1, "gm") == 0 || - strcmp(str + 1, "GM") == 0) - val = 0x7e; - else - { - val = 0; - for(i = 0; i < 2; i++) - { - v = str[i + 1]; - if('0' <= v && v <= '9') - v = v - '0'; - else if('A' <= v && v <= 'F') - v = v - 'A' + 10; - else if('a' <= v && v <= 'f') - v = v - 'a' + 10; - else - v = 0; - val = (val << 4 | v); - } - } - return val; -} - static int32 str2size(char *str) { int len = strlen(str); diff -ruN TiMidity++-2.6.1/interface/w32g_playlist.c TiMidity++-2.7.0/interface/w32g_playlist.c --- TiMidity++-2.6.1/interface/w32g_playlist.c Sun Sep 5 13:48:52 1999 +++ TiMidity++-2.7.0/interface/w32g_playlist.c Tue Oct 5 15:56:47 1999 @@ -131,6 +131,7 @@ free(new_files1[0]); free(new_files1); } + return 0; } } diff -ruN TiMidity++-2.6.1/interface/xaw_redef.c TiMidity++-2.7.0/interface/xaw_redef.c --- TiMidity++-2.6.1/interface/xaw_redef.c Wed Apr 21 11:02:42 1999 +++ TiMidity++-2.7.0/interface/xaw_redef.c Tue Oct 12 14:48:04 1999 @@ -1,6 +1,6 @@ /* Masanao Izumo : * - * There is probrem if both -lXm and -lXaw are linked. + * There is problem if both -lXm and -lXaw are linked. * This source code to re-define XAW vendorShell. * To change motif vendorShell to XAW vendorShell in runtime. * diff -ruN TiMidity++-2.6.1/timidity/common.c TiMidity++-2.7.0/timidity/common.c --- TiMidity++-2.6.1/timidity/common.c Mon Sep 6 19:09:48 1999 +++ TiMidity++-2.7.0/timidity/common.c Tue Oct 12 14:54:47 1999 @@ -1058,3 +1058,34 @@ return strrchr(path, PATH_SEP); #endif } + +int str2mID(char *str) +{ + int val; + + if(strncasecmp(str, "gs", 2) == 0) + val = 0x41; + else if(strncasecmp(str, "xg", 2) == 0) + val = 0x43; + else if(strncasecmp(str, "gm", 2) == 0) + val = 0x7e; + else + { + int i, v; + val = 0; + for(i = 0; i < 2; i++) + { + v = str[i]; + if('0' <= v && v <= '9') + v = v - '0'; + else if('A' <= v && v <= 'F') + v = v - 'A' + 10; + else if('a' <= v && v <= 'f') + v = v - 'a' + 10; + else + return 0; + val = (val << 4 | v); + } + } + return val; +} diff -ruN TiMidity++-2.6.1/timidity/common.h TiMidity++-2.7.0/timidity/common.h --- TiMidity++-2.6.1/timidity/common.h Sat Sep 4 06:57:58 1999 +++ TiMidity++-2.7.0/timidity/common.h Tue Oct 12 14:41:38 1999 @@ -74,6 +74,7 @@ extern int load_table(char *file); extern char *pathsep_strrchr(char *path); extern char *pathsep_strchr(char *path); +extern int str2mID(char *str); /* code: diff -ruN TiMidity++-2.6.1/timidity/playmidi.c TiMidity++-2.7.0/timidity/playmidi.c --- TiMidity++-2.6.1/timidity/playmidi.c Mon Sep 27 22:14:02 1999 +++ TiMidity++-2.7.0/timidity/playmidi.c Tue Oct 5 15:30:33 1999 @@ -168,7 +168,7 @@ ChannelBitMask default_drumchannels; ChannelBitMask drumchannel_mask; ChannelBitMask drumchannels; -int adjust_panning_immediately=0; +int adjust_panning_immediately=1; int auto_reduce_polyphony=1; double envelope_modify_rate = 1.0; #if defined(CSPLINE_INTERPOLATION) || defined(LAGRANGE_INTERPOLATION) @@ -1618,18 +1618,23 @@ static void note_on(MidiEvent *e) { - int i, nv, v, ch; + int i, nv, v, ch, note; int vlist[32]; int vid; if((nv = find_samples(e, vlist)) == 0) return; - vid = new_vidq(e->channel, MIDI_EVENT_NOTE(e)); + note = MIDI_EVENT_NOTE(e); + vid = new_vidq(e->channel, note); ch = e->channel; for(i = 0; i < nv; i++) { v = vlist[i]; - if(channel[ch].pan_random) + if(ISDRUMCHANNEL(ch) && + channel[ch].drums[note] != NULL && + channel[ch].drums[note]->pan_random) + channel[ch].drums[note]->drum_panning = int_rand(128); + else if(channel[ch].pan_random) { channel[ch].panning = int_rand(128); ctl_mode_event(CTLE_PANNING, 1, ch, channel[ch].panning); @@ -2285,12 +2290,12 @@ if(val == 0) { val = int_rand(128); - channel[ch].pan_random = 1; + channel[ch].drums[note]->pan_random = 1; } else - channel[ch].pan_random = 0; + channel[ch].drums[note]->pan_random = 0; channel[ch].drums[note]->drum_panning = val; - if(update_now) + if(update_now && adjust_panning_immediately) adjust_drum_panning(ch, note); break; case NRPN_ADDR_1D00: /* Reverb Send Level of Drum */ diff -ruN TiMidity++-2.6.1/timidity/playmidi.h TiMidity++-2.7.0/timidity/playmidi.h --- TiMidity++-2.6.1/timidity/playmidi.h Mon Sep 27 22:06:40 1999 +++ TiMidity++-2.7.0/timidity/playmidi.h Mon Oct 4 12:22:56 1999 @@ -166,6 +166,9 @@ int drum_panning; int32 drum_envelope_rate[6]; /* Not supported */ + /* flag for drum random pan */ + int pan_random; + /* Not supported: * Drum Filter Cutoff * Drum Filter Resonance @@ -206,7 +209,7 @@ int porta_control_ratio, porta_dpb; int32 last_note_fine; - /* For Drum-SysEX */ + /* For Drum part */ struct DrumParts *drums[128]; /* For vibrato */ diff -ruN TiMidity++-2.6.1/timidity/readmidi.c TiMidity++-2.7.0/timidity/readmidi.c --- TiMidity++-2.6.1/timidity/readmidi.c Mon Sep 27 22:06:00 1999 +++ TiMidity++-2.7.0/timidity/readmidi.c Tue Oct 12 19:16:29 1999 @@ -85,6 +85,7 @@ #endif /* ALWAYS_TRACE_TEXT_META_EVENT */ int opt_default_mid = 0; +int opt_system_mid = 0; int ignore_midi_error = 1; ChannelBitMask quietchannels; struct midi_file_info *current_file_info = NULL; @@ -510,6 +511,7 @@ } /* XG SysEx parsing function by Eric A. Welsh + * Also handles GS patch+bank changes * * This function provides basic support for XG Multi Part Data * parameter change SysEx events @@ -518,13 +520,14 @@ * 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 parse_sysex_event_multi(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]; + /* XG Multi Part Data parameter change */ if(len >= 10 && val[0] == 0x43 && /* Yamaha ID */ val[2] == 0x4C && /* XG Model ID */ @@ -548,39 +551,39 @@ switch(ent) { case 0x01: /* bank select MSB */ - MIDIEVENT(at+ent, ME_TONE_BANK_MSB, p, *body, 0); + MIDIEVENT(at, ME_TONE_BANK_MSB, p, *body, 0); break; case 0x02: /* bank select LSB */ - MIDIEVENT(at+ent, ME_TONE_BANK_LSB, p, *body, 0); + MIDIEVENT(at, ME_TONE_BANK_LSB, p, *body, 0); break; case 0x03: /* program number */ - MIDIEVENT(at+ent, ME_PROGRAM, p, *body, 0); + MIDIEVENT(at, ME_PROGRAM, p, *body, 0); break; case 0x08: /* note shift ? */ - MIDIEVENT(at+ent, ME_KEYSHIFT, p, *body, 0); + MIDIEVENT(at, ME_KEYSHIFT, p, *body, 0); case 0x0B: /* volume */ - MIDIEVENT(at+ent, ME_MAINVOLUME, p, *body, 0); + MIDIEVENT(at, ME_MAINVOLUME, p, *body, 0); break; case 0x0E: /* pan */ if(*body == 0) { - MIDIEVENT(at+ent, ME_RANDOM_PAN, p, 0, 0); + MIDIEVENT(at, ME_RANDOM_PAN, p, 0, 0); } else { - MIDIEVENT(at+ent, ME_PAN, p, *body, 0); + MIDIEVENT(at, ME_PAN, p, *body, 0); } break; case 0x12: /* chorus send */ - MIDIEVENT(at+ent, ME_CHORUS_EFFECT, p, *body, 0); + MIDIEVENT(at, ME_CHORUS_EFFECT, p, *body, 0); break; case 0x13: /* reverb send */ - MIDIEVENT(at+ent, ME_REVERB_EFFECT, p, *body, 0); + MIDIEVENT(at, ME_REVERB_EFFECT, p, *body, 0); break; default: @@ -591,7 +594,61 @@ } } -return(num_events); + /* GS program change */ + /* I could not find any documentation on this, so I reverse engineered + which bytes do what from midi I have. It appears to work correctly. */ + if(len == 11 && + val[0] == 0x41 && /* Roland ID */ + val[1] == 0x10 && /* Device ID */ + val[2] == 0x42 && /* GS Model ID */ + val[3] == 0x12 && /* Data Set Command */ + val[4] == 0x40 && /* I wish I knew what this was... */ + (val[5] >= 0x10 && val[5] < 0x20)) /* channel command */ + { + uint8 p; /* Channel part number [0..15] */ + + p = val[5] & 0x0F; + if(p == 0) + p = 9; + else if(p <= 9) + p--; + p = MERGE_CHANNEL_PORT(p); + + MIDIEVENT(at, ME_TONE_BANK_MSB, p, val[7], 0); + MIDIEVENT(at, ME_TONE_BANK_LSB, p, 1, 0); /* assume SC-55 ??? */ + MIDIEVENT(at, ME_PROGRAM, p, val[8], 0); + + num_events = 2; + } + + /* GS bank+program change */ + /* I could not find any documentation on this, so I reverse engineered + which bytes do what from midi I have. It appears to work correctly. */ + else if(len == 11 && + val[0] == 0x41 && /* Roland ID */ + val[1] == 0x10 && /* Device ID */ + val[2] == 0x42 && /* GS Model ID */ + val[3] == 0x12 && /* Data Set Command */ + val[4] == 0x40 && /* I wish I knew what this was... */ + (val[5] >= 0x10 && val[5] < 0x20)) /* channel command */ + { + uint8 p; /* Channel part number [0..15] */ + + p = val[5] & 0x0F; + if(p == 0) + p = 9; + else if(p <= 9) + p--; + p = MERGE_CHANNEL_PORT(p); + + MIDIEVENT(at, ME_TONE_BANK_MSB, p, val[7], 0); + MIDIEVENT(at, ME_TONE_BANK_LSB, p, 1, 0); /* assume SC-55 ??? */ + MIDIEVENT(at, ME_PROGRAM, p, val[8], 0); + + num_events = 3; + } + + return(num_events); } int parse_sysex_event(uint8 *val, int32 len, MidiEvent *ev) @@ -897,7 +954,7 @@ ev.time = at; readmidi_add_event(&ev); } - parse_sysex_event_xg(val, len, &ev, at); + parse_sysex_event_multi(val, len, &ev, at); reuse_mblock(&tmpbuffer); @@ -1506,6 +1563,16 @@ void change_system_mode(int mode) { + int mid; + + if(opt_system_mid) + { + mid = opt_system_mid; + mode = -1; /* Always use opt_system_mid */ + } + else + mid = current_file_info->mid; + switch(mode) { case GM_SYSTEM_MODE: @@ -1524,7 +1591,7 @@ vol_table = xg_vol_table; break; default: - switch(current_file_info->mid) + switch(mid) { case 0x41: play_system_mode = GS_SYSTEM_MODE; @@ -1618,7 +1685,7 @@ } 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 */ + bank_msb[j] = 127; /* Use MSB=127 for XG */ current_program[j] = default_program[j]; } @@ -1658,12 +1725,14 @@ break; case ME_RESET: change_system_mode(meep->event.a); - for(j = 0; j < MAX_CHANNELS; j++) - mapID[j] = get_default_mapID(j); ctl->cmsg(CMSG_INFO, VERB_NOISY, "MIDI reset at %d sec", (int)((double)st / play_mode->rate + 0.5)); for(j = 0; j < MAX_CHANNELS; j++) { + if(play_system_mode == XG_SYSTEM_MODE && j % 16 == 9) + mapID[j] = XG_DRUM_MAP; + else + mapID[j] = get_default_mapID(j); if(ISDRUMCHANNEL(j)) current_set[j] = 0; else @@ -1677,7 +1746,9 @@ } 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 */ + { + bank_msb[j] = 127; /* Use MSB=127 for XG */ + } current_program[j] = default_program[j]; } break; @@ -1783,6 +1854,7 @@ newbank = current_set[ch]; newprog = meep->event.a; instrument_map(mapID[ch], &newbank, &newprog); + if(!drumset[newbank]) /* Is this a defined drumset? */ { if(warn_drumset[newbank] == 0) @@ -1878,7 +1950,6 @@ skip_this_event = 1; break; } - end_of_event_switch: /* Recompute time in samples*/ if((dt = meep->event.time - at) && !counting_time) diff -ruN TiMidity++-2.6.1/timidity/readmidi.h TiMidity++-2.7.0/timidity/readmidi.h --- TiMidity++-2.6.1/timidity/readmidi.h Sat Jul 31 23:57:42 1999 +++ TiMidity++-2.7.0/timidity/readmidi.h Tue Oct 12 14:58:13 1999 @@ -122,6 +122,7 @@ extern struct midi_file_info *current_file_info; extern int opt_trace_text_meta_event; extern int opt_default_mid; +extern int opt_system_mid; extern int ignore_midi_error; extern int readmidi_error_flag; extern int readmidi_wrd_mode; diff -ruN TiMidity++-2.6.1/timidity/timidity.c TiMidity++-2.7.0/timidity/timidity.c --- TiMidity++-2.6.1/timidity/timidity.c Mon Sep 27 21:43:46 1999 +++ TiMidity++-2.7.0/timidity/timidity.c Tue Oct 12 19:12:22 1999 @@ -383,7 +383,7 @@ #ifdef __W32__ " -e Increase thread priority (evil) - be careful!", #endif -" -F Enable fast panning", +" -F Disable/Enable fast panning (toggle on/off, default is on)", " -f " #ifdef FAST_DECAY "Disable" @@ -2209,6 +2209,11 @@ return 1; } +static int str2mid(char *s) +{ + +} + int set_extension_modes(char *flag) { int err; @@ -2282,45 +2287,34 @@ break; case 'm': { - int i, v, val; - - if(strcmp(flag + 1, "gs") == 0 || - strcmp(flag + 1, "GS") == 0) - val = 0x41; - else if(strcmp(flag + 1, "xg") == 0 || - strcmp(flag + 1, "XG") == 0) - val = 0x43; - else if(strcmp(flag + 1, "gm") == 0 || - strcmp(flag + 1, "GM") == 0) - val = 0x7e; + int val; + val = str2mID(flag + 1); + if(val == 0) + { + ctl->cmsg(CMSG_ERROR, VERB_NORMAL, + "-Em: Illegal value"); + err++; + } else + opt_default_mid = val; + flag += 2; + } + break; + case 'M': + { + int val; + val = str2mID(flag + 1); + if(val == 0) { - val = 0; - for(i = 0; i < 2; i++) - { - v = flag[i + 1]; - if('0' <= v && v <= '9') - v = v - '0'; - else if('A' <= v && v <= 'F') - v = v - 'A' + 10; - else if('a' <= v && v <= 'f') - v = v - 'a' + 10; - else - { - ctl->cmsg(CMSG_ERROR, VERB_NORMAL, - "-Em: Illegal value"); - err++; - val = 0; - break; - } - val = (val << 4 | v); - } + ctl->cmsg(CMSG_ERROR, VERB_NORMAL, + "-EM: Illegal value"); + err++; } - opt_default_mid = val; + else + opt_system_mid = val; flag += 2; } break; - case 'b': if(flag[1] < '0' || flag[1] > '9') default_tonebank = 0; diff -ruN TiMidity++-2.6.1/timidity/timpp32g.ini TiMidity++-2.7.0/timidity/timpp32g.ini --- TiMidity++-2.6.1/timidity/timpp32g.ini Wed Aug 25 16:15:50 1999 +++ TiMidity++-2.7.0/timidity/timpp32g.ini Tue Oct 5 16:00:49 1999 @@ -66,7 +66,7 @@ opt_chorus_control=1 noise_sharp_type=0 opt_evil_mode=0 -adjust_panning_immediately=0 +adjust_panning_immediately=1 fast_decay=0 default_program0=0 default_program1=0