AKOperationGenerator

open class AKOperationGenerator: AKNode, AKToggleable, AKComponent

Operation-based generator

  • Four letter unique description of the node

    Declaration

    Swift

    public static let ComponentDescription = AudioComponentDescription(generator: "cstg")
  • Tells whether the node is processing (ie. started, playing, or active)

    Declaration

    Swift

    open dynamic var isStarted: Bool
  • Sporth language snippet

    Declaration

    Swift

    open dynamic var sporth: String = ""
  • Parameters for changing internal operations

    Declaration

    Swift

    open dynamic var parameters: [Double]
  • Initialize with a mono or stereo operation

    Declaration

    Swift

    public convenience init(operation: ([AKOperation]) -> AKComputedParameter)

    Parameters

    operation

    Operation to generate, can be mono or stereo

  • Initialize the generator for stereo (2 channels)

    • Parameters:
      • numberOfChannels: Only 2 channels are supported, but need to differentiate the initializer
      • operations: Array of operations [left, right]

    Declaration

    Swift

    public convenience init(numberOfChannels: Int, operations: ([AKOperation]) -> [AKOperation])

    Parameters

    numberOfChannels

    Only 2 channels are supported, but need to differentiate the initializer

    operations

    Array of operations [left, right]

  • Initialize this generator node with a generic sporth stack and a triggering flag

    Declaration

    Swift

    public init(sporth: String, customUgens: [AKCustomUgen] = [])

    Parameters

    sporth

    String of valid Sporth code

  • Trigger the sound with current parameters

    Declaration

    Swift

    open func trigger(_ triggerNumber: Int = 0)
  • Function to start, play, or activate the node, all do the same thing

    Declaration

    Swift

    open func start()
  • Function to stop or bypass the node, both are equivalent

    Declaration

    Swift

    open func stop()
  • Restart from scratch

    Declaration

    Swift

    open func restart()