Compare commits

..

3 Commits

Author SHA1 Message Date
Seymour Shlien
c9d2c0f33b 2021.09.15 2021-09-15 16:25:29 -04:00
Seymour Shlien
19fbb6b7e7 2021.06.27 2021-06-27 17:09:51 -04:00
Seymour Shlien
504cbe93f7 2021.06.24 2021-06-24 14:37:48 -04:00
6 changed files with 151 additions and 12 deletions

View File

@@ -1,2 +1,2 @@
2021 May 25 2021 2021 September 15 2021

View File

@@ -14251,3 +14251,131 @@ time signatures like M: none or M:7/8. The code for dealing with
3/2, 3/4, 3/8 ... time signatures was improved. 3/2, 3/4, 3/8 ... time signatures was improved.
June 24 2021
abc2midi bug: in the following sample
X:1
T: octave
M: 2/4
L: 1/8
K: none octave=1
V:1
C4|
V:2
C4|
The octave=1 applies only to voice 1 and does not
act as global variable applying to both voices.
Analysis: event_octave either sets global.octaveshift or
v.octaveshift depending upon the variable pastheader. Pastheader
was set to 1 by headerprocess() in event_key() prior to calling
event_octave which prevented global.octaveshift from being set.
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
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:

View File

@@ -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.57 May 25 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
@@ -14,7 +14,7 @@ J.R.Allwright@westminster.ac.uk
University of Westminster, University of Westminster,
London, UK London, UK
November 2020 June 2021
Seymour Shlien Seymour Shlien
Ottawa, Canada Ottawa, Canada

View File

@@ -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 */

View File

@@ -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;

17
store.c
View File

@@ -186,7 +186,7 @@ int main()
*/ */
#define VERSION "4.57 May 25 2021 abc2midi" #define VERSION "4.60 September 15 2021 abc2midi"
/* enables reading V: indication in header */ /* enables reading V: indication in header */
#define XTEN1 1 #define XTEN1 1
@@ -5957,11 +5957,13 @@ int explict;
copymap(&global); copymap(&global);
sf = sharps; sf = sharps;
mi = minor; mi = minor;
headerprocess();
v = getvoicecontext(1); /* [SS] 2021-06-24
if (!inbody) v1index = notes; /* save position in case of split voice */ ***headerprocess();
};
***v = getvoicecontext(1);
***if (!inbody) v1index = notes; /* save position in case of split voice */
if (gotclef) if (gotclef)
{ {
event_octave(clef->octave_offset, 0); event_octave(clef->octave_offset, 0);
@@ -5969,6 +5971,11 @@ int explict;
if (gotoctave) { if (gotoctave) {
event_octave(octave,0); event_octave(octave,0);
}; };
/* [SS] 2021-06-24 */
headerprocess();
v = getvoicecontext(1);
if (!inbody) v1index = notes; /* save position in case of split voice */
};
}; };
} }