AKComputedParameter

public protocol AKComputedParameter: AKParameter

A computed parameter differs from a regular parameter in that it only exists within an operation (unlike float, doubles, and ints which have a value outside of an operation)

  • pitchShift(semitones:) Extension method

    This will digitally degrade a signal.

    • Parameters:
      • bitDepth: The bit depth of signal output. Typically in range (1-24). Non-integer values are OK. (Default: 8, Minimum: 1, Maximum: 24)
      • sampleRate: The sample rate of signal output. (Default: 10000, Minimum: 0.0, Maximum: 20000.0)

    Declaration

    Swift

    public func pitchShift(semitones: AKParameter = 0) -> AKOperation

    Parameters

    bitDepth

    The bit depth of signal output. Typically in range (1-24). Non-integer values are OK. (Default: 8, Minimum: 1, Maximum: 24)

    sampleRate

    The sample rate of signal output. (Default: 10000, Minimum: 0.0, Maximum: 20000.0)

  • reverberateWithChowning() Extension method

    This is was built using the JC reverb implentation found in FAUST. According to the source code, the specifications for this implementation were found on an old SAIL DART backup tape. This class is derived from the CLM JCRev function, which is based on the use of networks of simple allpass and comb delay filters. This class implements three series allpass units, followed by four parallel comb filters, and two decorrelation delay lines in parallel at the output.

    Declaration

    Swift

    public func reverberateWithChowning() -> AKOperation
  • A modal resonance filter used for modal synthesis. Plucked and bell sounds can be created using passing an impulse through a combination of modal filters.

    • Parameters:
      • frequency: Fundamental frequency of the filter. (Default: 100.0, Minimum: 12.0, Maximum: 20000.0)
      • feedback: Feedback gain. A value close to 1 creates a slower decay and a more pronounced resonance. Small values may leave the input signal unaffected. Depending on the filter frequency, typical values are > .9. Default 0.95

    Declaration

    Swift

    public func stringResonator(
            frequency: AKParameter = 100.0,
                      feedback: AKParameter = 0.95
            ) -> AKOperation

    Parameters

    frequency

    Fundamental frequency of the filter. (Default: 100.0, Minimum: 12.0, Maximum: 20000.0)

    feedback

    Feedback gain. A value close to 1 creates a slower decay and a more pronounced resonance. Small values may leave the input signal unaffected. Depending on the filter frequency, typical values are > .9. Default 0.95

  • Distortion using a modified hyperbolic tangent function.

    • Parameters:
      • pregain: Determines the amount of gain applied to the signal before waveshaping. A value of 1 gives slight distortion. (Default: 2.0, Minimum: 0.0, Maximum: 10.0)
      • postgain: Gain applied after waveshaping (Default: 0.5, Minimum: 0.0, Maximum: 10.0)
      • postiveShapeParameter: Shape of the positive part of the signal. A value of 0 gets a flat clip. (Default: 0.0, Minimum: -10.0, Maximum: 10.0)
      • negativeShapeParameter: Like the positive shape parameter, only for the negative part. (Default: 0.0, Minimum: -10.0, Maximum: 10.0)

    Declaration

    Swift

    public func distort(
            pregain: AKParameter = 2.0,
            postgain: AKParameter = 0.5,
            postiveShapeParameter: AKParameter = 0.0,
            negativeShapeParameter: AKParameter = 0.0
            ) -> AKOperation

    Parameters

    pregain

    Determines the amount of gain applied to the signal before waveshaping. A value of 1 gives slight distortion. (Default: 2.0, Minimum: 0.0, Maximum: 10.0)

    postgain

    Gain applied after waveshaping (Default: 0.5, Minimum: 0.0, Maximum: 10.0)

    postiveShapeParameter

    Shape of the positive part of the signal. A value of 0 gets a flat clip. (Default: 0.0, Minimum: -10.0, Maximum: 10.0)

    negativeShapeParameter

    Like the positive shape parameter, only for the negative part. (Default: 0.0, Minimum: -10.0, Maximum: 10.0)

  • A second-order resonant filter.

    • Parameters:
      • frequency: The center frequency of the filter, or frequency position of the peak response (defaults to 4000 Hz).
      • bandwidth: The bandwidth of the filter (the Hz difference between the upper and lower half-power points; defaults to 1000 Hz).

    Declaration

    Swift

    public func resonantFilter(
            frequency: AKParameter = 4000.0,
                      bandwidth: AKParameter = 1000.0
            ) -> AKOperation

    Parameters

    frequency

    The center frequency of the filter, or frequency position of the peak response (defaults to 4000 Hz).

    bandwidth

    The bandwidth of the filter (the Hz difference between the upper and lower half-power points; defaults to 1000 Hz).

  • A delay line with cubic interpolation.

    • Parameters:
      • time: Delay time (in seconds) that can be changed during performance. This value must not exceed the maximum delay time. (Default: 1.0, Minimum: 0.0, Maximum: 10.0)
      • feedback: Feedback amount. Should be a value between 0-1. (Default: 0.0, Minimum: 0.0, Maximum: 1.0)
      • maximumDelayTime: The maximum delay time, in seconds. (Default: 5.0, Minimum: 0.0, Maximum: 10.0)

    Declaration

    Swift

    public func variableDelay(
            time: AKParameter = 1.0,
            feedback: AKParameter = 0.0,
            maximumDelayTime: Double = 5.0
            ) -> AKOperation

    Parameters

    time

    Delay time (in seconds) that can be changed during performance. This value must not exceed the maximum delay time. (Default: 1.0, Minimum: 0.0, Maximum: 10.0)

    feedback

    Feedback amount. Should be a value between 0-1. (Default: 0.0, Minimum: 0.0, Maximum: 1.0)

    maximumDelayTime

    The maximum delay time, in seconds. (Default: 5.0, Minimum: 0.0, Maximum: 10.0)

  • These filters are Butterworth second-order IIR filters. They offer an almost flat passband and very good precision and stopband attenuation.

    Declaration

    Swift

    public func lowPassButterworthFilter(
            cutoffFrequency: AKParameter = 1000
            ) -> AKOperation

    Parameters

    cutoffFrequency

    Cutoff frequency. (in Hertz) (Default: 1000, Minimum: 12.0, Maximum: 20000.0)

  • This filter reiterates input with an echo density determined by loopDuration. The attenuation rate is independent and is determined by reverbDuration, the reverberation duration (defined as the time in seconds for a signal to decay to 1/1000, or 60dB down from its original amplitude). Output from a comb filter will appear only after loopDuration seconds.

    • Parameters:
      • reverbDuration: The time in seconds for a signal to decay to 1/1000, or 60dB from its original amplitude. (aka RT-60). (Default: 1.0, Minimum: 0.0, Maximum: 10.0)
      • loopDuration: The loop time of the filter, in seconds. This can also be thought of as the delay time. Determines frequency response curve, loopDuration * sr/2 peaks spaced evenly between 0 and sr/2. (Default: 0.1, Minimum: 0.0, Maximum: 1.0)

    Declaration

    Swift

    public func reverberateWithCombFilter(
            reverbDuration: AKParameter = 1.0,
            loopDuration: AKParameter = 0.1
            ) -> AKOperation

    Parameters

    reverbDuration

    The time in seconds for a signal to decay to 1/1000, or 60dB from its original amplitude. (aka RT-60). (Default: 1.0, Minimum: 0.0, Maximum: 10.0)

    loopDuration

    The loop time of the filter, in seconds. This can also be thought of as the delay time. Determines frequency response curve, loopDuration * sr/2 peaks spaced evenly between 0 and sr/2. (Default: 0.1, Minimum: 0.0, Maximum: 1.0)

  • clip(_:) Extension method

    Clips a signal to a predefined limit, in a soft manner, using one of three methods.

    Declaration

    Swift

    public func clip(_ limit: AKParameter = 1.0) -> AKOperation

    Parameters

    limit

    Threshold / limiting value. (Default: 1.0, Minimum: 0.0, Maximum: 1.0)

  • Smooth variable delay line without varispeed pitch.

    • Parameters:
      • time: Delay time (in seconds) that can be changed during performance. This value must not exceed the maximum delay time. (Default: 1.0, Minimum: 0.0, Maximum: 10.0)
      • samplesls: Interpolation samples
      • feedback: Feedback amount. Should be a value between 0-1. (Default: 0.0, Minimum: 0.0, Maximum: 1.0)
      • maximumDelayTime: The maximum delay time, in seconds. (Default: 5.0, Minimum: 0.0, Maximum: 10.0)

    Declaration

    Swift

    public func smoothDelay(
            time: AKParameter = 1.0,
                 samples: AKParameter = 1024,
                 feedback: AKParameter = 0.0,
                 maximumDelayTime: Double = 5.0
            ) -> AKOperation

    Parameters

    time

    Delay time (in seconds) that can be changed during performance. This value must not exceed the maximum delay time. (Default: 1.0, Minimum: 0.0, Maximum: 10.0)

    samplesls

    Interpolation samples

    feedback

    Feedback amount. Should be a value between 0-1. (Default: 0.0, Minimum: 0.0, Maximum: 1.0)

    maximumDelayTime

    The maximum delay time, in seconds. (Default: 5.0, Minimum: 0.0, Maximum: 10.0)

  • Moog Ladder is an new digital implementation of the Moog ladder filter based on the work of Antti Huovilainen, described in the paper Non-Linear Digital Implementation of the Moog Ladder Filter (Proceedings of DaFX04, Univ of Napoli). This implementation is probably a more accurate digital representation of the original analogue filter.

    • Parameters:
      • cutoffFrequency: Filter cutoff frequency. (Default: 1000, Minimum: 12.0, Maximum: 20000.0)
      • resonance: Resonance, generally < 1, but not limited to it. Higher than 1 resonance values might cause aliasing, analogue synths generally allow resonances to be above 1. (Default: 0.5, Minimum: 0.0, Maximum: 2.0)

    Declaration

    Swift

    public func moogLadderFilter(
            cutoffFrequency: AKParameter = 1000,
            resonance: AKParameter = 0.5
            ) -> AKOperation

    Parameters

    cutoffFrequency

    Filter cutoff frequency. (Default: 1000, Minimum: 12.0, Maximum: 20000.0)

    resonance

    Resonance, generally < 1, but not limited to it. Higher than 1 resonance values might cause aliasing, analogue synths generally allow resonances to be above 1. (Default: 0.5, Minimum: 0.0, Maximum: 2.0)

  • pan(_:) Extension method

    Panner

    • Parameters:
      • input: Input audio signal
      • pan: Panning. A value of -1 is hard left, and a value of 1 is hard right, and 0 is center. (Default: 0, Minimum: -1, Maximum: 1)

    Declaration

    Swift

    public func pan(_ pan: AKParameter = 0) -> AKStereoOperation

    Parameters

    input

    Input audio signal

    pan

    Panning. A value of -1 is hard left, and a value of 1 is hard right, and 0 is center. (Default: 0, Minimum: -1, Maximum: 1)

  • Analogue model of the Korg 35 Lowpass Filter

    Declaration

    Swift

    public func korgLowPassFilter(
            cutoffFrequency: AKParameter = 1000.0,
            resonance: AKParameter = 1.0,
            saturation: AKParameter = 0.0
            ) -> AKOperation

    Parameters

    input

    Input audio signal

    cutoffFrequency

    Filter cutoff (Default: 1000.0, Minimum: 0.0, Maximum: 22050.0)

    resonance

    Filter resonance (should be between 0-2) (Default: 1.0, Minimum: 0.0, Maximum: 2.0)

    saturation

    Filter saturation. (Default: 0.0, Minimum: 0.0, Maximum: 10.0)

    Return Value

    AKOperation

  • 8 delay line stereo FDN reverb, with feedback matrix based upon physical modeling scattering junction of 8 lossless waveguides of equal characteristic impedance.

    • Parameters:
      • feedback: Feedback level in the range 0 to 1. 0.6 gives a good small ‘live’ room sound, 0.8 a small hall, and 0.9 a large hall. A setting of exactly 1 means infinite length, while higher values will make the opcode unstable. (Default: 0.6, Minimum: 0.0, Maximum: 1.0)
      • cutoffFrequency: Low-pass cutoff frequency. (Default: 4000, Minimum: 12.0, Maximum: 20000.0)

    Declaration

    Swift

    public func reverberateWithCostello(
            feedback: AKParameter = 0.6,
            cutoffFrequency: AKParameter = 4000
            ) -> AKStereoOperation

    Parameters

    feedback

    Feedback level in the range 0 to 1. 0.6 gives a good small ‘live’ room sound, 0.8 a small hall, and 0.9 a large hall. A setting of exactly 1 means infinite length, while higher values will make the opcode unstable. (Default: 0.6, Minimum: 0.0, Maximum: 1.0)

    cutoffFrequency

    Low-pass cutoff frequency. (Default: 4000, Minimum: 12.0, Maximum: 20000.0)

  • These filters are Butterworth second-order IIR filters. They offer an almost flat passband and very good precision and stopband attenuation.

    Declaration

    Swift

    public func highPassButterworthFilter(
            cutoffFrequency: AKParameter = 500
            ) -> AKComputedParameter

    Parameters

    cutoffFrequency

    Cutoff frequency. (in Hertz) (Default: 500, Minimum: 12.0, Maximum: 20000.0)

  • A complement to the AKLowPassFilter.

    Declaration

    Swift

    public func highPassFilter(
            halfPowerPoint: AKParameter = 1000
            ) -> AKOperation

    Parameters

    halfPowerPoint

    Half-Power Point in Hertz. Half power is defined as peak power / square root of 2. (Default: 1000, Minimum: 12.0, Maximum: 20000.0)

  • dcBlock() Extension method

    Implements the DC blocking filter Y[i] = X[i] - X[i-1] + (igain * Y[i-1]) Based on work by Perry Cook.

    Declaration

    Swift

    public func dcBlock() -> AKOperation

    Parameters

    input

    Input audio signal

  • 3-pole (18 db/oct slope) Low-Pass filter with resonance and tanh distortion.

    Declaration

    Swift

    public func threePoleLowPassFilter(
            distortion: AKParameter = 0.5,
            cutoffFrequency: AKParameter = 1500,
            resonance: AKParameter = 0.5
            ) -> AKOperation

    Parameters

    input

    Input audio signal

    distortion

    Distortion amount. Zero gives a clean output. Greater than zero adds tanh distortion controlled by the filter parameters, in such a way that both low cutoff and high resonance increase the distortion amount. (Default: 0.5, Minimum: 0.0, Maximum: 2.0)

    cutoffFrequency

    Filter cutoff frequency in Hertz. (Default: 1500, Minimum: 12.0, Maximum: 20000.0)

    resonance

    Resonance. Usually a value in the range 0-1. A value of 1.0 will self oscillate at the cutoff frequency. Values slightly greater than 1 are possible for more sustained oscillation and an “overdrive” effect. (Default: 0.5, Minimum: 0.0, Maximum: 2.0)

    Return Value

    AKOperation

  • delay(time:feedback:) Extension method

    Add a delay to an incoming signal with optional feedback.

    • Parameters:
      • time: Delay time, in seconds. (Default: 1.0, Minimum: 0.0, Maximum: 10.0)
      • feedback: Feedback amount. (Default: 0.0, Minimum: 0.0, Maximum: 1.0)

    Declaration

    Swift

    public func delay(
            time: Double = 1.0,
            feedback: AKParameter = 0.0
            ) -> AKOperation

    Parameters

    time

    Delay time, in seconds. (Default: 1.0, Minimum: 0.0, Maximum: 10.0)

    feedback

    Feedback amount. (Default: 0.0, Minimum: 0.0, Maximum: 1.0)

  • This will digitally degrade a signal.

    • Parameters:
      • bitDepth: The bit depth of signal output. Typically in range (1-24). Non-integer values are OK. (Default: 8, Minimum: 1, Maximum: 24)
      • sampleRate: The sample rate of signal output. (Default: 10000, Minimum: 0.0, Maximum: 20000.0)

    Declaration

    Swift

    public func bitCrush(
            bitDepth: AKParameter = 8,
            sampleRate: AKParameter = 10000
            ) -> AKOperation

    Parameters

    bitDepth

    The bit depth of signal output. Typically in range (1-24). Non-integer values are OK. (Default: 8, Minimum: 1, Maximum: 24)

    sampleRate

    The sample rate of signal output. (Default: 10000, Minimum: 0.0, Maximum: 20000.0)

  • This filter reiterates the input with an echo density determined by loop time. The attenuation rate is independent and is determined by the reverberation time (defined as the time in seconds for a signal to decay to 1/1000, or 60dB down from its original amplitude). Output will begin to appear immediately.

    • Parameters:
      • reverbDuration: The duration in seconds for a signal to decay to 1/1000, or 60dB down from its original amplitude. (Default: 0.5, Minimum: 0, Maximum: 10)
      • loopDuration: The loop duration of the filter, in seconds. This can also be thought of as the delay time or “echo density” of the reverberation. (Default: 0.1, Minimum: 0, Maximum: 1)

    Declaration

    Swift

    public func reverberateWithFlatFrequencyResponse(
            reverbDuration: AKParameter = 0.5,
            loopDuration: Double = 0.1
            ) -> AKOperation

    Parameters

    reverbDuration

    The duration in seconds for a signal to decay to 1/1000, or 60dB down from its original amplitude. (Default: 0.5, Minimum: 0, Maximum: 10)

    loopDuration

    The loop duration of the filter, in seconds. This can also be thought of as the delay time or “echo density” of the reverberation. (Default: 0.1, Minimum: 0, Maximum: 1)

  • autoWah(wah:amplitude:) Extension method

    An automatic wah effect, ported from Guitarix via Faust.

    • Parameters:
      • wah: Wah Amount (Default: 0, Minimum: 0, Maximum: 1)
      • amplitude: Overall level (Default: 0.1, Minimum: 0, Maximum: 1)

    Declaration

    Swift

    public func autoWah(
            wah: AKParameter = 0,
            amplitude: AKParameter = 0.1
            ) -> AKOperation

    Parameters

    wah

    Wah Amount (Default: 0, Minimum: 0, Maximum: 1)

    amplitude

    Overall level (Default: 0.1, Minimum: 0, Maximum: 1)

  • A first-order recursive low-pass filter with variable frequency response.

    Declaration

    Swift

    public func lowPassFilter(
            halfPowerPoint: AKParameter = 1000
            ) -> AKOperation

    Parameters

    halfPowerPoint

    The response curve’s half-power point, in Hertz. Half power is defined as peak power / root 2. (Default: 1000, Minimum: 12.0, Maximum: 20000.0)

  • A modal resonance filter used for modal synthesis. Plucked and bell sounds can be created using passing an impulse through a combination of modal filters.

    • Parameters:
      • frequency: Resonant frequency of the filter. (Default: 500.0, Minimum: 12.0, Maximum: 20000.0)
      • qualityFactor: Quality factor of the filter. Roughly equal to Q/frequency. (Default: 50.0, Minimum: 0.0, Maximum: 100.0)

    Declaration

    Swift

    public func modalResonanceFilter(
            frequency: AKParameter = 500.0,
            qualityFactor: AKParameter = 50.0
            ) -> AKOperation

    Parameters

    frequency

    Resonant frequency of the filter. (Default: 500.0, Minimum: 12.0, Maximum: 20000.0)

    qualityFactor

    Quality factor of the filter. Roughly equal to Q/frequency. (Default: 50.0, Minimum: 0.0, Maximum: 100.0)