ASPiK SDK
|
Information is delivered to your plugin in the HostInfo structure that is passed into the processAudioFrame or processAudioBuffer argumen which includes DAW session data such as the current BPM and time signature. The information is valid for the duration of the frame or buffer. A HostInfo pointer is delivered in both the ProcessFrameInfo and ProcessBufferInfo structures for the processAudioFrame and processAudioBuffer functions respectively. You may use the information included in it for any of the buffer process cycle functions as it will be guaranteed to be valid for the current buffer. Note that the amount and type of information available will depend on both the API (they vary significantly) as well as the DAW host (different hosts may support or not support various information). However, the BPM and time signature information is universally supported and required of all APIs and hosts. An example of using this information to calculate eighth note delay times synchronized to the BPM in the processAudioFrame function might look like this:
You may also wish to play with the time signature as well. The numerator and denominator are found in:
Notice that the numerator is a floating point value, so it may be fractional such as 3.5 while the denominator is an unsigned integer and will always be a whole number.