<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AudioToolbox",
  "identifier" : "/documentation/AudioToolbox/AUHostMusicalContextBlock",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Audio Toolbox"
    ],
    "preciseIdentifier" : "c:@T@AUHostMusicalContextBlock"
  },
  "title" : "AUHostMusicalContextBlock"
}
-->

# AUHostMusicalContextBlock

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

```
typealias AUHostMusicalContextBlock = (UnsafeMutablePointer<Double>?, UnsafeMutablePointer<Double>?, UnsafeMutablePointer<Int>?, UnsafeMutablePointer<Double>?, UnsafeMutablePointer<Int>?, UnsafeMutablePointer<Double>?) -> Bool
```

## Discussion

If the host app provides this block to an audio unit, via the [`musicalContextBlock`](/documentation/AudioToolbox/AUAudioUnit/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 <doc://com.apple.documentation/documentation/Swift/true> if the operation was successful and <doc://com.apple.documentation/documentation/Swift/false> 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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)