From c85053c4dbdff9e8d3549004d31e0d9e08822fce Mon Sep 17 00:00:00 2001 From: sshlien Date: Sun, 12 Jan 2025 12:39:05 -0500 Subject: [PATCH] 2025.01.12 --- VERSION | 2 +- doc/CHANGES | 21 +++++++++++++++++++++ doc/readme.txt | 2 +- store.c | 11 ++++++++--- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 0e326b2..8b17b87 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -January 07 2025 +January 12 2025 diff --git a/doc/CHANGES b/doc/CHANGES index dd9ff6a..3d8c2de 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -15557,3 +15557,24 @@ In addition event_key was not receiving negative fractional microtones. The problem was traced to a missing check in process_microtones() in parseabc.c + +January 12 2025 + +abc2midi ignores non-microtone accidentals. In the following example, + +X:1 +T: Non microtone accidentals +L:1/8 +Q:1/4=60 +M:8/8 +%%MIDI temperamentequal 36 +K:C +EF^FG^Gc^cd| + +The accidentals in front of F, G, and c were +ignored. + +Fix: in pitchof_b, for TEMPERLN or TEMPEREQ respect accidentals +occurring outside of microtones. + + diff --git a/doc/readme.txt b/doc/readme.txt index 89278c3..62cccf2 100644 --- a/doc/readme.txt +++ b/doc/readme.txt @@ -1,7 +1,7 @@ abcMIDI : abc <-> MIDI conversion utilities midi2abc version 3.59 February 08 2023 -abc2midi version 4.98 January 07 2025 +abc2midi version 4.99 January 12 2025 abc2abc version 2.22 April 30 2024 yaps version 1.94 April 30 2024 abcmatch version 1.83 February 19 2024 diff --git a/store.c b/store.c index 5c57588..3d4dc5f 100755 --- a/store.c +++ b/store.c @@ -186,7 +186,7 @@ int main() */ -#define VERSION "4.98 January 07 2025 abc2midi" +#define VERSION "4.99 January 12 2025 abc2midi" /* enables reading V: indication in header */ #define XTEN1 1 @@ -3723,7 +3723,9 @@ int *pitchbend; fifth_size, (3*fifth_size-octave_size), (5*fifth_size-2*octave_size) }; - /* in units cents [SS] 2020-07-17 */ + /* contains the pitches of c,d,etc in cent units after accounting + for fifth_size and octave_size + */ static const char *anoctave = "cdefgab"; acc = accidental; @@ -3731,7 +3733,6 @@ int *pitchbend; noteno = (int)note - 'a'; - /* [SS] 2015-08-18 */ if (acc == ' ' && !microtone) { /* no accidentals, apply current state */ acc = v->workmap[noteno][octave+4]; @@ -3774,6 +3775,10 @@ int *pitchbend; if ((temperament==TEMPERLN) || (temperament==TEMPEREQ)) { pitchvalue = tscale[p]/100.0; /* cents to semitones */ + /* respect accidentals when they do not occur in a microtone */ + if (acc == '^' && !microtone) pitchvalue = pitchvalue + (float) mul; /* [SS] 2025-01-12 */ + if (acc == '_' && !microtone) pitchvalue = pitchvalue - (float) mul; + /* printf("note = %c accidental = %c mul = %d p = %d pitchvalue = %f\n",note,accidental,mul,p,pitchvalue); */ pitchvalue = pitchvalue + octave*octave_size/100.0 + middle_c;