mirror of
https://github.com/sshlien/abcmidi.git
synced 2026-04-15 14:23:41 +00:00
2022.12.27
This commit is contained in:
28
doc/CHANGES
28
doc/CHANGES
@@ -14926,3 +14926,31 @@ returned a bad index into the scale array.
|
||||
|
||||
Fix: tested that p is in the range 0 to 7.
|
||||
|
||||
|
||||
December 27 2022
|
||||
|
||||
abcmidi: The instrument=<note1>/<note2> is defined as a shorthand
|
||||
for score=<note1><note2> sound=c<note2>. For instrument=,<note1>
|
||||
indicates the key of the instrument and <note2> is either c or C.
|
||||
The sound= directive specifies the note and how it is played.
|
||||
For example, sound=c_B indicates that the note c is played as
|
||||
_B on the instrument. Every note is transposed down by two semitones.
|
||||
The problem is that, the notes in the instrument directive are
|
||||
in the opposite order of the sound= and score= directives.
|
||||
The function parsesound() in parseabc.c treats takes care of
|
||||
the directives sound =, shift = and instrument =.
|
||||
Unfortunately, all these directives are treated in the same
|
||||
manner causing the instrument= directive to transpose
|
||||
in the wrong direction.
|
||||
|
||||
Fix: for the special case, instrument=, transpose is set to
|
||||
p1 - p2 instead of p2 - p1.
|
||||
|
||||
The '/' is only part of the instrument= syntax. Note2midi has
|
||||
an extra parameter, word, indicating the type of directive.
|
||||
It will issue a warning if it detects a '/' in the sound= or
|
||||
shift= directives.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
abcMIDI : abc <-> MIDI conversion utilities
|
||||
|
||||
midi2abc version 3.58 December 09 2022
|
||||
abc2midi version 4.77 December 21 2022
|
||||
abc2midi version 4.78 December 27 2022
|
||||
abc2abc version 2.18 June 14 2022
|
||||
yaps version 1.90 June 14 2022
|
||||
abcmatch version 1.82 June 14 2022
|
||||
|
||||
21
parseabc.c
21
parseabc.c
@@ -82,7 +82,7 @@ extern char *malloc ();
|
||||
extern char *strchr ();
|
||||
#endif
|
||||
|
||||
int note2midi (char** s);
|
||||
int note2midi (char** s, char* word); /*[SS] 2022-12-27 added word */
|
||||
int lineno;
|
||||
int parsing_started = 0;
|
||||
int parsing, slur;
|
||||
@@ -1049,16 +1049,19 @@ parsesound (s, word, gottranspose, transpose)
|
||||
} else {
|
||||
*s = *s + 1;
|
||||
skipspace (s);
|
||||
p1 = note2midi (s);
|
||||
p1 = note2midi (s,word);
|
||||
/*printf("p1 midi note = %d\n",p1);*/
|
||||
p2 = note2midi (s);
|
||||
p2 = note2midi (s,word);
|
||||
/*printf("p2 midi note = %d\n",p2);*/
|
||||
|
||||
if (p2 == p1) {
|
||||
p2 = 72; /* [SS] 2022.12.21 */
|
||||
}
|
||||
*transpose = p2 - p1; /* [SS] 2022.02.18 2022.04.27 */
|
||||
/* printf("transpose = %d\n",*transpose); */
|
||||
if (casecmp(word,"instrument") == 0) { /*2022.12.27 */
|
||||
*transpose = p1 - p2; /* [SS] 2022.02.18 2022.04.27 */
|
||||
} else {
|
||||
*transpose = p2 - p1; /* [SS] 2022.02.18 2022.04.27 */
|
||||
}
|
||||
*gottranspose = 1;
|
||||
}
|
||||
return 1;
|
||||
@@ -2617,6 +2620,7 @@ print_inputline ()
|
||||
static void check_bar_repeats (int bar_type, char *replist)
|
||||
{
|
||||
voice_context_t *cv = &voicecode[voicenum];
|
||||
char error_message[140];
|
||||
|
||||
switch (bar_type) {
|
||||
case SINGLE_BAR:
|
||||
@@ -2636,7 +2640,6 @@ static void check_bar_repeats (int bar_type, char *replist)
|
||||
break;
|
||||
case REP_BAR:
|
||||
if (!cv->expect_repeat) {
|
||||
char error_message[80];
|
||||
|
||||
if (cv->repeat_count == 0)
|
||||
{
|
||||
@@ -2750,7 +2753,7 @@ return p;
|
||||
|
||||
/* [SS] 2021-10-11 */
|
||||
int
|
||||
note2midi (char** s)
|
||||
note2midi (char** s, char *word)
|
||||
{
|
||||
/* for implementing sound=, shift= and instrument= key signature options */
|
||||
|
||||
@@ -2817,6 +2820,10 @@ switch (**s)
|
||||
/* skip / which occurs in instrument = command */
|
||||
*s = *s + 1;
|
||||
/* printf("note = %c accidental = %c mult = %d octave= %d \n",note,accidental,mult,octave); */
|
||||
if (casecmp(word,"instrument") != 0) { /* [SS] 2022-12-27 */
|
||||
event_warning("score and shift directives do not expect an embedded '/'");
|
||||
}
|
||||
|
||||
pitch = pitch2midi(note, accidental, mult, octave);
|
||||
return pitch;
|
||||
}
|
||||
|
||||
4
store.c
4
store.c
@@ -186,7 +186,7 @@ int main()
|
||||
|
||||
*/
|
||||
|
||||
#define VERSION "4.77 December 21 2022 abc2midi"
|
||||
#define VERSION "4.78 December 27 2022 abc2midi"
|
||||
|
||||
/* enables reading V: indication in header */
|
||||
#define XTEN1 1
|
||||
@@ -3450,7 +3450,7 @@ static void brokenadjust()
|
||||
};
|
||||
};
|
||||
if (failed) {
|
||||
event_error("Cannot apply broken rhythm");
|
||||
event_error("Cannot apply broken rhythm. Notes not equal durations");
|
||||
} else {
|
||||
/*
|
||||
printf("Adjusting %d to %d and %d to %d\n",
|
||||
|
||||
Reference in New Issue
Block a user