- silenced a few pointless console messages generated by Timidity++.

This commit is contained in:
Christoph Oelckers 2018-02-21 20:44:51 +01:00
parent af1de8ddc9
commit af705d1c59
6 changed files with 15 additions and 28 deletions

View file

@ -193,7 +193,7 @@ void TimidityPPMIDIDevice::PrecacheInstruments(const uint16_t *instrumentlist, i
void TimidityPPMIDIDevice::HandleEvent(int status, int parm1, int parm2) void TimidityPPMIDIDevice::HandleEvent(int status, int parm1, int parm2)
{ {
if (Renderer != nullptr) if (Renderer != nullptr)
Renderer->send_event(sampletime, status, parm1, parm2); Renderer->send_event(status, parm1, parm2);
} }
//========================================================================== //==========================================================================
@ -205,7 +205,7 @@ void TimidityPPMIDIDevice::HandleEvent(int status, int parm1, int parm2)
void TimidityPPMIDIDevice::HandleLongEvent(const uint8_t *data, int len) void TimidityPPMIDIDevice::HandleLongEvent(const uint8_t *data, int len)
{ {
if (Renderer != nullptr) if (Renderer != nullptr)
Renderer->send_long_event(sampletime, data, len); Renderer->send_long_event(data, len);
} }
//========================================================================== //==========================================================================
@ -218,7 +218,6 @@ void TimidityPPMIDIDevice::ComputeOutput(float *buffer, int len)
{ {
if (Renderer != nullptr) if (Renderer != nullptr)
Renderer->compute_data(buffer, len); Renderer->compute_data(buffer, len);
sampletime += len;
} }
//========================================================================== //==========================================================================

View file

@ -639,9 +639,9 @@ Instrument *Instruments::load_gus_instrument(char *name, ToneBank *bank, int dr,
} }
} }
} }
if (noluck) { if (noluck)
ctl_cmsg(CMSG_ERROR, VERB_NORMAL, {
"Instrument `%s' can't be found.", name); ctl_cmsg(CMSG_ERROR, VERB_DEBUG, "Instrument `%s' can't be found.", name);
return 0; return 0;
} }
/* Read some headers and do cursory sanity checks. There are loads /* Read some headers and do cursory sanity checks. There are loads

View file

@ -1312,9 +1312,7 @@ int Player::find_samples(MidiEvent *e, int *vlist)
ch = e->channel; ch = e->channel;
if (channel[ch].special_sample > 0) { if (channel[ch].special_sample > 0) {
if ((s = instruments->specialPatch(channel[ch].special_sample)) == NULL) { if ((s = instruments->specialPatch(channel[ch].special_sample)) == NULL) {
ctl_cmsg(CMSG_WARNING, VERB_VERBOSE, ctl_cmsg(CMSG_WARNING, VERB_VERBOSE,"Strange: Special patch %d is not installed",channel[ch].special_sample);
"Strange: Special patch %d is not installed",
channel[ch].special_sample);
return 0; return 0;
} }
note = e->a + channel[ch].key_shift + note_key_offset; note = e->a + channel[ch].key_shift + note_key_offset;
@ -1327,10 +1325,7 @@ int Player::find_samples(MidiEvent *e, int *vlist)
instruments->instrument_map(channel[ch].mapID, &bank, &note); instruments->instrument_map(channel[ch].mapID, &bank, &note);
if (! (ip = play_midi_load_instrument(1, bank, note))) if (! (ip = play_midi_load_instrument(1, bank, note)))
return 0; /* No instrument? Then we can't play. */ return 0; /* No instrument? Then we can't play. */
/* if (ip->type == INST_GUS && ip->samples != 1)
ctl_cmsg(CMSG_WARNING, VERB_VERBOSE,
"Strange: percussion instrument with %d samples!",
ip->samples); */
/* "keynum" of SF2, and patch option "note=" */ /* "keynum" of SF2, and patch option "note=" */
if (ip->sample->note_to_use) if (ip->sample->note_to_use)
note = ip->sample->note_to_use; note = ip->sample->note_to_use;
@ -5022,6 +5017,7 @@ int Player::compute_data(float *buffer, int32_t count)
if (count == 0) return RC_OK; if (count == 0) return RC_OK;
buffer_pointer = common_buffer; buffer_pointer = common_buffer;
computed_samples += count;
while (count > 0) while (count > 0)
{ {
@ -5517,7 +5513,7 @@ int Player::play_event(MidiEvent *ev)
break; break;
case ME_SCALE_TUNING: case ME_SCALE_TUNING:
recache->resamp_cache_refer_alloff(ch, current_event->time); recache->resamp_cache_refer_alloff(ch, computed_samples);
channel[ch].scale_tuning[current_event->a] = current_event->b; channel[ch].scale_tuning[current_event->a] = current_event->b;
adjust_pitch(ch); adjust_pitch(ch);
break; break;
@ -6078,11 +6074,10 @@ int Player::convert_midi_control_change(int chn, int type, int val, MidiEvent *e
} }
int Player::send_event(int sampletime, int status, int parm1, int parm2) int Player::send_event(int status, int parm1, int parm2)
{ {
MidiEvent ev; MidiEvent ev;
ev.time = sampletime;
ev.type = ME_NONE; ev.type = ME_NONE;
ev.channel = status & 0x0000000f; ev.channel = status & 0x0000000f;
//ev.channel = ev.channel + port * 16; //ev.channel = ev.channel + port * 16;
@ -6130,7 +6125,7 @@ int Player::send_event(int sampletime, int status, int parm1, int parm2)
return 0; return 0;
} }
void Player::send_long_event(int sampletime, const uint8_t *sysexbuffer, int exlen) void Player::send_long_event(const uint8_t *sysexbuffer, int exlen)
{ {
int i, ne; int i, ne;
MidiEvent ev; MidiEvent ev;

View file

@ -31,7 +31,6 @@ struct AlternateAssign;
struct MidiEvent struct MidiEvent
{ {
int32_t time;
uint8_t type, channel, a, b; uint8_t type, channel, a, b;
}; };
@ -539,6 +538,7 @@ private:
int32_t sample_count; /* Length of event_list */ int32_t sample_count; /* Length of event_list */
int32_t current_sample; /* Number of calclated samples */ int32_t current_sample; /* Number of calclated samples */
double midi_time_ratio; /* For speed up/down */ double midi_time_ratio; /* For speed up/down */
int computed_samples;
int note_key_offset = 0; /* For key up/down */ int note_key_offset = 0; /* For key up/down */
ChannelBitMask channel_mute; /* For channel mute */ ChannelBitMask channel_mute; /* For channel mute */
@ -585,11 +585,6 @@ private:
return (ISDRUMCHANNEL((ep)->channel) ? (ep)->a : (((int)(ep)->a + note_key_offset + channel[ep->channel].key_shift) & 0x7f)); return (ISDRUMCHANNEL((ep)->channel) ? (ep)->a : (((int)(ep)->a + note_key_offset + channel[ep->channel].key_shift) & 0x7f));
} }
int32_t MIDI_EVENT_TIME(MidiEvent *ep)
{
return ((int32_t)((ep)->time * midi_time_ratio + 0.5));
}
int16_t conv_lfo_pitch_depth(float val) int16_t conv_lfo_pitch_depth(float val)
{ {
return (int16_t)(0.0318f * val * val + 0.6858f * val + 0.5f); return (int16_t)(0.0318f * val * val + 0.6858f * val + 0.5f);
@ -733,8 +728,8 @@ public:
int get_default_mapID(int ch); int get_default_mapID(int ch);
void init_channel_layer(int ch); void init_channel_layer(int ch);
int compute_data(float *buffer, int32_t count); int compute_data(float *buffer, int32_t count);
int send_event(int time, int status, int parm1, int parm2); int send_event(int status, int parm1, int parm2);
void send_long_event(int sampletime, const uint8_t *sysexbuffer, int exlen); void send_long_event(const uint8_t *sysexbuffer, int exlen);
}; };
class SysexConvert class SysexConvert

View file

@ -31,9 +31,8 @@ namespace TimidityPlus
{ {
inline void SETMIDIEVENT(MidiEvent &e, int32_t at, uint32_t t, uint32_t ch, uint32_t pa, uint32_t pb) inline void SETMIDIEVENT(MidiEvent &e, int32_t /*time, not needed anymore*/, uint32_t t, uint32_t ch, uint32_t pa, uint32_t pb)
{ {
(e).time = (at);
(e).type = (t); (e).type = (t);
(e).channel = (uint8_t)(ch); (e).channel = (uint8_t)(ch);
(e).a = (uint8_t)(pa); (e).a = (uint8_t)(pa);

View file

@ -206,7 +206,6 @@ void Recache::resamp_cache_create(void)
cache_hash_table[i] = q; cache_hash_table[i] = q;
} }
if (n == 0) { if (n == 0) {
ctl_cmsg(CMSG_INFO, VERB_VERBOSE, "No pre-resampling cache hit");
return; return;
} }
array = (struct cache_hash **) new_segment(&hash_entry_pool, array = (struct cache_hash **) new_segment(&hash_entry_pool,