Class Name

AllPass

Description

This is an all pass filter. For signals processed, all frequencies hold the same amplitude but have their phase relationship modified using a delayline of one sample,

y(k) = -z * x(k) + x(k - 1) + z * y(k - 1)

where y is the output, x is the input, z is the gain coefficient, and k is the signal.

Examples

  • import processing.sound.*;
    
    void setup() {
      // Create two triangle waves with deconstructive frequencies.
      TriOsc triA = new TriOsc(this);
      triA.freq(220);
      TriOsc triB = new TriOsc(this);
      triB.freq(410);
    
      // Make an Allpass
      AllPass allPass = new AllPass(this);
      // Give Allpass a high gain to process yucky transience. 
      allPass.gain(0.995);
    
      // Start both triangle waves together. 
      // This will create a lot of unbridled bright sounds. 
      triA.play();
      triB.play();
      // Processing the sound through this high gained Allpass will warm it up! 
      allPass.process(triA);
      allPass.process(triB);
    }
    
    void draw() {
    }
    
  • import processing.sound.*;
    
    SawOsc saw;
    AllPass allPass;
    
    void setup() {
      size(100, 100);
    
      // Create a sawtooth wave and an AllPass filter
      saw = new SawOsc(this);
      saw.freq(200);
      allPass = new AllPass(this);
    
      // Start the saw wave and push it through the allpass
      saw.play();
      allPass.process(saw);
    }
    
    void draw() {
      // Set the drive of the allPass with the mouse
      float g = map(mouseX, 0, width, 0, 1);
      allPass.gain(g);
      background(g * 255, 0, 0);
    }
    

Constructors

  • AllPass(parent)

Methods