From 52f6549aa02cf8b2aacfc4b0d07b3748d75f8573 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 24 Apr 2008 23:00:25 +0000 Subject: [PATCH] - Fixed: When playing a MIDI file with EMIDI track designations to turn a track off, any ticks that had only events on the disabled track would cause the delay for that track to be thrown away, and the following notes on enabled tracks would play too soon. This could be heard quite clearly in xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing of tracks 13 and 14 (EP1 Melody and EP1 Echo). SVN r937 (trunk) --- docs/rh-log.txt | 9 ++++++++- src/sound/music_midi_midiout.cpp | 11 +++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index f95515766..360b5d7d5 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,10 +1,17 @@ +April 24, 2008 +- Fixed: When playing a MIDI file with EMIDI track designations to turn a + track off, any ticks that had only events on the disabled track would cause + the delay for that track to be thrown away, and the following notes on + enabled tracks would play too soon. This could be heard quite clearly in + xplasma.mid, where track 4 (FMGlass Drone 1) would interfere with the timing + of tracks 13 and 14 (EP1 Melody and EP1 Echo). + April 24, 2008 (Changes by Graf Zahl) - Fixed: DFlashFader did some operations in its destructor that had to be moved to its Destroy method. - Fixed: Dropped weapons from dying players should not double ammo. April 23, 2008 -(Note to self: xplasma.mid sounds really bad. Find out why.) - Fixed: When note_on() is called and another copy of the same note is already playing on the channel, it should stop it with finish_note(), not kill_note(). This can be clearly heard in the final cymbal crashes of diff --git a/src/sound/music_midi_midiout.cpp b/src/sound/music_midi_midiout.cpp index 773320876..bcadf6d28 100644 --- a/src/sound/music_midi_midiout.cpp +++ b/src/sound/music_midi_midiout.cpp @@ -549,11 +549,18 @@ DWORD *MIDISong2::SendCommand (DWORD *events, TrackInfo *track, DWORD delay) break; } } - if (event != MIDI_META && (!track->Designated || (track->Designation & DesignationMask))) + if (event != MIDI_META) { events[0] = delay; events[1] = 0; - events[2] = event | (data1<<8) | (data2<<16); + if (!track->Designated || (track->Designation & DesignationMask)) + { + events[2] = event | (data1<<8) | (data2<<16); + } + else + { + events[2] = MEVT_NOP; + } events += 3; } }