Contents

scaled(by:)

Scale the absorption data by a frequency-dependent scalar value between -1 and 1.

Declaration

func scaled(by frequencyDependentScalar: (Float) -> Float) -> Audio.Absorption

Parameters

  • frequencyDependentScalar:

    A function with frequency as input and coefficient scalar as output.

Discussion

  • No adjustment is made to the coefficient when the scalar is 0.

  • The coefficient is set to 0 when the scalar is -1.

  • The coefficient is set to 1 when the scalar is +1.

  • If the scalar value is between -1 and 0, the coefficient is adjusted by the percentage defined by the absolute value of the scalar between the original coefficient and 0.

  • If the scalar value is between 0 and 1, the coefficient is adjusted by the percentage defined by the scalar between the original coefficient and 1.