Well i’d like to generate midi START/CLOCK/STOP messages based on information from the AudioPlayHead::CurrentPositionInfo struct. And i don’t know how to handle this.
First thing is the PPQ, there are two members that hold some PPQ information, but there is nothing about the PPQ resolution that can vary. In the auio plugin demo i noticed that you multiply position information by 960 is this because you assume that all DAW have this resolution of PPQ?
Also how would i go about generating the midi messages in the most accurate way, i know when to do start/stop but when do i send the midi clock, i can’t figure out how to calculate the right moment based on the ppq/samplerate/bpm information. I guess the midi tick resolution is much smaller then the DAW resolution so timing should not be an issue. But how to do this all information i have is this http://atom.maczo.pl/~atom/stuff/tech/midispec.htm but i don’t really know how to implement this.
If someone could share a piece of psuedo code with me that calcluates those midi ticks, that would help a lot.