diff -ruN TiMidity++-2.9.1/ChangeLog TiMidity++-2.9.2/ChangeLog --- TiMidity++-2.9.1/ChangeLog Tue Mar 21 04:51:42 2000 +++ TiMidity++-2.9.2/ChangeLog Mon Apr 10 13:52:58 2000 @@ -1,8 +1,26 @@ -2000-02-21 Masanao Izumo +2000-04-10 Masanao Izumo + + * Version 2.9.2 released. + +2000-03-30 Masanao Izumo + (Bug reported by Takeyuki Uehara ) + + * interface/ncurses.c: Fixed probrem that all channel statuses are reseted + if the key `t' is pressed. + +2000-03-28 Masanao Izumo + + * timidity/readmidi.c: Bug fixed about reading SMF track boundary. + +2000-03-23,26 Eric A. Welsh + + * timidity/{resample.c,recache.c}: Fixed problem of cspline interpolation. + +2000-03-21 Masanao Izumo * Version 2.9.1 released. -2000-02-20 Masanao Izumo +2000-03-20 Masanao Izumo * libarc/arc_tar.c: Fixed memory leak. * libarc/url.c: url_dump(): Avoid return NULL if nbytes is zero. * timidity/controls.h: Redefine RC_NONE @@ -10,7 +28,7 @@ * timidity/mod2midi.c: period2note(): Fixed to search the period note between 0 and 119. -2000-02-12 Eric A. Welsh +2000-03-12 Eric A. Welsh * timidity/recache.c: cache_resampling() Defined RESAMPLATION_CACHE, INTERPVARS_CACHE Cache resampling should be the same as what is used for @@ -23,7 +41,7 @@ when it should not have been. The (double) casting and < 99.5 check fix this problem. -2000-02-12 Eric A. Welsh +2000-03-12 Eric A. Welsh * timidity/playmidi.c: fixed bug when resampling hit the end of a sample (mixing did not happen for the last portion of the @@ -31,7 +49,7 @@ * timidity/resample.c: set voice[i].timeout to 1 when resampling hits the end of a sample -2000-02-11 Paolo Bonizni +2000-03-11 Paolo Bonizni * timidity/mod.c: Fixed effect Fxy interpretation (xy=32 sets speed, not tempo) diff -ruN TiMidity++-2.9.1/NEWS TiMidity++-2.9.2/NEWS --- TiMidity++-2.9.1/NEWS Tue Mar 21 04:51:46 2000 +++ TiMidity++-2.9.2/NEWS Mon Apr 10 13:36:12 2000 @@ -1,3 +1,6 @@ +04/10, 2000 + * Version 2.9.2 released. + 03/21, 2000 * Version 2.9.1 released. * New command line option -T n: diff -ruN TiMidity++-2.9.1/configs/msc-config.h TiMidity++-2.9.2/configs/msc-config.h --- TiMidity++-2.9.1/configs/msc-config.h Tue Mar 21 04:52:28 2000 +++ TiMidity++-2.9.2/configs/msc-config.h Mon Apr 10 13:53:46 2000 @@ -261,7 +261,7 @@ /* In VDS Macro AAA=BBB is not available. */ #define __W32__ -#define TIMID_VERSION "2.9.1" +#define TIMID_VERSION "2.9.2" #define DEFAULT_PATH ".\\" #define AU_W32 #define WINSOCK diff -ruN TiMidity++-2.9.1/configure TiMidity++-2.9.2/configure --- TiMidity++-2.9.1/configure Mon Mar 20 20:36:20 2000 +++ TiMidity++-2.9.2/configure Mon Apr 10 13:33:10 2000 @@ -884,7 +884,7 @@ PACKAGE=TiMidity++ -VERSION=2.9.1 +VERSION=2.9.2 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.9.1/configure.in TiMidity++-2.9.2/configure.in --- TiMidity++-2.9.1/configure.in Mon Mar 20 20:36:12 2000 +++ TiMidity++-2.9.2/configure.in Tue Apr 4 11:24:16 2000 @@ -55,7 +55,7 @@ AC_INIT(timidity/timidity.c) SHELL=${CONFIG_SHELL-/bin/sh} AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(TiMidity++, 2.9.1, no-define) +AM_INIT_AUTOMAKE(TiMidity++, 2.9.2, no-define) dnl To use CONTAINS() macro (See acinclude.m4) CONTAINS_INIT diff -ruN TiMidity++-2.9.1/interface/ncurs_c.c TiMidity++-2.9.2/interface/ncurs_c.c --- TiMidity++-2.9.1/interface/ncurs_c.c Mon Mar 20 14:31:42 2000 +++ TiMidity++-2.9.2/interface/ncurs_c.c Thu Mar 30 10:36:06 2000 @@ -1727,6 +1727,7 @@ #endif /* USE_PDCURSES */ keypad(stdscr, TRUE); ctl.opened = 1; + init_chan_status(); } open_init_flag = 1; @@ -1737,7 +1738,6 @@ ctl_ncurs_mode = NCURS_MODE_MAIN; ctl_ncurs_back = ctl_ncurs_mode; - init_chan_status(); N_ctl_scrinit(); if(ctl.trace_playing) diff -ruN TiMidity++-2.9.1/timidity/Makefile.in TiMidity++-2.9.2/timidity/Makefile.in --- TiMidity++-2.9.1/timidity/Makefile.in Tue Mar 21 04:52:18 2000 +++ TiMidity++-2.9.2/timidity/Makefile.in Mon Apr 10 13:53:35 2000 @@ -315,8 +315,7 @@ playmidi.o: playmidi.c ../config.h timidity.h ../utils/support.h \ common.h ../libarc/url.h ../utils/mblock.h instrum.h playmidi.h \ readmidi.h output.h mix.h controls.h miditrace.h recache.h \ - ../libarc/arc.h reverb.h wrd.h aq.h ../interface/soundspec.h \ - tables.h + ../libarc/arc.h reverb.h wrd.h aq.h tables.h raw_a.o: raw_a.c ../config.h timidity.h ../utils/support.h output.h \ controls.h rcp.o: rcp.c ../config.h timidity.h ../utils/support.h common.h \ @@ -352,8 +351,8 @@ timidity.o: timidity.c ../config.h ../interface.h timidity.h \ ../utils/support.h common.h ../libarc/url.h ../utils/mblock.h \ instrum.h playmidi.h readmidi.h output.h controls.h tables.h \ - miditrace.h reverb.h ../interface/soundspec.h recache.h \ - ../libarc/arc.h ../utils/strtab.h wrd.h mid.defs aq.h mix.h \ + miditrace.h reverb.h recache.h ../libarc/arc.h \ + ../utils/strtab.h wrd.h mid.defs aq.h mix.h \ ../libunimod/unimod.h wave_a.o: wave_a.c ../config.h timidity.h ../utils/support.h output.h \ controls.h diff -ruN TiMidity++-2.9.1/timidity/mod2midi.c TiMidity++-2.9.2/timidity/mod2midi.c --- TiMidity++-2.9.1/timidity/mod2midi.c Mon Mar 20 15:52:11 2000 +++ TiMidity++-2.9.2/timidity/mod2midi.c Fri Mar 31 09:54:16 2000 @@ -74,10 +74,10 @@ #define NTSC_CLOCK 3579545.25 -#define NTSC_RATE (NTSC_CLOCK/428) +#define NTSC_RATE ((int32)(NTSC_CLOCK/428)) #define PAL_CLOCK 3546894.6 -#define PAL_RATE (PAL_CLOCK/428) +#define PAL_RATE ((int32)(PAL_CLOCK/428)) #define MOD_ROOT_NOTE 36 @@ -110,7 +110,6 @@ int wheel; /* current pitch wheel value */ int pan; /* current panning */ int vol; /* current volume */ - int start; /* sample start */ int32 noteson[4]; /* bit map for notes 0-127 */ } @@ -210,7 +209,7 @@ note = l - 1; /* - * 119 >= note >= 0 + * 112 >= note >= 0 * period_table[note] >= period > period_table[note + 1] */ @@ -234,18 +233,20 @@ return; /* MOD volume --> MIDI volume */ - vol = vol > 254 ? 127 : vol >> 1; - - if ((ModV[v].vol != vol) && (ModV[v].noteon != -1)) { - MIDIEVENT (at, ME_KEYPRESSURE, v, ModV[v].noteon, vol); + vol >>= 1; + if (vol < 1) vol = 1; + if (vol > 127) vol = 127; + + if (ModV[v].vol != vol) { + ModV[v].vol = vol; + MIDIEVENT (at, ME_EXPRESSION, v, vol, 0); } - ModV[v].vol = vol; } void Voice_SetPeriod (UBYTE v, ULONG period) { - int new_noteon, new_sample, bend; + int new_noteon, bend; if (v >= MOD_NUM_VOICES) return; @@ -263,11 +264,7 @@ if (ModV[v].noteon != new_noteon) { - if (!bitmapGet(ModV[v].noteson, new_noteon)) - { - MIDIEVENT(ModV[v].time, ME_NOTEON, v, new_noteon, 1); - bitmapSet(ModV[v].noteson, new_noteon); - } + MIDIEVENT(at, ME_KEYPRESSURE, v, ModV[v].noteon, 1); if (new_noteon < 0) { @@ -276,13 +273,12 @@ ModV[v].period); return; } - else - { - MIDIEVENT(at, ME_KEYPRESSURE, v, ModV[v].noteon, 1); - MIDIEVENT(at, ME_KEYPRESSURE, v, new_noteon, ModV[v].vol); - } + else if (!bitmapGet(ModV[v].noteson, new_noteon)) + { + MIDIEVENT(ModV[v].time, ME_NOTEON, v, new_noteon, 1); + bitmapSet(ModV[v].noteson, new_noteon); + } - ModV[v].noteon = new_noteon; } if (ModV[v].wheel != bend) @@ -290,6 +286,13 @@ ModV[v].wheel = bend; MIDIEVENT (at, ME_PITCHWHEEL, v, bend & 0x7F, (bend >> 7) & 0x7F); } + + if (ModV[v].noteon != new_noteon) + { + MIDIEVENT(at, ME_KEYPRESSURE, v, new_noteon, 127); + ModV[v].noteon = new_noteon; + } + } void @@ -333,15 +336,13 @@ { ModV[v].sample = s->id; MIDIEVENT(at, ME_SET_PATCH, v, ModV[v].sample, 0); - ModV[v].start = 0; } - if (ModV[v].start != start) + if (start > 0) { int a, b; - ModV[v].start = start; - a = (ModV[v].start & 0xff); - b = ((ModV[v].start >> 8) & 0xff); + a = (start & 0xff); + b = ((start >> 8) & 0xff); MIDIEVENT (at, ME_PATCH_OFFS, v, a, b); } @@ -351,7 +352,7 @@ MIDIEVENT (at, ME_PITCHWHEEL, v, bend & 0x7F, (bend >> 7) & 0x7F); } - MIDIEVENT (at, ME_NOTEON, v, ModV[v].noteon, ModV[v].vol); + MIDIEVENT (at, ME_NOTEON, v, ModV[v].noteon, 127); } void @@ -433,8 +434,7 @@ ModV[v].time = -1; ModV[v].period = 0; ModV[v].wheel = 0x2000; - ModV[v].vol = 64; - ModV[v].start = 0; + ModV[v].vol = 127; ModV[v].pan = (v & 1) ? 127 : 0; bitmapClear(ModV[v].noteson); @@ -522,10 +522,6 @@ if (s->flags & SF_REVERSE) sp->modes ^= MODES_REVERSE; if (s->flags & SF_16BITS) sp->modes ^= MODES_16BIT; - /* libunimod sets *both* SF_LOOP and SF_BIDI/SF_REVERSE */ - if (sp->modes & (MODES_PINGPONG | MODES_REVERSE)) - sp->modes &= ~MODES_LOOPING; - #ifdef USE_ENVELOPE /* envelope (0,1:attack, 2:sustain, 3,4,5:release) */ sp->modes |= MODES_ENVELOPE; @@ -540,18 +536,14 @@ sp->envelope_rate[2] = 0; /* release */ sp->envelope_offset[3] = env_offset(0); - if(modify_release) - sp->envelope_rate[3] = env_rate(255, (double)modify_release); /* -R# */ - else - sp->envelope_rate[3] = env_rate(255, 80.0); /* 80 msec */ + sp->envelope_rate[3] = env_rate(255, 80.0); /* 80 msec */ sp->envelope_offset[4] = sp->envelope_offset[3]; sp->envelope_rate[4] = 0; /* skip this stage */ sp->envelope_offset[5] = sp->envelope_offset[4]; sp->envelope_rate[5] = 0; /* skip this stage, then the voice is disappeared */ #endif - - sp->sample_rate = ((int32) PAL_RATE) >> s->divfactor; + sp->sample_rate = PAL_RATE >> s->divfactor; sp->low_freq = 0; sp->high_freq = 0x7fffffff; sp->root_freq = freq_table[MOD_ROOT_NOTE]; diff -ruN TiMidity++-2.9.1/timidity/readmidi.c TiMidity++-2.9.2/timidity/readmidi.c --- TiMidity++-2.9.1/timidity/readmidi.c Mon Mar 20 15:47:59 2000 +++ TiMidity++-2.9.2/timidity/readmidi.c Tue Apr 4 11:58:14 2000 @@ -1088,7 +1088,7 @@ /* Read a SMF track */ static int read_smf_track(struct timidity_file *tf, int trackno, int rewindp) { - int32 len; + int32 len, next_pos, pos; char tmp[4]; int lastchan, laststatus; int me, type, a, b, c; @@ -1105,6 +1105,7 @@ return -1; } len = BE_LONG(len); + next_pos = tf_tell(tf) + len; if(strncmp(tmp, "MTrk", 4)) { ctl->cmsg(CMSG_ERROR, VERB_NORMAL, @@ -1286,6 +1287,9 @@ break; case 0x2F: /* End of Track */ + pos = tf_tell(tf); + if(pos < next_pos) + tf_seek(tf, next_pos - pos, SEEK_CUR); return 0; case 0x51: /* Tempo */ @@ -2757,6 +2761,8 @@ for(trk = 0; trk < tracks; trk++) { + int32 next_pos, pos; + if(trk >= 1 && karaoke_format == -1) break; @@ -2766,6 +2772,7 @@ if(memcmp(tmp, "MTrk", 4)) break; + next_pos = tf_tell(tf) + len; laststatus = -1; for(;;) { @@ -2842,7 +2849,12 @@ reuse_mblock(&tmpbuffer); } else if(type == 0x2F) + { + pos = tf_tell(tf); + if(pos < next_pos) + tf_seek(tf, next_pos - pos, SEEK_CUR); break; /* End of track */ + } else skip(tf, len); } diff -ruN TiMidity++-2.9.1/timidity/recache.c TiMidity++-2.9.2/timidity/recache.c --- TiMidity++-2.9.1/timidity/recache.c Mon Mar 20 15:58:27 2000 +++ TiMidity++-2.9.2/timidity/recache.c Tue Mar 28 21:40:12 2000 @@ -67,25 +67,25 @@ # define RESAMPLATION_CACHE \ v1 = (int32)src[(ofs>>FRACTION_BITS)]; \ v2 = (int32)src[(ofs>>FRACTION_BITS)+1]; \ - if(((ofs-(1L<le)){ \ - dest[i] = (sample_t)(v1 + (((v2-v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS)); \ - }else{ \ + if(((ofs-(1L<le)){ \ + *dest++ = (sample_t)(v1 + (((v2-v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS)); \ + }else{ \ ofsd=ofs; \ v0 = (int32)src[(ofs>>FRACTION_BITS)-1]; \ v3 = (int32)src[(ofs>>FRACTION_BITS)+2]; \ ofs &= FRACTION_MASK; \ - temp=v2; \ - v2 = (6*v2 + \ - (((((((5*v3 - 11*v2 + 7*v1 - v0)>>1)* \ - ofs)>>FRACTION_BITS)*ofs)>>(FRACTION_BITS+1))-1))*ofs; \ - ofs = (1L << FRACTION_BITS) - ofs; \ - v1 = (6*v1 + \ - (((((((5*v0 - 11*v1 + 7*temp - v3)>>1)* \ - ofs)>>FRACTION_BITS)*ofs)>>(FRACTION_BITS+1))-1))*ofs; \ - v1 = (v1 + v2)/(6L< 32767)? 32767: ((v1 < -32768)? -32768: v1); \ - ofs=ofsd; \ - } + temp=v2; \ + v2 = (6*v2+((((5*v3 - 11*v2 + 7*v1 - v0)>>2)* \ + (ofs+(1L<>FRACTION_BITS)* \ + (ofs-(1L<>FRACTION_BITS)) \ + *ofs; \ + v1 = (((6*v1+((((5*v0 - 11*v1 + 7*temp - v3)>>2)* \ + ofs>>FRACTION_BITS)*(ofs-(2L<>FRACTION_BITS))*((1L< 32767)? 32767: ((v1 < -32768)? -32768: v1); \ + ofs = ofsd; \ + } #elif defined(LAGRANGE_INTERPOLATION) # define INTERPVARS_CACHE int32 ofsd, v0, v1, v2, v3; # define RESAMPLATION_CACHE \ diff -ruN TiMidity++-2.9.1/timidity/resample.c TiMidity++-2.9.2/timidity/resample.c --- TiMidity++-2.9.1/timidity/resample.c Mon Mar 20 15:58:27 2000 +++ TiMidity++-2.9.2/timidity/resample.c Tue Mar 28 21:40:12 2000 @@ -56,17 +56,17 @@ v0 = (int32)src[(ofs>>FRACTION_BITS)-1]; \ v3 = (int32)src[(ofs>>FRACTION_BITS)+2]; \ ofs &= FRACTION_MASK; \ - temp=v2; \ - v2 = (6*v2 + \ - (((((((5*v3 - 11*v2 + 7*v1 - v0)>>1)* \ - ofs)>>FRACTION_BITS)*ofs)>>(FRACTION_BITS+1))-1))*ofs; \ - ofs = (1L << FRACTION_BITS) - ofs; \ - v1 = (6*v1 + \ - (((((((5*v0 - 11*v1 + 7*temp - v3)>>1)* \ - ofs)>>FRACTION_BITS)*ofs)>>(FRACTION_BITS+1))-1))*ofs; \ - v1 = (v1 + v2)/(6L< 32767)? 32767: ((v1 < -32768)? -32768: v1); \ - ofs=ofsd; \ + temp=v2; \ + v2 = (6*v2+((((5*v3 - 11*v2 + 7*v1 - v0)>>2)* \ + (ofs+(1L<>FRACTION_BITS)* \ + (ofs-(1L<>FRACTION_BITS)) \ + *ofs; \ + v1 = (((6*v1+((((5*v0 - 11*v1 + 7*temp - v3)>>2)* \ + ofs>>FRACTION_BITS)*(ofs-(2L<>FRACTION_BITS))*((1L< 32767)? 32767: ((v1 < -32768)? -32768: v1); \ + ofs = ofsd; \ } #elif defined(LAGRANGE_INTERPOLATION) # define INTERPVARS int32 ofsd, v0, v1, v2, v3;