# Math

• ``` abs(_:) ```

Performs absolute value on the operation

#### Declaration

Swift

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

#### Parameters

 ``` parameter ``` AKComputedParameter to operate on
• ``` floor(_:) ```

Performs floor calculation on the operation

#### Declaration

Swift

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

#### Parameters

 ``` operation ``` AKComputedParameter to operate on
• ``` fract(_:) ```

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
• ``` log(_:) ```

Performs natural logarithm on the operation

#### Declaration

Swift

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

#### Parameters

 ``` operation ``` AKComputedParameter to operate on
• ``` log10(_:) ```

Performs Base 10 logarithm on the operation

• parmeter operation: AKComputedParameter to operate on

#### Declaration

Swift

``public func log10(_ operation: AKOperation) -> AKOperation``
• ``` round(_:) ```

Rounds the operation to the nearest integer

#### Declaration

Swift

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

#### Parameters

 ``` operation ``` AKComputedParameter to operate on
• ``` ceil(_:) ```

Upper bound of a duration, in beats

#### Declaration

Swift

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

#### Parameters

 ``` duration ``` AKDuration
• ``` +(_:_:) ```

#### 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
• ``` +=(_:_:) ```

#### 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
• ``` max(_:_:) ```

Maximum of two operations

• Parameters:
• x: 1st operation
• y: 2nd operation

#### Declaration

Swift

``public func max(_ x: AKComputedParameter, _ y: AKComputedParameter) -> AKOperation``

#### Parameters

 ``` x ``` 1st operation ``` y ``` 2nd operation
• ``` max(_:_:) ```

Maximum of an operation and a parameter

• Parameters:
• operation: operation

#### Declaration

Swift

``public func max(_ operation: AKComputedParameter, _ parameter: AKParameter) -> AKOperation``

#### Parameters

 ``` operation ``` operation ``` parameter ``` parameter
• ``` max(_:_:) ```

Maximum of an operation and a parameter

• Parameters:
• operation: operation

#### Declaration

Swift

``public func max(_ parameter: AKParameter, _ operation: AKComputedParameter) -> AKOperation``

#### Parameters

 ``` parameter ``` parameter ``` operation ``` operation
• ``` min(_:_:) ```

Minimum of two operations

• Parameters:
• x: 1st operation
• y: 2nd operation

#### Declaration

Swift

``public func min(_ x: AKComputedParameter, _ y: AKComputedParameter) -> AKOperation``

#### Parameters

 ``` x ``` 1st operation ``` y ``` 2nd operation
• ``` min(_:_:) ```

Minimum of an operation and a parameter

• Parameters:
• x: parameter
• y: operation

#### Declaration

Swift

``public func min(_ operation: AKComputedParameter, _ parameter: AKParameter) -> AKOperation``

#### Parameters

 ``` x ``` parameter ``` y ``` operation
• ``` min(_:_:) ```

Minimum of an operation and a parameter

• Parameters:
• x: parameter
• y: operation

#### Declaration

Swift

``public func min(_ parameter: AKParameter, _ operation: AKComputedParameter) -> AKOperation``

#### Parameters

 ``` x ``` parameter ``` y ``` operation
• ``` mixer(_:_:balance:) ```

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 Multiplication

• Parameters:
• left: 1st parameter
• right: 2nd parameter

#### Declaration

Swift

``public func * (left: AKParameter, right: AKParameter) -> AKOperation``

#### Parameters

 ``` left ``` 1st parameter ``` right ``` 2nd parameter
• ``` *(_:_:) ```

Helper function for Multiplication

• Parameters:
• left: stereo operation
• right: parameter

#### Declaration

Swift

``public func * (left: AKStereoOperation, right: AKParameter) -> AKStereoOperation``

#### Parameters

 ``` left ``` stereo operation ``` right ``` parameter
• ``` *(_:_:) ```

Helper function for Multiplication

• Parameters:
• left: parameter
• right: stereo operation

#### Declaration

Swift

``public func * (left: AKParameter, right: AKStereoOperation) -> AKStereoOperation``

#### Parameters

 ``` left ``` parameter ``` right ``` stereo operation
• ``` *(_:_:) ```

Multiplication

#### Declaration

Swift

``public func * (lhs: Numeric, rhs: Numeric) -> Double``
• ``` +(_:_:) ```

#### Declaration

Swift

``public func + (lhs: Numeric, rhs: Numeric) -> Double``
• ``` -(_:_:) ```

Subtraction

#### Declaration

Swift

``public func - (lhs: Numeric, rhs: Numeric) -> Double``
• ``` /(_:_:) ```

Division

#### Declaration

Swift

``public func / (lhs: Numeric, rhs: Numeric) -> Double``
• ``` +(_:_:) ```

• Parameters:
• left: 1st parameter
• right: 2nd parameter

#### Declaration

Swift

``public func + (left: AKParameter, right: AKParameter) -> AKOperation``

#### Parameters

 ``` left ``` 1st parameter ``` right ``` 2nd parameter
• ``` +(_:_:) ```

• Parameters:
• first: 1st parameter
• second: 2nd parameter

#### Declaration

Swift

``public func + (first: AKStereoOperation, second: AKStereoOperation) -> AKStereoOperation``

#### Parameters

 ``` first ``` 1st parameter ``` second ``` 2nd parameter
• ``` -(_:_:) ```

Helper function for Subtraction

• Parameters:
• left: 1st parameter
• right: 2nd parameter

#### Declaration

Swift

``public func - (left: AKParameter, right: AKParameter) -> AKOperation``

#### Parameters

 ``` left ``` 1st parameter ``` right ``` 2nd parameter
• ``` -(_:_:) ```

Helper function for subtraction

• Parameters:
• first: 1st parameter
• second: 2nd parameter

#### Declaration

Swift

``public func - (first: AKStereoOperation, second: AKStereoOperation) -> AKStereoOperation``

#### Parameters

 ``` first ``` 1st parameter ``` second ``` 2nd parameter
• ``` /(_:_:) ```

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