CoreMIDI question
CoreMIDI question
- Subject: CoreMIDI question
- From: robert <email@hidden>
- Date: Sun, 28 Apr 2002 09:05:12 +0200
- Mail-followup-to: email@hidden
L.S.
I'm toying with the idea of a small application consisting of a BPM counter
which drives a virtual MIDI source sending MIDI Clock messages (the 0xF8
message in the MIDI protocol).
Because of the way MIDI Clock works (a MIDI device synchronizes to this
signal by knowing that 24 MIDI Clock messages per quarter note are sent),
I'm starting to wonder if I can reliably do this with simple code.
For instance, at 120BPM, my program has to send a message every 20833
microseconds ((60 * 1000000) / (24 * 120)). There are a few crude methods I
can think of to get this working:
- using select() to count 20833 5s before sending a new message (with which
I have to take into account functioncall overhead and such);
- using setitimer and a signalhandler (*yuck*)
However, the docs on MIDIPacketListAdd() tell me that this function can be
given a timestamp at (as far as I can understand) which an every (sending a
MIDI message) has to occur. The docs are not very clear about this, though.
My questions:
- can I use this timestamp to more accurately send MIDI messages?
- if so, how? :)
robert
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.