Type Alias


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


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


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:


The current tempo, in beats per minute.


The numerator of the current time signature.


The denominator of the current time signature.


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


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


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