mirror of
https://github.com/sshlien/abcmidi.git
synced 2026-04-19 08:13:42 +00:00
2023.12.23
This commit is contained in:
34
doc/CHANGES
34
doc/CHANGES
@@ -15151,3 +15151,37 @@ copying it to disk.
|
|||||||
midistats: Introducing a new option -nseqfor n where is a channel
|
midistats: Introducing a new option -nseqfor n where is a channel
|
||||||
number. See drums.txt for a description.
|
number. See drums.txt for a description.
|
||||||
|
|
||||||
|
|
||||||
|
December 23 2023
|
||||||
|
|
||||||
|
abc2midi: gchord bug
|
||||||
|
|
||||||
|
The following example produces some strange artefacts on starting
|
||||||
|
the midi file for some players.
|
||||||
|
|
||||||
|
X:1
|
||||||
|
T:Test
|
||||||
|
L:1/8
|
||||||
|
Q:1/2=30
|
||||||
|
M:2/2
|
||||||
|
%%MIDI gchord GHIc
|
||||||
|
K:C
|
||||||
|
GAB | "C"c4 C4 |
|
||||||
|
|
||||||
|
Explanation: the output midi file plays a note with midi pitch 0
|
||||||
|
in the accompaniment channel. The problem originates in the dogchords()
|
||||||
|
function for switch case 'G': in genmidi.c. Since g_started is 0,
|
||||||
|
the second branch of the if statement is executed, but the pitch
|
||||||
|
value in gchordnotes[gchordnotes_size] contains 0.
|
||||||
|
|
||||||
|
Fix: the switch statement should not be executed since g_started is
|
||||||
|
0 (i.e. the gchord accompaniment does not start till "C" is encountered).
|
||||||
|
The switch statement is now bypassed when either g_started
|
||||||
|
or gchords is 0. The tests for gchords and g_started in all the
|
||||||
|
case statements were removed since they are unnecessary.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.84 January 06 2023
|
abc2midi version 4.85 December 23 2023
|
||||||
abc2abc version 2.20 February 07 2023
|
abc2abc version 2.20 February 07 2023
|
||||||
yaps version 1.92 January 06 2023
|
yaps version 1.92 January 06 2023
|
||||||
abcmatch version 1.82 June 14 2022
|
abcmatch version 1.82 June 14 2022
|
||||||
|
|||||||
26
genmidi.c
26
genmidi.c
@@ -2413,30 +2413,26 @@ int j;
|
|||||||
if ((chordnum == -1) && (action == 'c')) {
|
if ((chordnum == -1) && (action == 'c')) {
|
||||||
action = 'f';
|
action = 'f';
|
||||||
};
|
};
|
||||||
if (gchords) /* [SS] 2021-06-27 */
|
if (gchords && g_started) /* [SS] 2021-06-27 2023-12-29*/
|
||||||
switch (action) {
|
switch (action) {
|
||||||
|
|
||||||
case 'z':
|
case 'z':
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
if (g_started && gchords) {
|
|
||||||
/* do fundamental */
|
/* do fundamental */
|
||||||
if (inversion == -1)
|
if (inversion == -1)
|
||||||
save_note(g_num*len, g_denom, basepitch+fun.base, 8192, fun.chan, fun.vel);
|
save_note(g_num*len, g_denom, basepitch+fun.base, 8192, fun.chan, fun.vel);
|
||||||
else
|
else
|
||||||
save_note(g_num*len, g_denom, inversion+fun.base, 8192, fun.chan, fun.vel);
|
save_note(g_num*len, g_denom, inversion+fun.base, 8192, fun.chan, fun.vel);
|
||||||
};
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'b':
|
case 'b':
|
||||||
if (g_started && gchords) {
|
|
||||||
/* do fundamental */
|
/* do fundamental */
|
||||||
if (inversion == -1) /* [SS] 2014-11-02 */
|
if (inversion == -1) /* [SS] 2014-11-02 */
|
||||||
save_note(g_num*len, g_denom, basepitch+fun.base, 8192, fun.chan, fun.vel);
|
save_note(g_num*len, g_denom, basepitch+fun.base, 8192, fun.chan, fun.vel);
|
||||||
else
|
else
|
||||||
save_note(g_num*len, g_denom, inversion+fun.base, 8192, fun.chan, fun.vel);
|
save_note(g_num*len, g_denom, inversion+fun.base, 8192, fun.chan, fun.vel);
|
||||||
}
|
|
||||||
/* break; * [SS] 2021-06-27 2021-09-15 */
|
/* break; * [SS] 2021-06-27 2021-09-15 */
|
||||||
/* There should not be a break here so the switch statement continues into the next case 'c' */
|
/* There should not be a break here so the switch statement continues into the next case 'c' */
|
||||||
|
|
||||||
@@ -2450,28 +2446,28 @@ int j;
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'g':
|
case 'g':
|
||||||
if(gchordnotes_size>0 && g_started && gchords)
|
if(gchordnotes_size>0)
|
||||||
save_note(g_num*len, g_denom, gchordnotes[0], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[0], 8192, gchord.chan, gchord.vel);
|
||||||
else /* [SS] 2016-01-03 */
|
else /* [SS] 2016-01-03 */
|
||||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
if(gchordnotes_size >1 && g_started && gchords)
|
if(gchordnotes_size >1)
|
||||||
save_note(g_num*len, g_denom, gchordnotes[1], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[1], 8192, gchord.chan, gchord.vel);
|
||||||
else /* [SS] 2016-01-03 */
|
else /* [SS] 2016-01-03 */
|
||||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'i':
|
case 'i':
|
||||||
if(gchordnotes_size >2 && g_started && gchords)
|
if(gchordnotes_size >2)
|
||||||
save_note(g_num*len, g_denom, gchordnotes[2], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[2], 8192, gchord.chan, gchord.vel);
|
||||||
else /* [SS] 2016-01-03 */
|
else /* [SS] 2016-01-03 */
|
||||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'j':
|
case 'j':
|
||||||
if(gchordnotes_size >3 && g_started && gchords)
|
if(gchordnotes_size >3)
|
||||||
save_note(g_num*len, g_denom, gchordnotes[3], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[3], 8192, gchord.chan, gchord.vel);
|
||||||
else /* [SS] 2016-01-03 */
|
else /* [SS] 2016-01-03 */
|
||||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||||
@@ -2479,34 +2475,34 @@ int j;
|
|||||||
|
|
||||||
/* [SS] 2021-12-10 */
|
/* [SS] 2021-12-10 */
|
||||||
case 'k':
|
case 'k':
|
||||||
if(gchordnotes_size >4 && g_started && gchords)
|
if(gchordnotes_size >4)
|
||||||
save_note(g_num*len, g_denom, gchordnotes[4], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[4], 8192, gchord.chan, gchord.vel);
|
||||||
else /* [SS] 2016-01-03 */
|
else /* [SS] 2016-01-03 */
|
||||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||||
|
|
||||||
case 'G':
|
case 'G':
|
||||||
if(gchordnotes_size>0 && g_started && gchords)
|
if(gchordnotes_size>0 )
|
||||||
save_note(g_num*len, g_denom, gchordnotes[0]-12, 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[0]-12, 8192, gchord.chan, gchord.vel);
|
||||||
else /* [SS] 2016-01-03 */
|
else /* [SS] 2016-01-03 */
|
||||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'H':
|
case 'H':
|
||||||
if(gchordnotes_size >1 && g_started && gchords)
|
if(gchordnotes_size >1)
|
||||||
save_note(g_num*len, g_denom, gchordnotes[1]-12, 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[1]-12, 8192, gchord.chan, gchord.vel);
|
||||||
else /* [SS] 2016-01-03 */
|
else /* [SS] 2016-01-03 */
|
||||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'I':
|
case 'I':
|
||||||
if(gchordnotes_size >2 && g_started && gchords)
|
if(gchordnotes_size >2)
|
||||||
save_note(g_num*len, g_denom, gchordnotes[2]-12, 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[2]-12, 8192, gchord.chan, gchord.vel);
|
||||||
else /* [SS] 2016-01-03 */
|
else /* [SS] 2016-01-03 */
|
||||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'J':
|
case 'J':
|
||||||
if(gchordnotes_size >3 && g_started && gchords)
|
if(gchordnotes_size >3)
|
||||||
save_note(g_num*len, g_denom, gchordnotes[3]-12, 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[3]-12, 8192, gchord.chan, gchord.vel);
|
||||||
else /* [SS] 2016-01-03 */
|
else /* [SS] 2016-01-03 */
|
||||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||||
@@ -2514,7 +2510,7 @@ int j;
|
|||||||
|
|
||||||
/* [SS] 2021-12-10 */
|
/* [SS] 2021-12-10 */
|
||||||
case 'K':
|
case 'K':
|
||||||
if(gchordnotes_size >3 && g_started && gchords)
|
if(gchordnotes_size >3)
|
||||||
save_note(g_num*len, g_denom, gchordnotes[4]-12, 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[4]-12, 8192, gchord.chan, gchord.vel);
|
||||||
else /* [SS] 2016-01-03 */
|
else /* [SS] 2016-01-03 */
|
||||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||||
|
|||||||
Reference in New Issue
Block a user