Is it possible to use midiOutLongMsg to play a chord? (Win32 API)
This guys says yes: http://web.tiscalinet.it/giordy/midi-tech/lowmidi.htm Same with a really old book from 1998 (Maximum MIDI). MSDN doesn't mention it. I'm not getting any sound.
- I fill a char buffer with status|note|velocity|status|note|velocity...
- Set lpData, dwBufferLength, and dwFlags of a MIDIHDR struct
- call midiOutPrepareHeader (MMSYSERR_NOERROR)
- call midiOutLongMsg (MMSYSERR_NOERROR)
Still no sound! Spamming midiOutShortMsg is working but will that work for slower machines? Did they change the functionality?
Thanks.
I'm an idiot! I figured it out: Microsoft GS Wavetable Synth does NOT support sending multiple short messages in midiOutLongMsg. The MIDI Mapper DOES!
midiOutShortMsg should be plenty fast, even on slow machines. MIDI interfaces themselves (hardware that is, but some software will limit themselves) run at 31,250 baud. This of course is ignoring any slow code you may have wrapped around where you call midiOutShortMsg.
Anyway, technically you should also be able to get away with one status byte, if the following notes use the same status byte. So, if you want to do note on/off (using velocity 0 for off) and those notes are on the same channel, you could do this:
status|note|velocity|note|velocity|note|velocity|note|velocity
This is called running status.
精彩评论