mirror of
https://github.com/sshlien/abcmidi.git
synced 2026-04-15 22:33:42 +00:00
2021.06.27
This commit is contained in:
98
doc/CHANGES
98
doc/CHANGES
@@ -14277,3 +14277,101 @@ Fix: moved headerprocess(), getvoicecontext(), etc to after
|
|||||||
calling event_octave().
|
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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
abcMIDI : abc <-> MIDI conversion utilities
|
abcMIDI : abc <-> MIDI conversion utilities
|
||||||
|
|
||||||
midi2abc version 3.47 May 25 2021
|
midi2abc version 3.48 June 27 2021
|
||||||
abc2midi version 4.58 June 24 2021
|
abc2midi version 4.59 June 27 2021
|
||||||
abc2abc version 2.15 May 25 2021
|
abc2abc version 2.15 May 25 2021
|
||||||
yaps version 1.87 May 25 2021
|
yaps version 1.87 May 25 2021
|
||||||
abcmatch version 1.79 May 25 2021
|
abcmatch version 1.79 May 25 2021
|
||||||
|
|||||||
@@ -2389,6 +2389,7 @@ int j;
|
|||||||
if ((chordnum == -1) && (action == 'c')) {
|
if ((chordnum == -1) && (action == 'c')) {
|
||||||
action = 'f';
|
action = 'f';
|
||||||
};
|
};
|
||||||
|
if (gchords) /* [SS] 2021-06-27 */
|
||||||
switch (action) {
|
switch (action) {
|
||||||
|
|
||||||
case 'z':
|
case 'z':
|
||||||
@@ -2412,6 +2413,7 @@ int j;
|
|||||||
else
|
else
|
||||||
save_note(g_num*len, g_denom, inversion+fun.base, 8192, fun.chan, fun.vel);
|
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' */
|
/* There is no break here so the switch statement continues into the next case 'c' */
|
||||||
|
|
||||||
case 'c':
|
case 'c':
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
* based on public domain 'midifilelib' package.
|
* based on public domain 'midifilelib' package.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define VERSION "3.48 May 25 2021 midi2abc"
|
#define VERSION "3.49 June 27 2021 midi2abc"
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
/* Microsoft Visual C++ Version 6.0 or higher */
|
/* Microsoft Visual C++ Version 6.0 or higher */
|
||||||
@@ -2739,6 +2739,8 @@ int trackno;
|
|||||||
char ch;
|
char ch;
|
||||||
int type,sf,mi,nn,denom,bb;
|
int type,sf,mi,nn,denom,bb;
|
||||||
|
|
||||||
|
sf = 0; /* [SS] 2021-06-27 */
|
||||||
|
|
||||||
while (((*textplace) != NULL) && ((*textplace)->when <= t)) {
|
while (((*textplace) != NULL) && ((*textplace)->when <= t)) {
|
||||||
str = (*textplace)->text;
|
str = (*textplace)->text;
|
||||||
ch = *str;
|
ch = *str;
|
||||||
|
|||||||
Reference in New Issue
Block a user