mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-16 01:02:03 +00:00
- Fixed: I missed a nuance of the MIDI spec when writing MIDIStreamer::CreateSMF(): Running status
is supposed to be canceled by sysex events and meta events. This confused FMOD when the resulting song used used running status right after these events. SVN r3803 (trunk)
This commit is contained in:
parent
ede622bb93
commit
26f9540d3c
1 changed files with 3 additions and 1 deletions
|
@ -1130,7 +1130,7 @@ void MIDIStreamer::Precache()
|
|||
void MIDIStreamer::CreateSMF(TArray<BYTE> &file, int looplimit)
|
||||
{
|
||||
DWORD delay = 0;
|
||||
BYTE running_status = 0;
|
||||
BYTE running_status = 255;
|
||||
|
||||
// Always create songs aimed at GM devices.
|
||||
CheckCaps(MOD_MIDIPORT);
|
||||
|
@ -1163,6 +1163,7 @@ void MIDIStreamer::CreateSMF(TArray<BYTE> &file, int looplimit)
|
|||
file.Push(BYTE(tempo >> 16));
|
||||
file.Push(BYTE(tempo >> 8));
|
||||
file.Push(BYTE(tempo));
|
||||
running_status = 255;
|
||||
}
|
||||
else if (MEVT_EVENTTYPE(event[2]) == MEVT_LONGMSG)
|
||||
{
|
||||
|
@ -1176,6 +1177,7 @@ void MIDIStreamer::CreateSMF(TArray<BYTE> &file, int looplimit)
|
|||
file.Push(MIDI_SYSEX);
|
||||
WriteVarLen(file, len);
|
||||
memcpy(&file[file.Reserve(len - 1)], bytes, len);
|
||||
running_status = 255;
|
||||
}
|
||||
}
|
||||
else if (MEVT_EVENTTYPE(event[2]) == 0)
|
||||
|
|
Loading…
Reference in a new issue