AKAmplitudeEnvelope

open class AKAmplitudeEnvelope: AKNode, AKToggleable, AKComponent

Triggerable classic ADSR envelope

  • Ramp Time represents the speed at which parameters are allowed to change

    Declaration

    Swift

    open var rampTime: Double = AKSettings.rampTime
  • Attack time

    Declaration

    Swift

    open var attackDuration: Double = 0.1
  • Decay time

    Declaration

    Swift

    open var decayDuration: Double = 0.1
  • Sustain Level

    Declaration

    Swift

    open var sustainLevel: Double = 1.0
  • Release time

    Declaration

    Swift

    open var releaseDuration: Double = 0.1
  • Tells whether the node is processing (ie. started, playing, or active)

    Declaration

    Swift

    open var isStarted: Bool
  • Initialize this envelope node

    • Parameters:
      • input: Input node to process
      • attackDuration: Attack time
      • decayDuration: Decay time
      • sustainLevel: Sustain Level
      • releaseDuration: Release time

    Declaration

    Swift

    public init(
            _ input: AKNode,
            attackDuration: Double = 0.1,
            decayDuration: Double = 0.1,
            sustainLevel: Double = 1.0,
            releaseDuration: Double = 0.1)

    Parameters

    input

    Input node to process

    attackDuration

    Attack time

    decayDuration

    Decay time

    sustainLevel

    Sustain Level

    releaseDuration

    Release time

  • 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()