- gave the Timidity error functions better names and hooked up the WildMidi version.

This commit is contained in:
Christoph Oelckers 2019-09-26 17:22:54 +02:00
commit 159b98ea88
21 changed files with 506 additions and 494 deletions

View file

@ -49,7 +49,7 @@ static int set_xg_reverb_type(int msb, int lsb)
(msb >= 0x05 && msb <= 0x0F) ||
(msb >= 0x14)) /* NO EFFECT */
{
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"XG Set Reverb Type (NO EFFECT %d %d)", msb, lsb);
//printMessage(CMSG_INFO,VERB_NOISY,"XG Set Reverb Type (NO EFFECT %d %d)", msb, lsb);
return -1;
}
@ -91,7 +91,7 @@ static int set_xg_reverb_type(int msb, int lsb)
if (lsb == 0x02 && msb == 0x02)
type = 2; /* Room 3 */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"XG Set Reverb Type (%d)", type);
//printMessage(CMSG_INFO,VERB_NOISY,"XG Set Reverb Type (%d)", type);
return type;
}
@ -105,7 +105,7 @@ static int set_xg_chorus_type(int msb, int lsb)
(msb >= 0x45 && msb <= 0x47) ||
(msb >= 0x49)) /* NO EFFECT */
{
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"XG Set Chorus Type (NO EFFECT %d %d)", msb, lsb);
//printMessage(CMSG_INFO,VERB_NOISY,"XG Set Chorus Type (NO EFFECT %d %d)", msb, lsb);
return -1;
}
@ -167,7 +167,7 @@ static int set_xg_chorus_type(int msb, int lsb)
}
}
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"XG Set Chorus Type (%d)", type);
//printMessage(CMSG_INFO,VERB_NOISY,"XG Set Chorus Type (%d)", type);
return type;
}
@ -487,7 +487,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
for (ent = addlow; body <= body_end; body++, ent++) {
switch (ent) {
case 0x00: /* Element Reserve */
/* //ctl_cmsg(CMSG_INFO,VERB_NOISY,"Element Reserve is not supported. (CH:%d VAL:%d)", p, *body); */
/* //printMessage(CMSG_INFO,VERB_NOISY,"Element Reserve is not supported. (CH:%d VAL:%d)", p, *body); */
break;
case 0x01: /* bank select MSB */
@ -873,7 +873,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
break;
case 0x59: /* AC1 Controller Number */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"AC1 Controller Number is not supported. (CH:%d VAL:%d)", p, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"AC1 Controller Number is not supported. (CH:%d VAL:%d)", p, *body);
break;
case 0x5A: /* AC1 Pitch Control */
@ -907,7 +907,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
break;
case 0x60: /* AC2 Controller Number */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"AC2 Controller Number is not supported. (CH:%d VAL:%d)", p, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"AC2 Controller Number is not supported. (CH:%d VAL:%d)", p, *body);
break;
case 0x61: /* AC2 Pitch Control */
@ -949,19 +949,19 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events++;
case 0x69: /* Pitch EG Initial Level */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Pitch EG Initial Level is not supported. (CH:%d VAL:%d)", p, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"Pitch EG Initial Level is not supported. (CH:%d VAL:%d)", p, *body);
break;
case 0x6A: /* Pitch EG Attack Time */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Pitch EG Attack Time is not supported. (CH:%d VAL:%d)", p, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"Pitch EG Attack Time is not supported. (CH:%d VAL:%d)", p, *body);
break;
case 0x6B: /* Pitch EG Release Level */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Pitch EG Release Level is not supported. (CH:%d VAL:%d)", p, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"Pitch EG Release Level is not supported. (CH:%d VAL:%d)", p, *body);
break;
case 0x6C: /* Pitch EG Release Time */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Pitch EG Release Time is not supported. (CH:%d VAL:%d)", p, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"Pitch EG Release Time is not supported. (CH:%d VAL:%d)", p, *body);
break;
case 0x6D: /* Velocity Limit Low */
@ -975,11 +975,11 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
break;
case 0x70: /* Bend Pitch Low Control */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Bend Pitch Low Control is not supported. (CH:%d VAL:%d)", p, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"Bend Pitch Low Control is not supported. (CH:%d VAL:%d)", p, *body);
break;
case 0x71: /* Filter EG Depth */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Filter EG Depth is not supported. (CH:%d VAL:%d)", p, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"Filter EG Depth is not supported. (CH:%d VAL:%d)", p, *body);
break;
case 0x72: /* EQ BASS */
@ -1011,7 +1011,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
break;
default:
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Unsupported XG Bulk Dump SysEx. (ADDR:%02X %02X %02X VAL:%02X)", addhigh, addlow, ent, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"Unsupported XG Bulk Dump SysEx. (ADDR:%02X %02X %02X VAL:%02X)", addhigh, addlow, ent, *body);
continue;
break;
}
@ -1076,7 +1076,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events += 3;
break;
case 0x03: /* Alternate Group */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Alternate Group is not supported. (CH:%d NOTE:%d VAL:%d)", dp, note, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"Alternate Group is not supported. (CH:%d NOTE:%d VAL:%d)", dp, note, *body);
break;
case 0x04: /* Pan */
SETMIDIEVENT(evm[num_events], 0, ME_NRPN_MSB, dp, 0x1C, SYSEX_TAG);
@ -1103,7 +1103,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events += 3;
break;
case 0x08: /* Key Assign */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Key Assign is not supported. (CH:%d NOTE:%d VAL:%d)", dp, note, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"Key Assign is not supported. (CH:%d NOTE:%d VAL:%d)", dp, note, *body);
break;
case 0x09: /* Rcv Note Off */
SETMIDIEVENT(evm[num_events], 0, ME_SYSEX_MSB, dp, note, 0);
@ -1166,16 +1166,16 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events += 3;
break;
case 0x50: /* High Pass Filter Cutoff Frequency */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"High Pass Filter Cutoff Frequency is not supported. (CH:%d NOTE:%d VAL:%d)", dp, note, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"High Pass Filter Cutoff Frequency is not supported. (CH:%d NOTE:%d VAL:%d)", dp, note, *body);
break;
case 0x60: /* Velocity Pitch Sense */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Velocity Pitch Sense is not supported. (CH:%d NOTE:%d VAL:%d)", dp, note, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"Velocity Pitch Sense is not supported. (CH:%d NOTE:%d VAL:%d)", dp, note, *body);
break;
case 0x61: /* Velocity LPF Cutoff Sense */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Velocity LPF Cutoff Sense is not supported. (CH:%d NOTE:%d VAL:%d)", dp, note, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"Velocity LPF Cutoff Sense is not supported. (CH:%d NOTE:%d VAL:%d)", dp, note, *body);
break;
default:
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Unsupported XG Bulk Dump SysEx. (ADDR:%02X %02X %02X VAL:%02X)", addhigh, addmid, ent, *body);
//printMessage(CMSG_INFO,VERB_NOISY,"Unsupported XG Bulk Dump SysEx. (ADDR:%02X %02X %02X VAL:%02X)", addhigh, addmid, ent, *body);
break;
}
}
@ -1208,7 +1208,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
checksum += val[i];
}
if (((128 - (checksum & 0x7F)) & 0x7F) != val[gslen - 1]) {
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"GS SysEx: Checksum Error.");
//printMessage(CMSG_INFO,VERB_NOISY,"GS SysEx: Checksum Error.");
return num_events;
}
@ -1371,10 +1371,10 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events++;
break;
case 0x1F: /* CC1 Controller Number */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"CC1 Controller Number is not supported. (CH:%d VAL:%d)", p, val[7]);
//printMessage(CMSG_INFO,VERB_NOISY,"CC1 Controller Number is not supported. (CH:%d VAL:%d)", p, val[7]);
break;
case 0x20: /* CC2 Controller Number */
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"CC2 Controller Number is not supported. (CH:%d VAL:%d)", p, val[7]);
//printMessage(CMSG_INFO,VERB_NOISY,"CC2 Controller Number is not supported. (CH:%d VAL:%d)", p, val[7]);
break;
case 0x21: /* Chorus Send Level */
SETMIDIEVENT(evm[0], 0, ME_CHORUS_EFFECT, p, val[7], SYSEX_TAG);
@ -1459,7 +1459,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events += 12;
break;
default:
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
//printMessage(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
break;
}
}
@ -1733,7 +1733,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events++;
break;
default:
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
//printMessage(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
break;
}
}
@ -1850,7 +1850,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events++;
break;
default:
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
//printMessage(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
break;
}
}
@ -1873,7 +1873,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events++;
break;
default:
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
//printMessage(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
break;
}
}
@ -1997,7 +1997,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events++;
break;
default:
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
//printMessage(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
break;
}
}
@ -2020,7 +2020,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events++;
break;
default:
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
//printMessage(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
break;
}
}
@ -2073,7 +2073,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events += 3;
break;
default:
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
//printMessage(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
break;
}
break;
@ -2148,7 +2148,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
break;
#endif
default:
//ctl_cmsg(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
//printMessage(CMSG_INFO,VERB_NOISY,"Unsupported GS SysEx. (ADDR:%02X %02X %02X VAL:%02X %02X)", addr_h, addr_m, addr_l, val[7], val[8]);
break;
}
break;
@ -2165,7 +2165,7 @@ int SysexConvert::parse_sysex_event_multi(const uint8_t *val, int32_t len, MidiE
num_events++;
break;
default:
/* ctl_cmsg(CMSG_INFO,VERB_NOISY, "Unsupported GS SysEx. "
/* printMessage(CMSG_INFO,VERB_NOISY, "Unsupported GS SysEx. "
"(ADDR:%02X %02X %02X VAL:%02X %02X)",
addr_h, addr_m, addr_l, val[7], val[8]);*/
break;
@ -2639,15 +2639,15 @@ int SysexConvert::parse_sysex_event(const uint8_t *val, int32_t len, MidiEvent *
case 0x09: /* General MIDI Message */
/* GM System Enable/Disable */
if (val[3] == 1) {
ctl_cmsg(CMSG_INFO, VERB_DEBUG, "SysEx: GM System On");
printMessage(CMSG_INFO, VERB_DEBUG, "SysEx: GM System On");
SETMIDIEVENT(*ev, 0, ME_RESET, 0, GM_SYSTEM_MODE, 0);
}
else if (val[3] == 3) {
ctl_cmsg(CMSG_INFO, VERB_DEBUG, "SysEx: GM2 System On");
printMessage(CMSG_INFO, VERB_DEBUG, "SysEx: GM2 System On");
SETMIDIEVENT(*ev, 0, ME_RESET, 0, GM2_SYSTEM_MODE, 0);
}
else {
ctl_cmsg(CMSG_INFO, VERB_DEBUG, "SysEx: GM System Off");
printMessage(CMSG_INFO, VERB_DEBUG, "SysEx: GM System Off");
SETMIDIEVENT(*ev, 0, ME_RESET, 0, DEFAULT_SYSTEM_MODE, 0);
}
return 1;