Package wellen.dsp

Class Distortion

java.lang.Object
wellen.dsp.Distortion
All Implemented Interfaces:
DSPNodeProcess

public class Distortion extends Object implements DSPNodeProcess
distorts a signal with different distortion strategies.
  • Constructor Details

    • Distortion

      public Distortion()
  • Method Details

    • get_amplification

      public float get_amplification()
      Returns:
      amplification value
    • set_amplification

      public void set_amplification(float pAmplification)
      set pre-amplification value. amplification only affects some distortion types e.g `DISTORTION_HARD_CLIPPING`, `DISTORTION_SOFT_CLIPPING_CUBIC`, `DISTORTION_SOFT_CLIPPING_ARC_TANGENT`.
      Parameters:
      pAmplification - the amplification factor. a value of `1.0f` has no effect on the signal.
    • get_clip

      public float get_clip()
      Returns:
      clipping value
    • set_clip

      public void set_clip(float pClip)
      Parameters:
      pClip - clipping value
    • get_type

      public int get_type()
      Returns:
      distortion type
    • set_type

      public void set_type(int pDistortionType)
      Parameters:
      pDistortionType - distortion type
    • get_bits

      public int get_bits()
      Returns:
      number of bits for `DISTORTION_BIT_CRUSHING`
    • set_bits

      public void set_bits(int pBits)
      set the number of bits for `DISTORTION_BIT_CRUSHING`
      Parameters:
      pBits - number of bits to which the signal will be reduced to
    • process

      public float process(float pSignal)
      Specified by:
      process in interface DSPNodeProcess
      Parameters:
      pSignal - input signal
      Returns:
      distorted signal