Reply 20 of 60, by Srecko
OK, I didn't realize that you send actual 0xF8 (midi clock) messages out. that can certainly create problems with dosbox if your sequencer interrupts normal midi or sysex with realtime msgs.
Here is description how realtime midi (0xF8-0xFF) should be handled: http://www.cotse.com/dlf/man/midi/realtime.htm
I partially took care of this in the input patch, but only for intelligent mode, so it won't apply to UART mode.
(also it's fun to slave dosbox's mpu401 clock to external MIDI software that sends midi clock 😎 )
But that is not hard to fix for UART mode. midi.cpp handler needs a check to detect realtime commands (>=0xF8 single-byte writes) and that's it.
Your pitch band msg problems are probably a repercussion of above. Pitch band messages aren't (to my knowledge) realtime messages,
so they shouldn't be sent in the middle of sending midi message.
Here's an attempt to correct above problem (and also help in case when realtime message corrupts the midi capture file 😁 ). So, RFC :
midi.cpp
static struct {
Bitu status;
Bitu cmd_len;
Bitu cmd_pos;
Bit8u cmd_buf[8];
+ Bit8u rt_buf[8];
struct {
Bit8u buf[SYSEX_SIZE];
Bitu used;
} sysex;
bool available;
MidiHandler * handler;
} midi;
void MIDI_RawOutByte(Bit8u data) {
+ /* Test for a realtime MIDI message */
+ if (data>=0xf8) {
+ midi.rt_buf[0]=data;
+ midi.handler->PlayMsg(midi.rt_buf);
+ return;
+ }
/* Test for a active sysex tranfer */