Skip to content

Commit 17987e7

Browse files
authored
rename masterVolume to outputVolume (#610)
rename masterVolume to outputVolume and rename Master to Main
1 parent 282274a commit 17987e7

File tree

52 files changed

+156
-156
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+156
-156
lines changed

examples/Compressor/sketch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function setup() {
5050

5151
compressor = new p5.Compressor();
5252

53-
// Disconnect soundfile from master output.
53+
// Disconnect soundfile from main output.
5454
// Then, connect it to the filter, so that we only hear the filtered sound
5555
soundFile.disconnect();
5656
compressor.process(soundFile);

examples/FFT_frequency_spectrum/sketch.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ function setup() {
4444
p = createP(description);
4545
var p2 = createP('Draw the array returned by FFT.analyze( ). This represents the frequency spectrum, from lowest to highest frequencies.');
4646

47-
// set the master volume;
48-
masterVolume(.5);
47+
outputVolume(0.5);
4948
}
5049

5150
function draw() {

examples/Filter_BandPass/sketch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function setup() {
1919

2020
noise = new p5.Noise();
2121

22-
noise.disconnect(); // Disconnect soundfile from master output...
22+
noise.disconnect(); // Disconnect soundfile from main output...
2323
filter.process(noise); // ...and connect to filter so we'll only hear BandPass.
2424
noise.start();
2525

@@ -58,4 +58,4 @@ function draw() {
5858
function updateDescription() {
5959
description = 'Playing! Press any key to pause. Filter Frequency = ' + filterFreq + ' Filter Width = ' + filterWidth;
6060
p.html(description);
61-
}
61+
}

examples/Filter_LowPass/sketch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function setup() {
2727

2828
filter = new p5.LowPass();
2929

30-
// Disconnect soundfile from master output.
30+
// Disconnect soundFile from main output.
3131
// Then, connect it to the filter, so that we only hear the filtered sound
3232
soundFile.disconnect();
3333
soundFile.connect(filter);
@@ -68,4 +68,4 @@ function draw() {
6868
function updateDescription() {
6969
description = 'Filter Frequency = ' + filterFreq + ' Filter Res = ' + filterRes;
7070
p.html(description);
71-
}
71+
}

examples/Reverb_convolve/sketch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function preload() {
3030
}
3131

3232
function setup() {
33-
// disconnect from master output...
33+
// disconnect from main output...
3434
sound.disconnect();
3535
// ... and process with cVerb so that we only hear the reverb
3636
cVerb.process(sound);
@@ -53,4 +53,4 @@ function mousePressed() {
5353

5454
// display the current Impulse Response name (the filepath)
5555
p.html('Convolution Impulse Response: ' + cVerb.impulses[currentIR].name);
56-
}
56+
}

examples/Reverb_convolve_FFT/sketch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function setup() {
3636
createCanvas(710, 400);
3737
rawImpulse = loadSound('../files/' + cVerb.impulses[currentIR].name);
3838

39-
// disconnect from master output...
39+
// disconnect from main output...
4040
sound.disconnect();
4141
// ... and process with cVerb
4242
// so that we only hear the reverb
@@ -84,4 +84,4 @@ function mousePressed() {
8484

8585
function keyPressed() {
8686
rawImpulse.play();
87-
}
87+
}

examples/amplitude_analysis/sketch.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ function keyPressed(e) {
7979

8080
function mouseClicked() {
8181
if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) {
82-
if ( getMasterVolume() == 0) {
83-
masterVolume(0, 1);
82+
if ( getOutputVolume() == 0) {
83+
outputVolume(0, 1);
8484
} else {
85-
masterVolume(0.1),1;
85+
outputVolume(0.1),1;
8686
}
8787
}
8888
}

examples/distortion/sketch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function setup() {
1717
env.setADSR(0.01, 0.2, 0.1, 0.3);
1818
env.setRange(1.0, 0.0);
1919

20-
osc = new p5.SawOsc(); // connects to master output by default
20+
osc = new p5.SawOsc(); // connects to main output by default
2121
osc.start(0);
2222
osc.freq(220);
2323
osc.amp(env);

examples/envAmpFreq/sketch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function setup() {
1616
freqEnv.setRange(300, 5000);
1717

1818

19-
osc = new p5.Oscillator(); // connects to master output by default
19+
osc = new p5.Oscillator(); // connects to main output by default
2020
osc.start(0);
2121
osc.freq(220);
2222
// osc.freq(env.scale(0,1,800,300));
@@ -32,4 +32,4 @@ function mousePressed() {
3232
function mouseReleased() {
3333
env.triggerRelease();
3434
freqEnv.triggerRelease();
35-
}
35+
}

examples/envExp/sketch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function setup() {
4747
myPart.start();
4848
fft = new p5.FFT();
4949
fft.setInput(osc);
50-
masterVolume(0);
50+
outputVolume(0);
5151
endPoint = width / numWaveforms;
5252
noStroke();
5353
background(20);

examples/envelopeMultipleSources/sketch.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function setup(){
4343

4444
trigger = millis();
4545

46-
masterVolume(0.3);
46+
outputVolume(0.3);
4747

4848
triOsc = new p5.TriOsc();
4949
triOsc.amp(0);
@@ -92,10 +92,10 @@ function draw(){
9292

9393
function mouseClicked() {
9494
if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) {
95-
if ( getMasterVolume() == 0) {
96-
masterVolume(0.3, 0.5);
95+
if ( getOutputVolume() == 0) {
96+
outputVolume(0.3, 0.5);
9797
} else {
98-
masterVolume(0, 0.5);
98+
outputVolume(0, 0.5);
9999
}
100100
}
101-
}
101+
}

examples/graphical_eq/sketch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function setup() {
3838
eqSize = 8;
3939
eq = new p5.EQ(eqSize);
4040

41-
// Disconnect soundFile from master output.
41+
// Disconnect soundFile from main output.
4242
// Then, connect it to the EQ, so that we only hear the EQ'd sound
4343
soundFile.loop();
4444
soundFile.disconnect();

examples/learningProcessingExamples/01a_loadSound_playback/sketch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ function mousePressed() {
1717
song.play();
1818
background(0,255,0);
1919
}
20-
}
20+
}

examples/looper_simple/sketch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var prevTime = 0;
1616
function setup() {
1717
// prepare the osc and env used by playNote()
1818
env = new p5.Envelope(0.01, 0.8, 0.2, 0);
19-
osc = new p5.TriOsc(); // connects to master output by default
19+
osc = new p5.TriOsc(); // connects to main output by default
2020
osc.start(0);
2121
osc.connect();
2222
env.setInput(osc);
@@ -61,4 +61,4 @@ function draw() {
6161
fill(255, 0, 0);
6262
var noteHeight = map(currentBassNote, 40, 50, height, 0);
6363
ellipse(width/2, noteHeight, 30, 30);
64-
}
64+
}

examples/micLevel_on_off/sketch.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var mic;
2-
var amplitude, micLevel, masterLevel, levelLabel;
2+
var amplitude, micLevel, outputLevel, levelLabel;
33

44
var soundToggle;
55
var soundOn = false;
@@ -17,8 +17,8 @@ function setup() {
1717
mic.start();
1818

1919
// create controls
20-
levelLabel = createP('Master Volume: ');
21-
masterLevel = createSlider(0,100,50);
20+
levelLabel = createP('Output Volume: ');
21+
outputLevel = createSlider(0,100,50);
2222

2323
soundToggle = createButton('Sound ON');
2424
soundToggle.mousePressed(toggleSound);
@@ -27,7 +27,7 @@ function setup() {
2727
micToggle.mousePressed(toggleMic);
2828

2929
h = createP('enable the mic...');
30-
createP('NOTE: Mic is disconnected from master output (speakers) by default. Turning sound on with mic.connect( ) may cause a <a href="https://en.wikipedia.org/wiki/Audio_feedback" target="_blank">feedback loop</a> between the mic and speakers. Try headphones.');
30+
createP('NOTE: Mic is disconnected from main output (speakers) by default. Turning sound on with mic.connect( ) may cause a <a href="https://en.wikipedia.org/wiki/Audio_feedback" target="_blank">feedback loop</a> between the mic and speakers. Try headphones.');
3131
}
3232

3333
function draw() {
@@ -46,13 +46,13 @@ function draw() {
4646

4747
ellipse(width/2,height/2, 400*micLevel + 10, 400*micLevel + 10);
4848

49-
// set master output
50-
levelLabel.html('Master Volume: ' + masterLevel.value()/100);
51-
masterVolume(masterLevel.value()/100);
49+
// set main output
50+
levelLabel.html('Output Volume: ' + outputLevel.value()/100);
51+
outputVolume(outputLevel.value()/100);
5252
}
5353

5454

55-
// Toggle whether mic is connected to master output
55+
// Toggle whether mic is connected to main output
5656
function toggleSound() {
5757
if (soundOn == false) {
5858
mic.connect();
@@ -76,4 +76,4 @@ function toggleMic() {
7676
micOn = true;
7777
micToggle.html('Stop mic');
7878
}
79-
}
79+
}

examples/mixingSounds/sketch.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ function preload(){
1212
function setup() {
1313
createCanvas(400,200);
1414

15-
// create a 'master' gain to which we will connect both soundfiles
16-
gain3 = new p5.Gain();
17-
gain3.connect();
15+
// create a 'mix bus' gain to which we will connect both soundfiles
16+
mixBus = new p5.Gain();
17+
mixBus.connect();
1818

1919
// setup first sound for playing
2020
sound1.rate(1);
@@ -23,15 +23,15 @@ function setup() {
2323

2424
gain1 = new p5.Gain(); // setup a gain node
2525
gain1.setInput(sound1); // connect the first sound to its input
26-
gain1.connect(gain3); // connect its output to the 'master'
26+
gain1.connect(mixBus); // connect its output to the 'mix bus'
2727

2828
sound2.rate(1);
2929
sound2.disconnect();
3030
sound2.loop();
3131

3232
gain2 = new p5.Gain();
3333
gain2.setInput(sound2);
34-
gain2.connect(gain3);
34+
gain2.connect(mixBus);
3535

3636
}
3737

@@ -49,9 +49,9 @@ function draw(){
4949
gain1.amp(vol1,0.5,0);
5050
gain2.amp(vol2,0.5,0);
5151

52-
// map the vertical position of the mouse to values useable for 'master volume control'
52+
// map the vertical position of the mouse to values useable for 'output volume control'
5353
var vol3 = map(mouseY,0,height,0,1);
54-
gain3.amp(vol3,0.5,0);
54+
mixBus.amp(vol3,0.5,0);
5555
}
5656

5757

examples/noiseMod_AM/sketch.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
* the carrier's amplitude.
55
*
66
* The carrier is typically set at an audible frequency (i.e. 440 Hz)
7-
* and connected to master output by default. The carrier.amp is
7+
* and connected to main output by default. The carrier.amp is
88
* set to zero because we will have the modulator control its amplitude.
99
*
1010
* The modulator is typically set to a frequency that is lower than
1111
* humans can hear (i.e. 1 Hz, or one cycle every second). The modulator
12-
* is disconnected from master output. Instead, it is connected
12+
* is diconnected from main output. Instead, it is connected
1313
* to the amplitude of the Carrier, like this: carrier.amp(modulator).
1414
*
1515
* MouseX controls the amplitude of the modulator from 0 to 1. When the
@@ -31,15 +31,15 @@ function setup() {
3131
background(30); // alpha
3232
noFill();
3333

34-
carrier = new p5.Noise(); // connects to master output by default
34+
carrier = new p5.Noise(); // connects to main output by default
3535
// carrier.freq(340);
3636
carrier.amp(0);
3737
// carrier's amp is 0 by default, giving our modulator total control
3838

3939
carrier.start();
4040

4141
modulator = new p5.Oscillator('triangle');
42-
modulator.disconnect(); // disconnect the modulator from master output
42+
modulator.disconnect(); // disconnect the modulator from main output
4343
modulator.freq(5);
4444
modulator.amp(0.5);
4545
modulator.start();
@@ -77,4 +77,4 @@ function draw() {
7777
}
7878
endShape();
7979

80-
}
80+
}

examples/oscillatorMod_AM/sketch.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
* the carrier's amplitude.
55
*
66
* The carrier is typically set at an audible frequency (i.e. 440 Hz)
7-
* and connected to master output by default. The carrier.amp is
7+
* and connected to main output by default. The carrier.amp is
88
* set to zero because we will have the modulator control its amplitude.
99
*
1010
* The modulator is typically set to a frequency that is lower than
1111
* humans can hear (i.e. 1 Hz, or one cycle every second). The modulator
12-
* is disconnected from master output. Instead, it is connected
12+
* is diconnected from main output. Instead, it is connected
1313
* to the amplitude of the Carrier, like this: carrier.amp(modulator).
1414
*
1515
* MouseX controls the amplitude of the modulator from 0 to 1. When the
@@ -31,15 +31,15 @@ function setup() {
3131
background(30); // alpha
3232
noFill();
3333

34-
carrier = new p5.Oscillator(); // connects to master output by default
34+
carrier = new p5.Oscillator(); // connects to main output by default
3535
carrier.start();
3636
carrier.freq(340);
3737
carrier.amp(0.2);
3838
// carrier's amp is 0 by default, giving our modulator total control
3939

4040

4141
modulator = new p5.Oscillator('triangle');
42-
modulator.disconnect(); // disconnect the modulator from master output
42+
modulator.disconnect(); // disconnect the modulator from main output
4343
modulator.start();
4444
modulator.freq(5);
4545
modulator.amp(1);
@@ -75,4 +75,4 @@ function draw() {
7575
}
7676
endShape();
7777

78-
}
78+
}

examples/oscillatorMod_FM/sketch.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
* the carrier's frequency.
55
*
66
* The carrier oscillates at an audible frequency (i.e. 440 Hz)
7-
* and connected to master output by default.
7+
* and connected to main output by default.
88
*
99
* The modulator is typically set to a frequency that is lower
1010
* than humans can hear (i.e. 1 Hz, or one cycle every second).
11-
* The modulator is disconnected from master output, and is connected
11+
* The modulator is diconnected from main output, and is connected
1212
* to the frequency of the carrier, like this: carrier.freq(modulator).
1313
*
1414
* In this example...
@@ -77,4 +77,4 @@ function draw() {
7777
}
7878
endShape();
7979

80-
}
80+
}

examples/playbackRatePart/sketch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function setup() {
1010
noStroke();
1111
fill(255);
1212
textAlign(CENTER);
13-
masterVolume(0.1);
13+
outputVolume(0.1);
1414

1515
myPhrase = new p5.Phrase('bbox', makeSound, pattern);
1616
myPart = new p5.Part();
@@ -35,4 +35,4 @@ function mouseClicked() {
3535
myPart.start();
3636
msg = 'playing pattern';
3737
}
38-
}
38+
}

0 commit comments

Comments
 (0)