diff --git a/VERSION b/VERSION index 653acdb..09c8883 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -2021 June 24 2021 +2021 June 27 2021 diff --git a/doc/CHANGES b/doc/CHANGES index cb9304b..837e3ba 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -14277,3 +14277,101 @@ Fix: moved headerprocess(), getvoicecontext(), etc to after calling event_octave(). +June 27 2021 + +midi2abc: bug +For some midi files midi2abc returns something like this +X: 1 +T: from gchordbreakdown1.mid +M: 4/4 +L: 1/8 +Q:1/4=120 +K:C % 0 sharps +V:1 +K:E % 16 sharps +=c=d e=g e4| \ + + +Analysis, in the function handletext(), the local variable sf is +declared as an integer but not initialized. The function +sscanf(str,"%d %d",&sf,&mi); +attempts to read sf and mi from str, but str does not contain +any integers, and sf is not changed. +Temporary fix: initialized sf to 0. + + +June 27 2021 + +abc2midi: %%MIDI gchordoff produces garbage. In the following file + +X:1 +T: gchord breakdown +M: 4/4 +L: 1/8 +Q:1/4=120 +K:C +%%MIDI gchord ghi2ihi2 +%%MIDI gchordoff +"C" cd eg e4 |"Am" ag ag e4 | +%%MIDI gchordon +"Dm" defe d4 | "G7" g6z2 | + +The output in track 2 as seen by midi2abc looks like this. +X: 1 +T: from gchordbreakdown1.mid +M: 4/4 +L: 1/8 +Q:1/4=120 +K:C % 0 sharps +V:1 +cd eg e4| \ +ag ag e4| \ +de fe d4| \ +g6 +V:2 +F,,,,F,,,, F,,,,2 F,,,,F,,,, F,,,,2| \ +F,,,,F,,,, F,,,,2 F,,,,F,,,, F,,,,2| \ +D,F, A,2 A,F, A,2| \ +G,B, D2 DB, D2| + +instead of + +X: 1 +T: from gchordbreakdown1.mid +M: 4/4 +L: 1/8 +Q:1/4=120 +K:C % 0 sharps +V:1 +cd eg e4| \ +ag ag e4| \ +de fe d4| \ +g6 +V:2 +z8| \ +z8| \ +D,F, A,2 A,F, A,2| \ +G,B, D2 DB, D2| + +Analysis: abc2midi works correctly without the +%%MIDI gchord ghi2ihi2 +declaration. The problem occurs in the function dogchords(). +This function was expanded to handle alberti starting from May 1 2004. +Unfortunately, the fix introduced in 2016-01-03 introduced this +problem when %%MIDI gchordoff sets gchords to 0. The else branch +outputs gchordnotes[gchordnotes_size] when in fact, no note should +be queued out. + +Fix: prefixed the switch(action) statement with the line + if (gchords) /* [SS] 2021-06-27 */ +preventing any note output when gchords is 0. + +In addition, the case 'b' was missing a break, allowing the switch statement +to continue to case 'c' and causing a different problem when +%%MIDI gchord ffbb + + + + + + diff --git a/doc/readme.txt b/doc/readme.txt index 73e54a9..3ae6037 100644 --- a/doc/readme.txt +++ b/doc/readme.txt @@ -1,7 +1,7 @@ abcMIDI : abc <-> MIDI conversion utilities -midi2abc version 3.47 May 25 2021 -abc2midi version 4.58 June 24 2021 +midi2abc version 3.48 June 27 2021 +abc2midi version 4.59 June 27 2021 abc2abc version 2.15 May 25 2021 yaps version 1.87 May 25 2021 abcmatch version 1.79 May 25 2021 diff --git a/genmidi.c b/genmidi.c index 8ee610d..7aa3de1 100644 --- a/genmidi.c +++ b/genmidi.c @@ -2389,6 +2389,7 @@ int j; if ((chordnum == -1) && (action == 'c')) { action = 'f'; }; + if (gchords) /* [SS] 2021-06-27 */ switch (action) { case 'z': @@ -2412,6 +2413,7 @@ int j; else save_note(g_num*len, g_denom, inversion+fun.base, 8192, fun.chan, fun.vel); }; + break; /* [SS] 2021-06-27 */ /* There is no break here so the switch statement continues into the next case 'c' */ case 'c': diff --git a/midi2abc.c b/midi2abc.c index c36105e..4f9e756 100644 --- a/midi2abc.c +++ b/midi2abc.c @@ -45,7 +45,7 @@ * based on public domain 'midifilelib' package. */ -#define VERSION "3.48 May 25 2021 midi2abc" +#define VERSION "3.49 June 27 2021 midi2abc" #include /* Microsoft Visual C++ Version 6.0 or higher */ @@ -2739,6 +2739,8 @@ int trackno; char ch; int type,sf,mi,nn,denom,bb; + sf = 0; /* [SS] 2021-06-27 */ + while (((*textplace) != NULL) && ((*textplace)->when <= t)) { str = (*textplace)->text; ch = *str; diff --git a/store.c b/store.c index f5acb5d..5cb36ac 100644 --- a/store.c +++ b/store.c @@ -186,7 +186,7 @@ int main() */ -#define VERSION "4.58 June 24 2021 abc2midi" +#define VERSION "4.59 June 27 2021 abc2midi" /* enables reading V: indication in header */ #define XTEN1 1