Type Alias

AUHostMusicalContextBlock

A block through which hosts provide musical tempo, time signature, and beat position.

Declaration

typedef BOOL (^AUHostMusicalContextBlock)(double *currentTempo, double *timeSignatureNumerator, NSInteger *timeSignatureDenominator, double *currentBeatPosition, NSInteger *sampleOffsetToNextBeat, double *currentMeasureDownbeatPosition);

Discussion

If the host app provides this block to an audio unit, via the musicalContextBlock property, then the block may be called at the beginning of each render cycle to obtain information about the current render cycle’s musical context. Any of the provided parameters may be null to indicate that the audio unit is not interested in that particular piece of information.

This block returns YES if the operation was successful and NO otherwise.

The block takes the following parameters:

currentTempo

The current tempo, in beats per minute.

timeSignatureNumerator

The numerator of the current time signature.

timeSignatureDenominator

The denominator of the current time signature.

currentBeatPosition

The precise beat position of the beginning of the current buffer being rendered.

sampleOffsetToNextBeat

The number of samples between the beginning of the buffer being rendered and the next beat. Can be 0.

currentMeasureDownbeatPosition

The beat position corresponding to the beginning of the current measure.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software