mirror of
https://github.com/sshlien/abcmidi.git
synced 2026-02-03 20:28:10 +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
|
||||
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
|
||||
|
||||
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
|
||||
yaps version 1.92 January 06 2023
|
||||
abcmatch version 1.82 June 14 2022
|
||||
|
||||
26
genmidi.c
26
genmidi.c
@@ -2413,30 +2413,26 @@ int j;
|
||||
if ((chordnum == -1) && (action == 'c')) {
|
||||
action = 'f';
|
||||
};
|
||||
if (gchords) /* [SS] 2021-06-27 */
|
||||
if (gchords && g_started) /* [SS] 2021-06-27 2023-12-29*/
|
||||
switch (action) {
|
||||
|
||||
case 'z':
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
if (g_started && gchords) {
|
||||
/* do fundamental */
|
||||
if (inversion == -1)
|
||||
save_note(g_num*len, g_denom, basepitch+fun.base, 8192, fun.chan, fun.vel);
|
||||
else
|
||||
save_note(g_num*len, g_denom, inversion+fun.base, 8192, fun.chan, fun.vel);
|
||||
};
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
if (g_started && gchords) {
|
||||
/* do fundamental */
|
||||
if (inversion == -1) /* [SS] 2014-11-02 */
|
||||
save_note(g_num*len, g_denom, basepitch+fun.base, 8192, fun.chan, fun.vel);
|
||||
else
|
||||
save_note(g_num*len, g_denom, inversion+fun.base, 8192, fun.chan, fun.vel);
|
||||
}
|
||||
/* 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' */
|
||||
|
||||
@@ -2450,28 +2446,28 @@ int j;
|
||||
break;
|
||||
|
||||
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);
|
||||
else /* [SS] 2016-01-03 */
|
||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||
break;
|
||||
|
||||
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);
|
||||
else /* [SS] 2016-01-03 */
|
||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||
break;
|
||||
|
||||
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);
|
||||
else /* [SS] 2016-01-03 */
|
||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||
break;
|
||||
|
||||
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);
|
||||
else /* [SS] 2016-01-03 */
|
||||
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 */
|
||||
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);
|
||||
else /* [SS] 2016-01-03 */
|
||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||
|
||||
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);
|
||||
else /* [SS] 2016-01-03 */
|
||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||
break;
|
||||
|
||||
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);
|
||||
else /* [SS] 2016-01-03 */
|
||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||
break;
|
||||
|
||||
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);
|
||||
else /* [SS] 2016-01-03 */
|
||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||
break;
|
||||
|
||||
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);
|
||||
else /* [SS] 2016-01-03 */
|
||||
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 */
|
||||
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);
|
||||
else /* [SS] 2016-01-03 */
|
||||
save_note(g_num*len, g_denom, gchordnotes[gchordnotes_size], 8192, gchord.chan, gchord.vel);
|
||||
|
||||
Reference in New Issue
Block a user