Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions content/references/examples/sound/AllPass/AllPass_0.pde
Original file line number Diff line number Diff line change
@@ -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() {
}
24 changes: 24 additions & 0 deletions content/references/examples/sound/AllPass/AllPass_1.pde
Original file line number Diff line number Diff line change
@@ -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);
}
24 changes: 24 additions & 0 deletions content/references/examples/sound/AllPass_gain_/AllPass_gain_0.pde
Original file line number Diff line number Diff line change
@@ -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);
}
Original file line number Diff line number Diff line change
@@ -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() {
}