Other Functions

The following functions are available globally.

  • Helper function to convert codes for Audio Units

    Declaration

    Swift

    public func fourCC(_ string: String) -> UInt32

    Parameters

    string

    Four character string to convert

  • Wrapper for printing out status messages to the console, eventually it could be expanded with log levels

    Declaration

    Swift

    public func AKLog(_ string: String, fname: String = #function)

    Parameters

    string

    Message to print

  • Random double in range

    Declaration

    Swift

    public func random(in range: ClosedRange<Double>) -> Double

    Parameters

    in

    Range of randomization

  • Negative logic can be confusing, so we draw special attention to those cases

    Declaration

    Swift

    prefix public func ❗️(a: Bool) -> Bool
  • Declaration

    Swift

    public func CheckError(_ error: OSStatus)

    Parameters

    error

    OSStatus flag