First post, by realnc
- Rank
- Oldbie
Hello, and thanks (again!) for this project. It's been a while since I posted here. Been using Munt for a long time now to play some classic DOS games. By now I can't tell the difference anymore to the actual hardware. 😀
I decided to use the mt32emu library in one of my own projects. But I can't figure out what I'm supposed to send to the Synth object. I have created a MidiStreamParser subclass, and the virtuals are getting called correctly (handleShortMessage(), handleSysex(), etc.) when I call MidiStreamParserImpl::parseStream() on a buffer that contains the data of a *.mid file (that otherwise plays fine in the mt32emu GUI player.)
But... what do I do with those? When handleShortMessage() or handleSysex() are called, I forward the data to Synth::playMsg(message) and Synth::playSysex(). Basically:
void MidiStreamParserSub::handleShortMessage(const Bit32u message)
{
synth->playMsg(message);
}
void MyMidiStreamParserSub::handleSysex(const Bit8u stream[], const Bit32u length)
{
synth->playSysex(stream, length);
}
But what do I do with the data that is sent to handleSystemRealtimeMessage()? Currently I just ignore them and only silence comes out of the renderer. Nothing but 0.f samples:
float* buf = new float[len * 2];
synth->flushMIDIQueue();
synth->render(buf, len);
'buf' just contains 'len' samples of silence 😵
How do I feed Synth properly?