Win32 Midi API's - timing on midiOutLongMsg

Win32 Midi API's - timing on midiOutLongMsg

Post by Bernard S. Greenber » Sat, 28 Sep 1996 04:00:00



Programming MIDI API in WinNT 3.51, Service Pack 4 -  anyone here know
about it?

I have tried without any success to prepare a buffer of Midi events for
midiOutLongMsg, to simply send three notes at three separate times.  It
does seem
that no matter what values I put in dwDeltaTime, they all play
simultaneously.
Attempts to use MEVT_TEMPO events to set the tempo seem to be ignored.

Note that I am -not- using midiStreamxxxxyyy API's, as when I try to
open a midiStream
I'm told my driver doesn't support it.  Are midiOutLongMsg buffers with
timings
supposed to work if your driver doesn't support midiStream, and is this
collapsing
of the times Lassie's way of trying to tell us something, or am I
ignoring
something critical?  There seems to be no way in the non-midiStream API
to set the meanings of time divisions, SMPTE or ticks/quarter note, but
even
putting numbers in thousands or multimillions in the time-deltas (which
should
do -something- in -any- case) seems to have no effect at all.

I've made my music play adequately by jacking up the process priority to
realtime
(it just does Sleep's between midi events, so this seems like an ideal
use - it
is a conapp which exits when the music is finished), but I'd much rather
use this buffered stuff.  Has anyone here any experience with it?

Please respond by email, as I no longer read these groups frequently. I
would
appreciate it a great deal.  The MS documentation "leaves a lot to be
desired", btw...

Thanks,
Bernard S. Greenberg

 
 
 

Win32 Midi API's - timing on midiOutLongMsg

Post by Matt Arno » Sun, 29 Sep 1996 04:00:00



Quote:>Programming MIDI API in WinNT 3.51, Service Pack 4 -  anyone here know
>about it?
>I have tried without any success to prepare a buffer of Midi events for
>midiOutLongMsg, to simply send three notes at three separate times.  It
>does seem
>that no matter what values I put in dwDeltaTime, they all play
>simultaneously.
>Attempts to use MEVT_TEMPO events to set the tempo seem to be ignored.
>Note that I am -not- using midiStreamxxxxyyy API's, as when I try to
>open a midiStream
>I'm told my driver doesn't support it.  Are midiOutLongMsg buffers with
>timings
>supposed to work if your driver doesn't support midiStream

No.  You can ONLY send raw MIDI data with them and it all goes out
immediately.  In the absence of streaming support, midiOutLongMsg() is
primarily useful for sending SysEx.  Regular timed MIDI should be sent
using timeSetEvent() and calls to midiOutShortMsg().  This is how it
was done before the streaming APIs (which are new).

I'm interested to know how you're determining that you don't have
streaming support.  midiOpenStream() does not have a (documented)
error return code for this.

, and is this

Quote:>collapsing
>of the times Lassie's way of trying to tell us something, or am I
>ignoring
>something critical?  There seems to be no way in the non-midiStream API
>to set the meanings of time divisions, SMPTE or ticks/quarter note, but
>even
>putting numbers in thousands or multimillions in the time-deltas (which
>should
>do -something- in -any- case) seems to have no effect at all.

You can't do any of this automatic timing stuff if streaming is not
supported.  In this situation, the only stuff you can put in the
buffers is raw MIDI data.   The time deltas, SMPTE ticks, etc. are
*not* MIDI data---that's is all extra stuff understood only by the
streaming support.

So, you are probably sending garbage bytes (except for you note events)
to your MIDI devices.  A driver that does not support streaming assumes
that ALL data you put in a buffer sent with midiOutLongMsg() is valid
MIDI data and it ALL gets sent out.  This is almost certinaly not what
you intended.

Regards,
-------------------------------------------------------------------------
Matt Arnold                       |        | ||| | |||| |  | | || ||

Boston, MA                        |      0 | ||| | |||| |  | | || ||
617.389.7384 (h) 617.576.2760 (w) |        | ||| | |||| |  | | || ||
C++, MIDI, Win32/95 developer     |        | ||| 4 3 1   0 8 3 || ||
-------------------------------------------------------------------------

 
 
 

1. Win32 Mixer API under win32s

Can anyone tell me if it's possible to write a Win32 application which uses
the Mixer API, eg mixerGetLineInfo(), mixerGetControlDetails(), and to run it
on under Windows 3.1 with win32s installed. The target machine has a
Soundblaster 16 compatible sound card.

I guess it depends on the device drivers supporting the calls that the
mmsystem library makes in response to these APIs.

Thanks,

Dave Myers.

2. installing sound card

3. Difference between WCE API and Win32 API

4. Can't install IE 6.0 SP1

5. WIN32 API calls to play audio CD's ?

6. 2 Questions about ToolBars

7. need api reference(MS Win32 Developer's Reference)

8. NetBIOS names

9. Problem: FTP.EXE can PUT file but Win32 API FtpPutFile won't

10. How do I write to the bindery with WIN32 API's

11. time api's: differences?

12. New MIDI WWW Site - Betty's Midi Mania