Re: Karl, I need to understand your Timer!



On Mon, 15 Jun 2009 14:01:19 +0100, "Alfie [UK]" <alfie@xxxxxxxxxxxx>
wrote:

On Sun, 14 Jun 2009 14:10:09 +0200, "Schmidt" <sss@xxxxxxxxx> wrote:

Maybe give the MMTimer-approach (-controls) a try - and
see, how the "win-message-concurrency" works out,
compared with the entirely non-satisfying DoEvents-
"workaround" you currently have.

An MMTimer is probably the best idea, as it runs in it's own thread,
and as far as I know isn't blocked by other messages like a system
timer.

As Steve McMahon mentions
http://www.vbaccelerator.com/home/vb/code/Libraries/HiResTimer/article.asp
it is better to encapsulate the MMTimer in it's own AX DLL to avoid
issues when working within the IDE.

I am at last making progress! Using a multimedia timer I have just
successfully "played" a sequence of MIDI events that kept on playing
(on Windows 98SE nota bene!) even while I moved the form. I even added
a flexgrid to the form and in Form_Load filled it with 1000 rows of
dummy data so that I could stress the CPU by scrolling up and down
while the MIDI output is in progress. Again, NO interruption!

This is still early days, because I have to work out timing based on a
tick generator (the multimedia timer) rather than Sleep(ing) for a
precise period. Basically, as far as I can make out from Paul
Messick's Maximum MIDI (written in C/C++), the tick generator
generates ticks and at each one you increment a tick counter and
compare it with the delta time of the next MIDI event pending in the
queue. If the tick counter meets or exceeds the DT, then
midiOutShortMsg for that event and reset the counter. I'll give that a
go next.

MM
.



Relevant Pages

  • Re: time delay
    ... Another serious problem here is that in general, you cannot reliably compare ... One should compare difference between starting tick count and current tick ... > the problem to see if polling can be avoided. ... > asynchronous notification, see my essay on asynchronous process ...
    (microsoft.public.vc.mfc)
  • Re: time delay
    ... I think the ms timer overflows about every 48 days, ... >Another serious problem here is that in general, you cannot reliably compare ... >tick count with the expected value. ... >> notification on my MVP ...
    (microsoft.public.vc.mfc)
  • Re: What am I missing here?
    ... but according to their "compare" list, ... physical dimensions - electronically they appear to be the same. ... I can't give you a direct link because it won't allow it but, ... and tick the two models it shows differences - mainly in the sound system but also the 85 variant has a top-up-tv card slot. ...
    (uk.tech.digital-tv)
  • Re: DispatchMessage: What is message # 0xC0FE ?
    ... compare two of those values, ... Tick count absolute value is NOT safe to compare. ...
    (microsoft.public.vc.mfc)

Loading