File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,21 @@ define(function (require) {
16
16
*
17
17
* @class p5.MonoSynth
18
18
* @constructor
19
+ * @example
20
+ * <div><code>
21
+ * var monosynth;
22
+ * var x;
19
23
*
24
+ * function setup() {
25
+ * monosynth = new p5.MonoSynth();
26
+ * monosynth.loadPreset('simpleBass');
27
+ * monosynth.play(45,1,x=0,1);
28
+ * monosynth.play(49,1,x+=1,0.25);
29
+ * monosynth.play(50,1,x+=0.25,0.25);
30
+ * monosynth.play(49,1,x+=0.5,0.25);
31
+ * monosynth.play(50,1,x+=0.25,0.25);
32
+ * }
33
+ * </code></div>
20
34
**/
21
35
22
36
p5 . MonoSynth = function ( ) {
@@ -25,7 +39,6 @@ define(function (require) {
25
39
this . oscillator = new p5 . Oscillator ( ) ;
26
40
this . oscillator . disconnect ( ) ;
27
41
28
-
29
42
this . env = new p5 . Env ( ) ;
30
43
this . env . setRange ( 1 , 0 ) ;
31
44
this . env . setExp ( true ) ;
Original file line number Diff line number Diff line change @@ -19,6 +19,22 @@ define(function (require) {
19
19
* the AudioVoice class. Defaults ot p5.MonoSynth
20
20
*
21
21
* @param {Number } [polyValue] Number of voices, defaults to 8;
22
+ *
23
+ *
24
+ *
25
+ * @example
26
+ * <div><code>
27
+ * var polysynth;
28
+ * function setup() {
29
+ * polysynth = new p5.PolySynth();
30
+ * polysynth.play(53,1,0,3);
31
+ * polysynth.play(60,1,0,2.9);
32
+ * polysynth.play(69,1,0,3);
33
+ * polysynth.play(71,1,0,3);
34
+ * polysynth.play(74,1,0,3);
35
+ * }
36
+ * </code></div>
37
+ *
22
38
**/
23
39
p5 . PolySynth = function ( audioVoice , polyValue ) {
24
40
//audiovoices will contain polyValue many monophonic synths
You can’t perform that action at this time.
0 commit comments