2022.03.20

This commit is contained in:
Seymour Shlien
2022-03-21 08:39:17 -04:00
parent 35876618bb
commit 47a0cecc5d
5 changed files with 45 additions and 4 deletions

View File

@@ -14661,4 +14661,43 @@ if (strstr(line,"%%begintext") != NULL) {
which returns the pointer to %%begintext in the line.
March 20 2022
abc2midi bug: I could not demonstrate this bug on my own system.
When abc2midi is compiled on a Debian linux system using the -O2 compilation
flag (by default), it produces a faulty midi file for abc files containing
gchords. Here is a sample file.
%abc-2.2
X:1
T:Test
M:C
L:1/4
Q:1/4=135
V:S clef=treble
V:s clef=treble
K:C
%%score (s S)
%
[V:s] "C" x2 "a" x2 |
[V:S] C C A A |
The problem occurs with the bass accompaniment generated by "a". The
bass accompaniment creates a long string of A,, notes.
This problem disappears when abc2midi is compiled without the
-O2 optimizer.
Analysis: the bug was traced to the code gchord_configure in genmidi.c.
The limit of the loops
for (j=0; j<chordlen[chordnum]; j++)
contain bad data when chordnum is set to -1 (for bass accompaniment).
Fix: exit from gchord_configure function when chordnum is less than
zero.
The problem was identified to me by Jakob Englhauser. Jakob verified
that this fix works.