@@ -13,7 +13,7 @@ define(function (require) {
13
13
* <p>p5.Signal is a constant audio-rate signal used by p5.Oscillator
14
14
* and p5.Envelope for modulation math.</p>
15
15
*
16
- * <p>This is necessary because Web Audio is processed on a seprate clock.
16
+ * <p>This is necessary because Web Audio is processed on a separate clock.
17
17
* For example, the p5 draw loop runs about 60 times per second. But
18
18
* the audio clock must process samples 44100 times per second. If we
19
19
* want to add a value to each of those samples, we can't do it in the
@@ -31,6 +31,7 @@ define(function (require) {
31
31
* @example
32
32
* <div><code>
33
33
* let carrier, modulator;
34
+ * let hasStarted = false;
34
35
*
35
36
* function setup() {
36
37
* let cnv = createCanvas(100, 100);
@@ -39,7 +40,6 @@ define(function (require) {
39
40
* text('tap to play', 20, 20);
40
41
*
41
42
* carrier = new p5.Oscillator('sine');
42
- * carrier.start();
43
43
* carrier.amp(1); // set amplitude
44
44
* carrier.freq(220); // set frequency
45
45
*
@@ -58,6 +58,10 @@ define(function (require) {
58
58
* function canvasPressed() {
59
59
* userStartAudio();
60
60
* carrier.amp(1.0);
61
+ * if(!hasStarted){
62
+ * carrier.start();
63
+ * hasStarted = true;
64
+ * }
61
65
* }
62
66
*
63
67
* function mouseReleased() {
0 commit comments