Skip to content

Commit 6029b59

Browse files
committed
Revised Examples + fixed WhiteNoise Bug
1 parent 2d3cd7e commit 6029b59

File tree

8 files changed

+56
-18
lines changed

8 files changed

+56
-18
lines changed

java/libraries/sound/examples/Effects/Filter/BandPass/BandPass.pde renamed to java/libraries/sound/examples/Effects/Filter/BPF/BPF.pde

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In this example it is started and stopped by clicking into the renderer window.
66
import processing.sound.*;
77

88
WhiteNoise noise;
9-
BPF bandPass;
9+
BandPass bPass;
1010

1111
float amp=0.0;
1212

@@ -16,14 +16,14 @@ void setup() {
1616

1717
// Create the noise generator + Filter
1818
noise = new WhiteNoise(this);
19-
bandPass = new BPF(this);
19+
bPass = new BandPass(this);
2020
noise.play(0.5);
21-
bandPass.process(noise, 100);
21+
bPass.process(noise, 100);
2222
}
2323

2424
void draw() {
2525

26-
bandPass.freq(map(mouseX, 0, 350, 20, 10000));
26+
bPass.freq(map(mouseX, 0, 350, 20, 10000));
2727

28-
bandPass.res(map(mouseY, 0, 350, 0.05, 1.0));
28+
bPass.res(map(mouseY, 0, 350, 0.05, 1.0));
2929
}

java/libraries/sound/examples/Effects/Filter/HighPass/HighPass.pde renamed to java/libraries/sound/examples/Effects/Filter/HPF/HPF.pde

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In this example it is started and stopped by clicking into the renderer window.
66
import processing.sound.*;
77

88
WhiteNoise noise;
9-
HPF highPass;
9+
HighPass highPass;
1010

1111
float amp=0.0;
1212

@@ -16,12 +16,11 @@ void setup() {
1616

1717
// Create the noise generator + filter
1818
noise = new WhiteNoise(this);
19-
highPass = new HPF(this);
19+
highPass = new HighPass(this);
2020
noise.play(0.5);
2121
highPass.process(noise, 100);
2222
}
2323

2424
void draw() {
25-
2625
highPass.freq(map(mouseX, 0, 350, 20, 10000));
2726
}

java/libraries/sound/examples/Effects/Filter/LowPass/LowPass.pde renamed to java/libraries/sound/examples/Effects/Filter/LPF/LPF.pde

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ In this example it is started and stopped by clicking into the renderer window.
66
import processing.sound.*;
77

88
WhiteNoise noise;
9-
LPF lowPass;
9+
LowPass lPass;
1010

1111
float amp=0.0;
1212

@@ -16,11 +16,11 @@ void setup() {
1616

1717
// Create the noise generator + filter
1818
noise = new WhiteNoise(this);
19-
lowPass = new LPF(this);
20-
noise.play(0.5);
21-
lowPass.process(noise, 800);
19+
lPass = new LowPass(this);
20+
noise.play(0.2);
21+
lPass.process(noise, 800);
2222
}
2323

2424
void draw() {
25-
lowPass.freq(map(mouseX, 0, 350, 800, 10000));
25+
lPass.freq(map(mouseX, 0, 350, 800, 10000));
2626
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
This is a sound file player.
3+
*/
4+
5+
import processing.sound.*;
6+
7+
SoundFile soundfile;
8+
Reverb reverb;
9+
10+
11+
void setup() {
12+
size(640,360);
13+
background(255);
14+
15+
//Load a soundfile
16+
soundfile = new SoundFile(this, "vibraphon.aiff");
17+
18+
// create a Delay Effect
19+
reverb = new Reverb(this);
20+
21+
// Play the file in a loop
22+
soundfile.loop();
23+
24+
// Set soundfile as input to the reverb
25+
reverb.process(soundfile);
26+
}
27+
28+
29+
void draw() {
30+
31+
// change the roomsize of the reverb
32+
reverb.room(map(mouseX, 0, width, 0, 1.0));
33+
34+
// change the high frequency dampening parameter
35+
reverb.damp(map(mouseX, 0, width, 0, 1.0));
36+
37+
// change the wet/dry relation of the effect
38+
reverb.wet(map(mouseY, 0, height, 0, 1.0));
39+
40+
}
Binary file not shown.

java/libraries/sound/examples/Effects/Variable_Delay/Variable_Delay.pde

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ void draw() {
3636
soundfile.rate(map(mouseX, 0, width, 0.25, 4.0));
3737

3838
// Map mouseY from 0.2 to 1.0 for amplitude
39-
soundfile.amp(map(mouseY, 0, width, 0.2, 1.0));
39+
soundfile.amp(map(mouseY, 0, height, 0.2, 1.0));
4040

4141
// Map mouseY from -1.0 to 1.0 for left to right
42-
soundfile.pan(map(mouseY, 0, width, -1.0, 1.0));
42+
soundfile.pan(map(mouseY, 0, height, -1.0, 1.0));
4343

4444
// Map mouseY from 0.001 to 2.0 seconds for the delaytime
45-
delay.time(map(mouseY, 0, width, 0.001, 2.0));
45+
delay.time(map(mouseY, 0, height, 0.001, 2.0));
4646

4747
// Map mouseX from 0 to 0.8 for the delay feedback
4848
delay.feedback(map(mouseX, 0, width, 0.0, 0.8));
0 Bytes
Binary file not shown.

java/libraries/sound/src/processing/sound/SqrOsc.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ public SqrOsc(PApplet theParent) {
2020
}
2121

2222
public void play(){
23-
//m_nodeId = m_engine.pulsePlay(m_freq, 0.5f, m_amp*2, m_add-1, m_pos);
24-
m_nodeId = m_engine.sqrPlay(m_freq, m_amp, m_add-1, m_pos);
23+
m_nodeId = m_engine.sqrPlay(m_freq, m_amp, m_add-1, m_pos);
2524
};
2625

2726
public void play(float freq, float amp, float add, float pos){

0 commit comments

Comments
 (0)