diff --git a/src/sound/mididevices/music_timiditypp_mididevice.cpp b/src/sound/mididevices/music_timiditypp_mididevice.cpp index 6d775e2dd..dd288c71b 100644 --- a/src/sound/mididevices/music_timiditypp_mididevice.cpp +++ b/src/sound/mididevices/music_timiditypp_mididevice.cpp @@ -243,6 +243,7 @@ MIDIDevice *CreateTimidityPPMIDIDevice(const char *args) void TimidityPP_Shutdown() { TimidityPPMIDIDevice::ClearInstruments(); + TimidityPlus::free_gauss_table(); TimidityPlus::free_global_mblock(); } diff --git a/src/sound/timiditypp/common.cpp b/src/sound/timiditypp/common.cpp index 90bd184ef..dc51ae98e 100644 --- a/src/sound/timiditypp/common.cpp +++ b/src/sound/timiditypp/common.cpp @@ -281,6 +281,7 @@ void close_file(struct timidity_file *tf) if (tf->url != NULL) { tf->url->Close(); + delete tf->url; } delete tf; } diff --git a/src/sound/timiditypp/instrum.cpp b/src/sound/timiditypp/instrum.cpp index 45072bb99..5d47a460d 100644 --- a/src/sound/timiditypp/instrum.cpp +++ b/src/sound/timiditypp/instrum.cpp @@ -641,7 +641,7 @@ Instrument *Instruments::load_gus_instrument(char *name, ToneBank *bank, int dr, } if (noluck) { - ctl_cmsg(CMSG_ERROR, VERB_DEBUG, "Instrument `%s' can't be found.", name); + ctl_cmsg(CMSG_INFO, VERB_DEBUG, "Instrument `%s' can't be found.", name); return 0; } /* Read some headers and do cursory sanity checks. There are loads @@ -1099,8 +1099,8 @@ int Instruments::fill_bank(int dr, int b, int *rc) bank->tone[i].instrument = load_instrument(dr, b, i); if (bank->tone[i].instrument == NULL) { - ctl_cmsg(CMSG_WARNING, - (b != 0) ? VERB_VERBOSE : VERB_NORMAL, + // This would be too annoying on 'warning' level. + ctl_cmsg(CMSG_WARNING, VERB_DEBUG, "No instrument mapped to %s %d, program %d%s", dr ? "drum set" : "tone bank", dr ? b + progbase : b, diff --git a/src/sound/timiditypp/playmidi.cpp b/src/sound/timiditypp/playmidi.cpp index db8972059..c50e7ed97 100644 --- a/src/sound/timiditypp/playmidi.cpp +++ b/src/sound/timiditypp/playmidi.cpp @@ -1312,7 +1312,6 @@ int Player::find_samples(MidiEvent *e, int *vlist) ch = e->channel; if (channel[ch].special_sample > 0) { if ((s = instruments->specialPatch(channel[ch].special_sample)) == NULL) { - ctl_cmsg(CMSG_WARNING, VERB_VERBOSE,"Strange: Special patch %d is not installed",channel[ch].special_sample); return 0; } note = e->a + channel[ch].key_shift + note_key_offset; diff --git a/src/sound/timiditypp/playmidi.h b/src/sound/timiditypp/playmidi.h index 9c400cfb6..75bd350d6 100644 --- a/src/sound/timiditypp/playmidi.h +++ b/src/sound/timiditypp/playmidi.h @@ -743,6 +743,8 @@ public: int parse_sysex_event(const uint8_t *val, int32_t len, MidiEvent *ev, Instruments *instruments); }; +void free_gauss_table(void); + } diff --git a/src/sound/timiditypp/sffile.cpp b/src/sound/timiditypp/sffile.cpp index f8d739e00..da02477e7 100644 --- a/src/sound/timiditypp/sffile.cpp +++ b/src/sound/timiditypp/sffile.cpp @@ -177,9 +177,7 @@ int Instruments::load_soundfont(SFInfo *sf, struct timidity_file *fd) break; } else { - ctl_cmsg(CMSG_WARNING, VERB_NORMAL, - "%s: *** illegal id in level 0: %4.4s %4d", - fd->filename.c_str(), chunk.id, chunk.size); + ctl_cmsg(CMSG_WARNING, VERB_NORMAL, "%s: *** illegal id in level 0: %4.4s %4d", fd->filename.c_str(), chunk.id, chunk.size); FSKIP(chunk.size, fd); } } @@ -290,9 +288,7 @@ int Instruments::process_list(int size, SFInfo *sf, struct timidity_file *fd) case PDTA_ID: return process_pdta(size, sf, fd); default: - ctl_cmsg(CMSG_WARNING, VERB_NORMAL, - "%s: *** illegal id in level 1: %4.4s", - fd->filename.c_str(), chunk.id); + ctl_cmsg(CMSG_WARNING, VERB_NORMAL, "%s: *** illegal id in level 1: %4.4s", fd->filename.c_str(), chunk.id); FSKIP(size, fd); /* skip it */ return 0; } @@ -441,9 +437,7 @@ void Instruments::load_sample_names(int size, SFInfo *sf, struct timidity_file * { int i, nsamples; if (sf->version > 1) { - ctl_cmsg(CMSG_WARNING, VERB_NORMAL, - "%s: *** version 2 has obsolete format??", - fd->filename.c_str()); + ctl_cmsg(CMSG_WARNING, VERB_NORMAL, "%s: *** version 2 has obsolete format??",fd->filename.c_str()); FSKIP(size, fd); return; } @@ -455,9 +449,7 @@ void Instruments::load_sample_names(int size, SFInfo *sf, struct timidity_file * sf->sample = NEW(SFSampleInfo, sf->nsamples); } else if (sf->nsamples != nsamples) { - ctl_cmsg(CMSG_WARNING, VERB_NORMAL, - "%s: *** different # of samples ?? (%d : %d)\n", - fd->filename.c_str(), sf->nsamples, nsamples); + ctl_cmsg(CMSG_WARNING, VERB_NORMAL, "%s: *** different # of samples ?? (%d : %d)\n",fd->filename.c_str(), sf->nsamples, nsamples); FSKIP(size, fd); return; } @@ -624,8 +616,7 @@ void Instruments::convert_layers(SFInfo *sf) if (prbags.bag == NULL || prbags.gen == NULL || inbags.bag == NULL || inbags.gen == NULL) { - ctl_cmsg(CMSG_WARNING, VERB_NORMAL, - "%s: *** illegal bags / gens", sf->sf_name); + ctl_cmsg(CMSG_WARNING, VERB_NORMAL, "%s: *** illegal bags / gens", sf->sf_name); return; } @@ -653,9 +644,7 @@ void Instruments::generate_layers(SFHeader *hdr, SFHeader *next, SFBags *bags) hdr->nlayers = next->bagNdx - hdr->bagNdx; if (hdr->nlayers < 0) { - ctl_cmsg(CMSG_WARNING, VERB_NORMAL, - "%s: illegal layer numbers %d", - "", hdr->nlayers); + ctl_cmsg(CMSG_WARNING, VERB_NORMAL, "%s: illegal layer numbers %d", "", hdr->nlayers); return; } if (hdr->nlayers == 0) @@ -666,9 +655,7 @@ void Instruments::generate_layers(SFHeader *hdr, SFHeader *next, SFBags *bags) int genNdx = bags->bag[i]; layp->nlists = bags->bag[i + 1] - genNdx; if (layp->nlists < 0) { - ctl_cmsg(CMSG_WARNING, VERB_NORMAL, - "%s: illegal list numbers %d", - "", layp->nlists); + ctl_cmsg(CMSG_WARNING, VERB_NORMAL, "%s: illegal list numbers %d", "", layp->nlists); return; } layp->list = (SFGenRec*)safe_malloc(sizeof(SFGenRec) * layp->nlists);