diff --git a/content/references/examples/sound/AllPass/AllPass_0.pde b/content/references/examples/sound/AllPass/AllPass_0.pde new file mode 100644 index 00000000..e79cbfe4 --- /dev/null +++ b/content/references/examples/sound/AllPass/AllPass_0.pde @@ -0,0 +1,25 @@ +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() { +} diff --git a/content/references/examples/sound/AllPass/AllPass_1.pde b/content/references/examples/sound/AllPass/AllPass_1.pde new file mode 100644 index 00000000..36525292 --- /dev/null +++ b/content/references/examples/sound/AllPass/AllPass_1.pde @@ -0,0 +1,24 @@ +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); +} diff --git a/content/references/examples/sound/AllPass_gain_/AllPass_gain_0.pde b/content/references/examples/sound/AllPass_gain_/AllPass_gain_0.pde new file mode 100644 index 00000000..36525292 --- /dev/null +++ b/content/references/examples/sound/AllPass_gain_/AllPass_gain_0.pde @@ -0,0 +1,24 @@ +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); +} diff --git a/content/references/examples/sound/AllPass_process_/AllPass_process_0.pde b/content/references/examples/sound/AllPass_process_/AllPass_process_0.pde new file mode 100644 index 00000000..e79cbfe4 --- /dev/null +++ b/content/references/examples/sound/AllPass_process_/AllPass_process_0.pde @@ -0,0 +1,25 @@ +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() { +}