Math

  • Performs absolute value on the operation

    Declaration

    Swift

    public func abs(_ parameter: AKOperation) -> AKOperation

    Parameters

    parameter

    AKComputedParameter to operate on

  • Performs floor calculation on the operation

    Declaration

    Swift

    public func floor(_ operation: AKOperation) -> AKOperation

    Parameters

    operation

    AKComputedParameter to operate on

  • Returns the fractional part of the operation (as opposed to the integer part)

    Declaration

    Swift

    public func fract(_ operation: AKOperation) -> AKOperation

    Parameters

    operation

    AKComputedParameter to operate on

  • Performs natural logarithm on the operation

    Declaration

    Swift

    public func log(_ operation: AKOperation) -> AKOperation

    Parameters

    operation

    AKComputedParameter to operate on

  • Performs Base 10 logarithm on the operation

    • parmeter operation: AKComputedParameter to operate on

    Declaration

    Swift

    public func log10(_ operation: AKOperation) -> AKOperation
  • Rounds the operation to the nearest integer

    Declaration

    Swift

    public func round(_ operation: AKOperation) -> AKOperation

    Parameters

    operation

    AKComputedParameter to operate on

  • Upper bound of a duration, in beats

    Declaration

    Swift

    public func ceil(_ duration: AKDuration) -> AKDuration

    Parameters

    duration

    AKDuration

  • Adding durations

    Declaration

    Swift

    public func +(lhs: AKDuration, rhs: AKDuration) -> AKDuration

    Parameters

    lhs

    One duration

    rhs

    Another duration

  • Subtracting durations

    Declaration

    Swift

    public func -(lhs: AKDuration, rhs: AKDuration) -> AKDuration

    Parameters

    lhs

    One duration

    rhs

    Another duration

  • Duration equality

    Declaration

    Swift

    public func ==(lhs: AKDuration, rhs: AKDuration) -> Bool

    Parameters

    lhs

    One duration

    rhs

    Another duration

  • Duration inequality

    Declaration

    Swift

    public func !=(lhs: AKDuration, rhs: AKDuration) -> Bool

    Parameters

    lhs

    One duration

    rhs

    Another duration

  • Duration less than

    Declaration

    Swift

    public func <(lhs: AKDuration, rhs: AKDuration) -> Bool

    Parameters

    lhs

    One duration

    rhs

    Another duration

  • Duration less than or equal to

    Declaration

    Swift

    public func <=(lhs: AKDuration, rhs: AKDuration) -> Bool

    Parameters

    lhs

    One duration

    rhs

    Another duration

  • Duration greater than

    Declaration

    Swift

    public func >(lhs: AKDuration, rhs: AKDuration) -> Bool

    Parameters

    lhs

    One duration

    rhs

    Another duration

  • Duration greater than or equal to

    Declaration

    Swift

    public func >=(lhs: AKDuration, rhs: AKDuration) -> Bool

    Parameters

    lhs

    One duration

    rhs

    Another duration

  • Modulus of the duration’s beats

    Declaration

    Swift

    public func %(lhs: AKDuration, rhs: AKDuration) -> AKDuration

    Parameters

    lhs

    One duration

    rhs

    Another duration

  • Add to a duration

    Declaration

    Swift

    public func +=( lhs: inout AKDuration, rhs: AKDuration)

    Parameters

    lhs

    Starting duration

    rhs

    Amount to add

  • Subtract from a duration

    Declaration

    Swift

    public func -=( lhs: inout AKDuration, rhs: AKDuration)

    Parameters

    lhs

    Starting duration

    rhs

    Amount to subtract

  • Mix together two parameters

    • Parameters:
      • first: First parameter
      • second: Second parameter
      • balance: Value from zero to one indicating balance between first (0) and second (1) (Default: 0.5)

    Declaration

    Swift

    public func mixer(_ first: AKParameter, _ second: AKParameter, balance: AKParameter = 0.5) -> AKOperation

    Parameters

    first

    First parameter

    second

    Second parameter

    balance

    Value from zero to one indicating balance between first (0) and second (1) (Default: 0.5)

  • Helper function for Division

    • Parameters:
      • numerator: Mono parameter
      • denominator: The amount to divide

    Declaration

    Swift

    public func /(numerator: AKParameter, denominator: AKParameter) -> AKOperation

    Parameters

    numerator

    Mono parameter

    denominator

    The amount to divide

  • Helper function for Division

    • Parameters:
      • numerator: Stereo operation
      • denominator: The amount to divide

    Declaration

    Swift

    public func /(numerator: AKStereoOperation, denominator: AKParameter) -> AKStereoOperation

    Parameters

    numerator

    Stereo operation

    denominator

    The amount to divide