mirror of
https://github.com/sshlien/abcmidi.git
synced 2025-12-15 15:51:01 +00:00
Compare commits
1 Commits
2022.12.27
...
2022.12.30
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
166a28d182 |
24
doc/CHANGES
24
doc/CHANGES
@@ -14951,6 +14951,28 @@ an extra parameter, word, indicating the type of directive.
|
||||
It will issue a warning if it detects a '/' in the sound= or
|
||||
shift= directives.
|
||||
|
||||
|
||||
December 30 2022
|
||||
|
||||
abcmidi: The instrument=*/c is a special directive that suppresses
|
||||
a transpose. For example:
|
||||
|
||||
X:2
|
||||
T: transpose using instrument=_B/c
|
||||
T: clarinet coded in concert pitch, displayed in Bb (as in player part)
|
||||
M: 4/4
|
||||
L: 1/4
|
||||
K: C
|
||||
V:1 nm="Flute"
|
||||
CDEF|GABc|cBAG|FEDC|
|
||||
V:2 instrument=_B/c nm="Clarinet\nin Bb"
|
||||
CDEF|GABc|cBAG|FEDC|
|
||||
|
||||
The notes in V:2 are displayed up using score=_Bc, but they are still
|
||||
played as written (sound=cc does nothing).
|
||||
Fix: the code in the block
|
||||
if (casecmp(word,"instrument") == 0 {
|
||||
...
|
||||
}
|
||||
in parsesound() (parseabc.c) was rewritten.
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
abcMIDI : abc <-> MIDI conversion utilities
|
||||
|
||||
midi2abc version 3.58 December 09 2022
|
||||
abc2midi version 4.78 December 27 2022
|
||||
abc2midi version 4.80 December 30 2022
|
||||
abc2abc version 2.18 June 14 2022
|
||||
yaps version 1.90 June 14 2022
|
||||
abcmatch version 1.82 June 14 2022
|
||||
|
||||
22
parseabc.c
22
parseabc.c
@@ -1022,8 +1022,7 @@ parsetranspose (s, word, gottranspose, transpose)
|
||||
};
|
||||
|
||||
/* [SS] 2021-10-11 */
|
||||
int
|
||||
parsesound (s, word, gottranspose, transpose)
|
||||
int parsesound (s, word, gottranspose, transpose)
|
||||
/* parses string sound =
|
||||
shift =
|
||||
instrument = note1note2 or note1/note2
|
||||
@@ -1054,15 +1053,25 @@ parsesound (s, word, gottranspose, transpose)
|
||||
p2 = note2midi (s,word);
|
||||
/*printf("p2 midi note = %d\n",p2);*/
|
||||
|
||||
if (p2 == p1) {
|
||||
p2 = 72; /* [SS] 2022.12.21 */
|
||||
if (p2 == p1 || p2 == 0) {
|
||||
*transpose = 72 - p1; /* [SS] 2022.12.30 */
|
||||
}
|
||||
if (casecmp(word,"instrument") == 0) { /*2022.12.27 */
|
||||
*transpose = p1 - p2; /* [SS] 2022.02.18 2022.04.27 */
|
||||
if (p2 == 0) { /* <note2> is missing */
|
||||
*transpose = p1 - 72;
|
||||
}
|
||||
if (p2 == p1 || p2 == 0) {
|
||||
*transpose = p1 - 72; /* [SS] 2022.12.30 */
|
||||
}
|
||||
if (p2 == 72 && fileprogram == ABC2MIDI) {
|
||||
*transpose = 0;
|
||||
} /* [SS] 2022.12.30 */
|
||||
} else {
|
||||
*transpose = p2 - p1; /* [SS] 2022.02.18 2022.04.27 */
|
||||
}
|
||||
*gottranspose = 1;
|
||||
/*printf("p1 = %d p2 = %d transpose = %d\n",p1,p2,*transpose);*/
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -2752,8 +2761,7 @@ return p;
|
||||
|
||||
|
||||
/* [SS] 2021-10-11 */
|
||||
int
|
||||
note2midi (char** s, char *word)
|
||||
int note2midi (char** s, char *word)
|
||||
{
|
||||
/* for implementing sound=, shift= and instrument= key signature options */
|
||||
|
||||
@@ -2865,7 +2873,7 @@ switch (**s)
|
||||
}
|
||||
if (note == ' ')
|
||||
{
|
||||
event_error ("Malformed note : expecting a-g or A-G");
|
||||
return 0;
|
||||
}
|
||||
pitch = pitch2midi(note, accidental, mult, octave);
|
||||
return pitch;
|
||||
|
||||
Reference in New Issue
Block a user