mirror of
https://github.com/sshlien/abcmidi.git
synced 2025-12-08 19:01:02 +00:00
Compare commits
2 Commits
2021.06.24
...
2021.09.15
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9d2c0f33b | ||
|
|
19fbb6b7e7 |
102
doc/CHANGES
102
doc/CHANGES
@@ -14277,3 +14277,105 @@ 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
|
||||||
|
|
||||||
|
|
||||||
|
September 15 2021
|
||||||
|
|
||||||
|
abc2midi bug:
|
||||||
|
The last fix in June 27 2021 inserting a break introduced a new bug.
|
||||||
|
The chord associated with the 'b' gchord code was missing. b and f
|
||||||
|
codes were indistinguishable. Fix: removed the break in the switch
|
||||||
|
statement for case b:
|
||||||
|
|
||||||
|
|||||||
@@ -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.60 September 15 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':
|
||||||
@@ -2411,8 +2412,9 @@ int j;
|
|||||||
save_note(g_num*len, g_denom, basepitch+fun.base, 8192, fun.chan, fun.vel);
|
save_note(g_num*len, g_denom, basepitch+fun.base, 8192, fun.chan, fun.vel);
|
||||||
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);
|
||||||
};
|
}
|
||||||
/* There is no break here so the switch statement continues into the next case 'c' */
|
/* break; * [SS] 2021-06-27 2021-09-15 */
|
||||||
|
/* There should not be a break here so the switch statement continues into the next case 'c' */
|
||||||
|
|
||||||
case 'c':
|
case 'c':
|
||||||
/* do chord with handling of any 'inversion' note */
|
/* do chord with handling of any 'inversion' note */
|
||||||
|
|||||||
@@ -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