Skip to content

Commit 8c4f9bf

Browse files
pixmusixkevinstadler
authored andcommitted
Create AllPass_1.pde
A second example, with boilerplate and interactivity.
1 parent 4b04d04 commit 8c4f9bf

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import processing.sound.*;
2+
3+
SawOsc saw;
4+
AllPass allPass;
5+
6+
void setup() {
7+
size(100,100)
8+
9+
// Create a sawtooth wave and an AllPass filter
10+
saw = new SawOsc(this);
11+
saw.freq(200);
12+
allPass = new AllPass(this);
13+
14+
// Start the saw wave and push it through the allpass
15+
saw.play();
16+
allPass.process(saw);
17+
}
18+
19+
void draw() {
20+
// Set the drive of the allPass with the mouse
21+
float g = map(mouseX, 0, width, 0., 1.);
22+
allPass.gain(g);
23+
background(g * 255, 0, 0);
24+
}

0 commit comments

Comments
 (0)