@@ -8,34 +8,34 @@ define(function (require) {
8
8
/**
9
9
* Compressor is an audio effect class that performs dynamics compression
10
10
* on an audio input source. This is a very commonly used technique in music
11
- * and sound production. Compression creates an overall louder, richer,
11
+ * and sound production. Compression creates an overall louder, richer,
12
12
* and fuller sound by lowering the volume of louds and raising that of softs.
13
- * Compression can be used to avoid clipping (sound distortion due to
14
- * peaks in volume) and is especially useful when many sounds are played
13
+ * Compression can be used to avoid clipping (sound distortion due to
14
+ * peaks in volume) and is especially useful when many sounds are played
15
15
* at once. Compression can be used on indivudal sound sources in addition
16
- * to the master output.
16
+ * to the master output.
17
17
*
18
- * This class extends <a href = "/reference/#/p5.Effect">p5.Effect</a>.
19
- * Methods <a href = "/reference/#/p5.Effect/amp">amp()</a>, <a href = "/reference/#/p5.Effect/chain">chain()</a>,
20
- * <a href = "/reference/#/p5.Effect/drywet">drywet()</a>, <a href = "/reference/#/p5.Effect/connect">connect()</a>, and
18
+ * This class extends <a href = "/reference/#/p5.Effect">p5.Effect</a>.
19
+ * Methods <a href = "/reference/#/p5.Effect/amp">amp()</a>, <a href = "/reference/#/p5.Effect/chain">chain()</a>,
20
+ * <a href = "/reference/#/p5.Effect/drywet">drywet()</a>, <a href = "/reference/#/p5.Effect/connect">connect()</a>, and
21
21
* <a href = "/reference/#/p5.Effect/disconnect">disconnect()</a> are available.
22
22
*
23
23
* @class p5.Compressor
24
24
* @constructor
25
25
* @extends p5.Effect
26
26
*
27
- *
27
+ *
28
28
*/
29
29
p5 . Compressor = function ( ) {
30
30
Effect . call ( this ) ;
31
31
32
32
/**
33
- * The p5.Compressor is built with a <a href="https://www.w3.org/TR/webaudio/#the-dynamicscompressornode-interface"
33
+ * The p5.Compressor is built with a <a href="https://www.w3.org/TR/webaudio/#the-dynamicscompressornode-interface"
34
34
* target="_blank" title="W3 spec for Dynamics Compressor Node">Web Audio Dynamics Compressor Node
35
35
* </a>
36
- * @property {AudioNode } compressor
36
+ * @property {AudioNode } compressor
37
37
*/
38
-
38
+
39
39
40
40
this . compressor = this . ac . createDynamicsCompressor ( ) ;
41
41
@@ -48,13 +48,14 @@ define(function (require) {
48
48
/**
49
49
* Performs the same function as .connect, but also accepts
50
50
* optional parameters to set compressor's audioParams
51
- * @method process
51
+ * @method process
52
+ * @for p5.Compressor
52
53
*
53
54
* @param {Object } src Sound source to be connected
54
- *
55
+ *
55
56
* @param {Number } [attack] The amount of time (in seconds) to reduce the gain by 10dB,
56
57
* default = .003, range 0 - 1
57
- * @param {Number } [knee] A decibel value representing the range above the
58
+ * @param {Number } [knee] A decibel value representing the range above the
58
59
* threshold where the curve smoothly transitions to the "ratio" portion.
59
60
* default = 30, range 0 - 40
60
61
* @param {Number } [ratio] The amount of dB change in input for a 1 dB change in output
@@ -64,18 +65,19 @@ define(function (require) {
64
65
* @param {Number } [release] The amount of time (in seconds) to increase the gain by 10dB
65
66
* default = .25, range 0 - 1
66
67
*/
67
- p5 . Compressor . prototype . process = function ( src , attack , knee ,
68
+ p5 . Compressor . prototype . process = function ( src , attack , knee ,
68
69
ratio , threshold , release ) {
69
70
src . connect ( this . input ) ;
70
71
this . set ( attack , knee , ratio , threshold , release ) ;
71
72
} ;
72
73
73
74
/**
74
- * Set the paramters of a compressor.
75
+ * Set the paramters of a compressor.
75
76
* @method set
77
+ * @for p5.Compressor
76
78
* @param {Number } attack The amount of time (in seconds) to reduce the gain by 10dB,
77
79
* default = .003, range 0 - 1
78
- * @param {Number } knee A decibel value representing the range above the
80
+ * @param {Number } knee A decibel value representing the range above the
79
81
* threshold where the curve smoothly transitions to the "ratio" portion.
80
82
* default = 30, range 0 - 40
81
83
* @param {Number } ratio The amount of dB change in input for a 1 dB change in output
@@ -85,7 +87,7 @@ define(function (require) {
85
87
* @param {Number } release The amount of time (in seconds) to increase the gain by 10dB
86
88
* default = .25, range 0 - 1
87
89
*/
88
- p5 . Compressor . prototype . set = function ( attack , knee ,
90
+ p5 . Compressor . prototype . set = function ( attack , knee ,
89
91
ratio , threshold , release ) {
90
92
91
93
if ( typeof attack !== 'undefined' ) { this . attack ( attack ) ; }
@@ -98,9 +100,10 @@ define(function (require) {
98
100
99
101
/**
100
102
* Get current attack or set value w/ time ramp
101
- *
102
- *
103
+ *
104
+ *
103
105
* @method attack
106
+ * @for p5.Compressor
104
107
* @param {Number } [attack] Attack is the amount of time (in seconds) to reduce the gain by 10dB,
105
108
* default = .003, range 0 - 1
106
109
* @param {Number } [time] Assign time value to schedule the change in value
@@ -120,9 +123,10 @@ define(function (require) {
120
123
121
124
/**
122
125
* Get current knee or set value w/ time ramp
123
- *
126
+ *
124
127
* @method knee
125
- * @param {Number } [knee] A decibel value representing the range above the
128
+ * @for p5.Compressor
129
+ * @param {Number } [knee] A decibel value representing the range above the
126
130
* threshold where the curve smoothly transitions to the "ratio" portion.
127
131
* default = 30, range 0 - 40
128
132
* @param {Number } [time] Assign time value to schedule the change in value
@@ -143,9 +147,9 @@ define(function (require) {
143
147
/**
144
148
* Get current ratio or set value w/ time ramp
145
149
* @method ratio
146
- *
150
+ * @for p5.Compressor
147
151
* @param {Number } [ratio] The amount of dB change in input for a 1 dB change in output
148
- * default = 12, range 1 - 20
152
+ * default = 12, range 1 - 20
149
153
* @param {Number } [time] Assign time value to schedule the change in value
150
154
*/
151
155
p5 . Compressor . prototype . ratio = function ( ratio , time ) {
@@ -164,7 +168,7 @@ define(function (require) {
164
168
/**
165
169
* Get current threshold or set value w/ time ramp
166
170
* @method threshold
167
- *
171
+ * @for p5.Compressor
168
172
* @param {Number } threshold The decibel value above which the compression will start taking effect
169
173
* default = -24, range -100 - 0
170
174
* @param {Number } [time] Assign time value to schedule the change in value
@@ -185,7 +189,7 @@ define(function (require) {
185
189
/**
186
190
* Get current release or set value w/ time ramp
187
191
* @method release
188
- *
192
+ * @for p5.Compressor
189
193
* @param {Number } release The amount of time (in seconds) to increase the gain by 10dB
190
194
* default = .25, range 0 - 1
191
195
*
@@ -207,6 +211,7 @@ define(function (require) {
207
211
* Return the current reduction value
208
212
*
209
213
* @method reduction
214
+ * @for p5.Compressor
210
215
* @return {Number } Value of the amount of gain reduction that is applied to the signal
211
216
*/
212
217
p5 . Compressor . prototype . reduction = function ( ) {
0 commit comments