diff --git a/VERSION b/VERSION index 9a7e7aa..19bbc7d 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -February 07 2023 +February 08 2023 diff --git a/doc/CHANGES b/doc/CHANGES index 0bc7daf..6a7c512 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -15074,3 +15074,8 @@ abc2abc: in toabc.c, James Allwright has introduced a new option -c which replaces /2 with /. He also fixed the -h output in event_init() so that all options are listed. + +February 08 2023 +midi2abc, mftext, midistats: modified midifile.c so that it indicates where +it encounters an unexpected byte in the input midi file. + diff --git a/doc/readme.txt b/doc/readme.txt index 3317925..9fd48c8 100644 --- a/doc/readme.txt +++ b/doc/readme.txt @@ -1,12 +1,12 @@ abcMIDI : abc <-> MIDI conversion utilities -midi2abc version 3.58 December 09 2022 +midi2abc version 3.59 February 08 2023 abc2midi version 4.84 January 06 2023 abc2abc version 2.20 February 07 2023 yaps version 1.92 January 06 2023 abcmatch version 1.82 June 14 2022 midicopy version 1.38 May 06 2022 -midistats version 0.58 December 09 2022 +midistats version 0.59 February 08 2023 24th January 2002 diff --git a/midi2abc.c b/midi2abc.c index 0eba50d..fb6983c 100644 --- a/midi2abc.c +++ b/midi2abc.c @@ -45,7 +45,7 @@ * based on public domain 'midifilelib' package. */ -#define VERSION "3.58 December 09 2022 midi2abc" +#define VERSION "3.59 February 08 2023 midi2abc" #include /* Microsoft Visual C++ Version 6.0 or higher */ diff --git a/midifile.c b/midifile.c index f177f77..3747ecf 100644 --- a/midifile.c +++ b/midifile.c @@ -198,6 +198,7 @@ char *s; int c; while ( n++<4 && (c=(*Mf_getc)()) != EOF ) { + Mf_bytesread++; /* [SS] 2023-02-08 */ if ( c != *p++ ) { char buff[32]; (void) strcpy(buff,"expecting "); @@ -229,7 +230,7 @@ readheader() /* read a header chunk */ return; Mf_toberead = read32bit(); - Mf_bytesread = 0; + /* Mf_bytesread = 0; [SS] 2023-01-08 */ format = read16bit(); ntrks = read16bit(); division = read16bit(); @@ -281,7 +282,7 @@ readtrack() /* read a track chunk */ Mf_toberead = read32bit(); Mf_currtime = 0; - Mf_bytesread =0; + /* Mf_bytesread =0; [SS] 2022.02.08 */ if ( Mf_trackstart ) (*Mf_trackstart)(); @@ -397,9 +398,9 @@ static void badbyte(c) int c; { - char buff[32]; + char buff[96]; /* [SS] 2022.02.08 */ - (void) sprintf(buff,"unexpected byte: 0x%02x",c); + (void) sprintf(buff,"unexpected byte: 0x%02x at byte %ld (0x%lX)",c,Mf_bytesread,Mf_bytesread); mferror(buff); } diff --git a/midistats.c b/midistats.c index 4451885..d47ba4a 100644 --- a/midistats.c +++ b/midistats.c @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#define VERSION "0.58 December 08 2022 midistats" +#define VERSION "0.59 February 08 2023 midistats" #include /* Microsoft Visual C++ Version 6.0 or higher */