mirror of
https://github.com/sshlien/abcmidi.git
synced 2026-04-15 14:23:41 +00:00
2024.03.02
This commit is contained in:
56
doc/CHANGES
56
doc/CHANGES
@@ -15379,7 +15379,7 @@ Fix: commented out the line in isclef() which zeros the octave_offset.
|
|||||||
|
|
||||||
February 25 2024
|
February 25 2024
|
||||||
|
|
||||||
abcmidi note:
|
abc2midi note:
|
||||||
|
|
||||||
Besides clef=treble-8, the abcmidi 2.2 standard also recognizes
|
Besides clef=treble-8, the abcmidi 2.2 standard also recognizes
|
||||||
clef=treble_8, clef=treble^8 and etc. These clefs do not transpose
|
clef=treble_8, clef=treble^8 and etc. These clefs do not transpose
|
||||||
@@ -15396,3 +15396,57 @@ It is necessary to use the new function, readword_with_()
|
|||||||
which does not break the string on encountering either
|
which does not break the string on encountering either
|
||||||
the underscore _ or caret ^.
|
the underscore _ or caret ^.
|
||||||
|
|
||||||
|
|
||||||
|
March 02 2024
|
||||||
|
|
||||||
|
abc2midi deviance from abc standard 2.2
|
||||||
|
|
||||||
|
The clef=, octave=, and transpose= in the V: command are
|
||||||
|
expected to be persistant and independent of each other. They
|
||||||
|
are changed independently any time a new clef=, octave=,
|
||||||
|
or transpose= appears. These are stored in 3 variables.
|
||||||
|
And the pitch of a note is assigned the sum of these values.
|
||||||
|
|
||||||
|
Analysis:
|
||||||
|
event_note computes the midi pitch from note (one of a,b,c,d,e,f,g),
|
||||||
|
the xoctave, clef, accidental, and mult which are all input
|
||||||
|
parameters to that function. In addition it accesses the global
|
||||||
|
voice structure v of the active voice to get the octaveshift
|
||||||
|
for that voice. The function computes the local variable octave
|
||||||
|
from xoctave, clef->octave_offset and v->octaveshift.
|
||||||
|
|
||||||
|
Prior to this fix and since May 21 2021, the local variable
|
||||||
|
octave was either assigned to the value of
|
||||||
|
clef->octave_offset + xoctave or to v->octaveshift + xoctave when
|
||||||
|
v->octaveshift is nonzero. In addition, event_voice also changes
|
||||||
|
v->octaveshift when it encounters a new clef=.
|
||||||
|
|
||||||
|
Fix:
|
||||||
|
|
||||||
|
In order to comply with this standard, the code in event_voice
|
||||||
|
was modified to prevent clef= from modifying v->octaveshift. In
|
||||||
|
addition event_note now computes octave as below.
|
||||||
|
octave = clef->octave_offset + v->octaveshift + xoctave; /*[SS] 2024-03-02*/
|
||||||
|
|
||||||
|
Note this is a significant change as it could break some abc
|
||||||
|
files. For example, if the user put clef=treble+8 and also
|
||||||
|
octave=+1, just to be safe, then the resulting octave would be higher
|
||||||
|
than expected. Fortunately, octave= is still rarely used.
|
||||||
|
|
||||||
|
Here is the test file for verifying this fix.
|
||||||
|
|
||||||
|
X:1
|
||||||
|
T:Test for octave shifts in sound
|
||||||
|
M:4/4
|
||||||
|
K:C
|
||||||
|
% The following seven notes should have equal sound
|
||||||
|
V:1 clef=treble
|
||||||
|
d8 |\
|
||||||
|
[V:1 clef=treble+8] D8 |\
|
||||||
|
[V:1 octave=-1] d8 |\
|
||||||
|
[V:1 transpose=12] D8 |\
|
||||||
|
[V:1 clef=treble] d8 |\
|
||||||
|
[V:1 octave=0] D8 |\
|
||||||
|
[V:1 transpose=0] d8 |]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
abcMIDI : abc <-> MIDI conversion utilities
|
abcMIDI : abc <-> MIDI conversion utilities
|
||||||
|
|
||||||
midi2abc version 3.59 February 08 2023
|
midi2abc version 3.59 February 08 2023
|
||||||
abc2midi version 4.90 February 25 2024
|
abc2midi version 4.91 March 02 2024
|
||||||
abc2abc version 2.21 February 19 2024
|
abc2abc version 2.21 February 19 2024
|
||||||
yaps version 1.93 February 19 2024
|
yaps version 1.93 February 19 2024
|
||||||
abcmatch version 1.83 February 19 2024
|
abcmatch version 1.83 February 19 2024
|
||||||
|
|||||||
14
store.c
14
store.c
@@ -186,7 +186,7 @@ int main()
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define VERSION "4.90 February 25 2024 abc2midi"
|
#define VERSION "4.91 March 02 2024 abc2midi"
|
||||||
|
|
||||||
/* enables reading V: indication in header */
|
/* enables reading V: indication in header */
|
||||||
#define XTEN1 1
|
#define XTEN1 1
|
||||||
@@ -2976,10 +2976,11 @@ struct voice_params *vp;
|
|||||||
v = getvoicecontext(n);
|
v = getvoicecontext(n);
|
||||||
addfeature(VOICE, v->indexno, 0, 0);
|
addfeature(VOICE, v->indexno, 0, 0);
|
||||||
|
|
||||||
if (vp->gotclef)
|
/*****if (vp->gotclef)
|
||||||
{
|
{
|
||||||
event_octave(vp->new_clef.octave_offset, 1);
|
event_octave(vp->new_clef.octave_offset, 1);
|
||||||
}
|
}*** [SS] 2024-03.02 */
|
||||||
|
|
||||||
if (vp->gotoctave) {
|
if (vp->gotoctave) {
|
||||||
event_octave(vp->octave,1);
|
event_octave(vp->octave,1);
|
||||||
};
|
};
|
||||||
@@ -4304,11 +4305,16 @@ int xoctave, n, m;
|
|||||||
event_fatal_error("Internal error - no voice allocated");
|
event_fatal_error("Internal error - no voice allocated");
|
||||||
};
|
};
|
||||||
if (gracenotes && ignore_gracenotes) return; /* [SS] 2010-01-08 */
|
if (gracenotes && ignore_gracenotes) return; /* [SS] 2010-01-08 */
|
||||||
if (v->octaveshift == 0) { /* [JA] 2021-05-21 */
|
|
||||||
|
/* [SS] 2024-03-02
|
||||||
|
printf("clef->octave_offset = %d v->octaveshift = %d\n",clef->octave_offset,v->octaveshift);
|
||||||
|
if (v->octaveshift == 0) { [JA] 2021-05-21
|
||||||
octave = xoctave + clef->octave_offset;
|
octave = xoctave + clef->octave_offset;
|
||||||
} else {
|
} else {
|
||||||
octave = xoctave + v->octaveshift;
|
octave = xoctave + v->octaveshift;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
octave = clef->octave_offset + v->octaveshift + xoctave; /*[SS] 2024-03-02*/
|
||||||
num = n;
|
num = n;
|
||||||
denom = m;
|
denom = m;
|
||||||
if (v->inchord) v->chordcount = v->chordcount + 1;
|
if (v->inchord) v->chordcount = v->chordcount + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user