AKTable

public struct AKTable: MutableCollection

A table of values accessible as a waveform or lookup mechanism

  • Undocumented

    Declaration

    Swift

    public struct AKTable: MutableCollection
  • Declaration

    Swift

    public var startIndex: Index
  • Declaration

    Swift

    public var endIndex: Index
  • Declaration

    Swift

    public var count: IndexDistance
  • Initialize and set up the default table

    • Parameters:
      • tableType: AKTableType of teh new table
      • size: Size of the table (multiple of 2)

    Declaration

    Swift

    public init(_ type: AKTableType = .sine,
                    phase: Float = 0,
                    count: IndexDistance = 4096)

    Parameters

    tableType

    AKTableType of teh new table

    size

    Size of the table (multiple of 2)

  • Undocumented

    Declaration

    Swift

    public struct AKTable: MutableCollection
  • Instantiate the table as a sine wave

    Declaration

    Swift

    public func index(before i: Index) -> Index

    Parameters

    i

    A valid index of the collection. i must be greater than startIndex.

    Return Value

    The index value immediately before i.

  • Instantiate the table as a sine wave

    Declaration

    Swift

    public func index(after i: Index) -> Index

    Parameters

    i

    A valid index of the collection. i must be less than endIndex.

    Return Value

    The index value immediately after i.

  • Instantiate the table as a sine wave

    Declaration

    Swift

    public func index(_ i: Index, offsetBy n: IndexDistance) -> Index

    Parameters

    i

    A valid index of the collection.

    n

    The distance to offset i. n must not be negative unless the collection conforms to the BidirectionalCollection protocol.

    Return Value

    An index offset by n from the index i. If n is positive, this is the same value as the result of n calls to index(after:). If n is negative, this is the same value as the result of -n calls to index(before:).

  • Instantiate the table as a sine wave

    Declaration

    Swift

    public func formIndex(after i: inout Index)

    Parameters

    i

    A valid index of the collection. i must be less than endIndex.

  • Instantiate the table as a sine wave

    Declaration

    Swift

    public func distance(from start: Index, to end: Index) -> IndexDistance

    Parameters

    start

    A valid index of the collection.

    end

    Another valid index of the collection. If end is equal to start, the result is zero.

    Return Value

    The distance between start and end. The result can be negative only if the collection conforms to the BidirectionalCollection protocol.