mirror of
https://github.com/sshlien/abcmidi.git
synced 2026-04-15 14:23:41 +00:00
2022.12.22
This commit is contained in:
57
doc/CHANGES
57
doc/CHANGES
@@ -14869,3 +14869,60 @@ December 9 2022
|
||||
|
||||
Cleaning out -stats code in midi2abc.
|
||||
|
||||
|
||||
December 21 2022
|
||||
|
||||
abc2midi:
|
||||
Wnen <note1> equals <note2> in the instrument=<note1>/<note2> directive,
|
||||
note2 should be treated as c (midi pitch 72). Fix: parsesound in
|
||||
parseabc.c was modified to return a midi pitch of 72 when the two
|
||||
notes are equal.
|
||||
|
||||
test file:
|
||||
|
||||
X:1
|
||||
T: transpose
|
||||
M: 4/4
|
||||
L: 1/4
|
||||
K: C instrument=F/F
|
||||
FGAB|cdef|
|
||||
|
||||
produces a midi file which looks like
|
||||
|
||||
X: 1
|
||||
T: from h1.mid
|
||||
M: 4/4
|
||||
L: 1/8
|
||||
Q:1/4=120
|
||||
K:C % 0 sharps
|
||||
V:1
|
||||
c2 d2 e2 ^f2| \
|
||||
g2 a2 b2 c'2|
|
||||
|
||||
when it was translated back to abc using midi2abc.
|
||||
|
||||
Note that this change also applies to sound= and shift= even though
|
||||
this may not be specified in the standard
|
||||
http://abcnotation.com/wiki/abc:standard:v2.2#transposing_instrument_examples
|
||||
|
||||
|
||||
December 22 2022
|
||||
|
||||
abcmidi: segementation fault. The following file produced a
|
||||
segmentation fault.
|
||||
|
||||
X:1
|
||||
T: transpose
|
||||
M: 4/4
|
||||
L: 1/4
|
||||
K: C instrument=F
|
||||
FGAB|cdef|
|
||||
|
||||
Analysis: there is an invisible space following F in the
|
||||
line K: C instrument=F . As a result the function note2midi
|
||||
called pitch2midi with an invalid note (a space). The line
|
||||
p = (int) ((long) strchr(anoctave, note) - (long) anoctave);
|
||||
returned a bad index into the scale array.
|
||||
|
||||
Fix: tested that p is in the range 0 to 7.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
abcMIDI : abc <-> MIDI conversion utilities
|
||||
|
||||
midi2abc version 3.58 December 09 2022
|
||||
abc2midi version 4.76 August 01 2022
|
||||
abc2midi version 4.77 December 21 2022
|
||||
abc2abc version 2.18 June 14 2022
|
||||
yaps version 1.90 June 14 2022
|
||||
abcmatch version 1.82 June 14 2022
|
||||
|
||||
24
parseabc.c
24
parseabc.c
@@ -1050,17 +1050,16 @@ parsesound (s, word, gottranspose, transpose)
|
||||
*s = *s + 1;
|
||||
skipspace (s);
|
||||
p1 = note2midi (s);
|
||||
/* printf("midi note = %d\n",p1); */
|
||||
/*printf("p1 midi note = %d\n",p1);*/
|
||||
p2 = note2midi (s);
|
||||
/*printf("p2 midi note = %d\n",p2);*/
|
||||
|
||||
if (p2 == p1) {
|
||||
*gottranspose = 0;
|
||||
*transpose = 0;
|
||||
} else {
|
||||
/* printf("midi note = %d\n",p2); */
|
||||
*transpose = p2 - p1; /* [SS] 2022.02.18 2022.04.27 */
|
||||
/* printf("transpose = %d\n",*transpose); */
|
||||
*gottranspose = 1;
|
||||
}
|
||||
p2 = 72; /* [SS] 2022.12.21 */
|
||||
}
|
||||
*transpose = p2 - p1; /* [SS] 2022.02.18 2022.04.27 */
|
||||
/* printf("transpose = %d\n",*transpose); */
|
||||
*gottranspose = 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -2736,6 +2735,10 @@ int mult, octave;
|
||||
noteno = (int)note - 'a';
|
||||
|
||||
p = (int) ((long) strchr(anoctave, note) - (long) anoctave);
|
||||
if (p < 0 || p > 6) { /* [SS] 2022-12-22 */
|
||||
printf("illegal note %c\n",note);
|
||||
return 72;
|
||||
}
|
||||
p = scale[p];
|
||||
if (acc == '^') p = p + mul;
|
||||
if (acc == '_') p = p - mul;
|
||||
@@ -2757,8 +2760,9 @@ char msg[80];
|
||||
int octave;
|
||||
int mult;
|
||||
int pitch;
|
||||
/*printf("note2midi: %c\n",**s); */
|
||||
/*printf("note2midi: %c\n",**s);*/
|
||||
if (**s == '\0') return 72;
|
||||
note = **s;
|
||||
mult = 1;
|
||||
accidental = ' ';
|
||||
switch (**s)
|
||||
|
||||
Reference in New Issue
Block a user