Skip to content

Commit be9410a

Browse files
committed
add secondary for tag to revive yuidocs
Webpack cant seem to keep track of which method belongs to which class, but YUIDoc gives us a way to do that with the "for" secondary tag https://yui.github.io/yuidoc/syntax/index.html
1 parent dbae4d2 commit be9410a

24 files changed

+321
-124
lines changed

src/amplitude.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ define(function (require) {
9292
* Optionally, you can pass in a specific source (i.e. a soundfile).
9393
*
9494
* @method setInput
95+
* @for p5.Amplitude
9596
* @param {soundObject|undefined} [snd] set the sound source
9697
* (optional, defaults to
9798
* master output)
@@ -226,6 +227,7 @@ define(function (require) {
226227
* For continuous readings, run in the draw loop.
227228
*
228229
* @method getLevel
230+
* @for p5.Amplitude
229231
* @param {Number} [channel] Optionally return only channel 0 (left) or 1 (right)
230232
* @return {Number} Amplitude as a number between 0.0 and 1.0
231233
* @example
@@ -276,6 +278,7 @@ define(function (require) {
276278
* (true or false). Normalizing is off by default.
277279
*
278280
* @method toggleNormalize
281+
* @for p5.Amplitude
279282
* @param {boolean} [boolean] set normalize to true (1) or false (0)
280283
*/
281284
p5.Amplitude.prototype.toggleNormalize = function(bool) {
@@ -292,6 +295,7 @@ define(function (require) {
292295
* frame. Off by default.
293296
*
294297
* @method smooth
298+
* @for p5.Amplitude
295299
* @param {Number} set smoothing from 0.0 <= 1
296300
*/
297301
p5.Amplitude.prototype.smooth = function(s) {

src/audioVoice.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ define(function() {
44

55
/**
66
* Base class for monophonic synthesizers. Any extensions of this class
7-
* should follow the API and implement the methods below in order to
7+
* should follow the API and implement the methods below in order to
88
* remain compatible with p5.PolySynth();
99
*
1010
* @class p5.AudioVoice
@@ -32,7 +32,8 @@ define(function() {
3232
/**
3333
* Connect to p5 objects or Web Audio Nodes
3434
* @method connect
35-
* @param {Object} unit
35+
* @for p5.AudioVoice
36+
* @param {Object} unit
3637
*/
3738
p5.AudioVoice.prototype.connect = function(unit) {
3839
var u = unit || p5sound.input;
@@ -42,6 +43,7 @@ define(function() {
4243
/**
4344
* Disconnect from soundOut
4445
* @method disconnect
46+
* @for p5.AudioVoice
4547
*/
4648
p5.AudioVoice.prototype.disconnect = function() {
4749
this.output.disconnect();

src/audiocontext.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ define(['StartAudioContext', 'Tone/core/Context', 'Tone/core/Tone'], function (S
6767
* @param {Function} [callback] Callback to invoke when the AudioContext has started
6868
* @return {Promise} Returns a Promise which is resolved when
6969
* the AudioContext state is 'running'
70-
* @method userStartAudio
70+
* @method userStartAudio
71+
* @for p5
7172
* @example
7273
* <div><code>
7374
* function setup() {

src/audioin.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ define(function (require) {
101101
* the browser won't provide mic access.
102102
*
103103
* @method start
104+
* @for p5.AudioIn
104105
* @param {Function} [successCallback] Name of a function to call on
105106
* success.
106107
* @param {Function} [errorCallback] Name of a function to call if
@@ -151,6 +152,7 @@ define(function (require) {
151152
* If re-starting, the user may be prompted for permission access.
152153
*
153154
* @method stop
155+
* @for p5.AudioIn
154156
*/
155157
p5.AudioIn.prototype.stop = function() {
156158
if (this.stream) {
@@ -170,6 +172,7 @@ define(function (require) {
170172
* connect to the master output (i.e. your speakers).<br/>
171173
*
172174
* @method connect
175+
* @for p5.AudioIn
173176
* @param {Object} [unit] An object that accepts audio input,
174177
* such as an FFT
175178
*/
@@ -196,6 +199,7 @@ define(function (require) {
196199
* signal to your speakers.<br/>
197200
*
198201
* @method disconnect
202+
* @for p5.AudioIn
199203
*/
200204
p5.AudioIn.prototype.disconnect = function() {
201205
if (this.output) {
@@ -213,6 +217,7 @@ define(function (require) {
213217
* .start() before using .getLevel().</em><br/>
214218
*
215219
* @method getLevel
220+
* @for p5.AudioIn
216221
* @param {Number} [smoothing] Smoothing is 0.0 by default.
217222
* Smooths values based on previous values.
218223
* @return {Number} Volume level (between 0.0 and 1.0)
@@ -228,6 +233,7 @@ define(function (require) {
228233
* Set amplitude (volume) of a mic input between 0 and 1.0. <br/>
229234
*
230235
* @method amp
236+
* @for p5.AudioIn
231237
* @param {Number} vol between 0 and 1.0
232238
* @param {Number} [time] ramp time (optional)
233239
*/
@@ -251,6 +257,7 @@ define(function (require) {
251257
* > and it returns a Promise.
252258
*
253259
* @method getSources
260+
* @for p5.AudioIn
254261
* @param {Function} [successCallback] This callback function handles the sources when they
255262
* have been enumerated. The callback function
256263
* receives the deviceList array as its only argument
@@ -307,6 +314,7 @@ define(function (require) {
307314
* >navigator.mediaDevices.enumerateDevices()</a>.<br/>
308315
*
309316
* @method setSource
317+
* @for p5.AudioIn
310318
* @param {number} num position of input source in the array
311319
*/
312320
p5.AudioIn.prototype.setSource = function(num) {

src/compressor.js

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,34 @@ define(function (require) {
88
/**
99
* Compressor is an audio effect class that performs dynamics compression
1010
* 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,
1212
* 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
1515
* at once. Compression can be used on indivudal sound sources in addition
16-
* to the master output.
16+
* to the master output.
1717
*
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
2121
* <a href = "/reference/#/p5.Effect/disconnect">disconnect()</a> are available.
2222
*
2323
* @class p5.Compressor
2424
* @constructor
2525
* @extends p5.Effect
2626
*
27-
*
27+
*
2828
*/
2929
p5.Compressor = function() {
3030
Effect.call(this);
3131

3232
/**
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"
3434
* target="_blank" title="W3 spec for Dynamics Compressor Node">Web Audio Dynamics Compressor Node
3535
* </a>
36-
* @property {AudioNode} compressor
36+
* @property {AudioNode} compressor
3737
*/
38-
38+
3939

4040
this.compressor = this.ac.createDynamicsCompressor();
4141

@@ -48,13 +48,14 @@ define(function (require) {
4848
/**
4949
* Performs the same function as .connect, but also accepts
5050
* optional parameters to set compressor's audioParams
51-
* @method process
51+
* @method process
52+
* @for p5.Compressor
5253
*
5354
* @param {Object} src Sound source to be connected
54-
*
55+
*
5556
* @param {Number} [attack] The amount of time (in seconds) to reduce the gain by 10dB,
5657
* 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
5859
* threshold where the curve smoothly transitions to the "ratio" portion.
5960
* default = 30, range 0 - 40
6061
* @param {Number} [ratio] The amount of dB change in input for a 1 dB change in output
@@ -64,18 +65,19 @@ define(function (require) {
6465
* @param {Number} [release] The amount of time (in seconds) to increase the gain by 10dB
6566
* default = .25, range 0 - 1
6667
*/
67-
p5.Compressor.prototype.process = function(src, attack, knee,
68+
p5.Compressor.prototype.process = function(src, attack, knee,
6869
ratio, threshold, release) {
6970
src.connect(this.input);
7071
this.set(attack, knee, ratio, threshold, release);
7172
};
7273

7374
/**
74-
* Set the paramters of a compressor.
75+
* Set the paramters of a compressor.
7576
* @method set
77+
* @for p5.Compressor
7678
* @param {Number} attack The amount of time (in seconds) to reduce the gain by 10dB,
7779
* 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
7981
* threshold where the curve smoothly transitions to the "ratio" portion.
8082
* default = 30, range 0 - 40
8183
* @param {Number} ratio The amount of dB change in input for a 1 dB change in output
@@ -85,7 +87,7 @@ define(function (require) {
8587
* @param {Number} release The amount of time (in seconds) to increase the gain by 10dB
8688
* default = .25, range 0 - 1
8789
*/
88-
p5.Compressor.prototype.set = function (attack, knee,
90+
p5.Compressor.prototype.set = function (attack, knee,
8991
ratio, threshold, release) {
9092

9193
if (typeof attack !== 'undefined') {this.attack(attack);}
@@ -98,9 +100,10 @@ define(function (require) {
98100

99101
/**
100102
* Get current attack or set value w/ time ramp
101-
*
102-
*
103+
*
104+
*
103105
* @method attack
106+
* @for p5.Compressor
104107
* @param {Number} [attack] Attack is the amount of time (in seconds) to reduce the gain by 10dB,
105108
* default = .003, range 0 - 1
106109
* @param {Number} [time] Assign time value to schedule the change in value
@@ -120,9 +123,10 @@ define(function (require) {
120123

121124
/**
122125
* Get current knee or set value w/ time ramp
123-
*
126+
*
124127
* @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
126130
* threshold where the curve smoothly transitions to the "ratio" portion.
127131
* default = 30, range 0 - 40
128132
* @param {Number} [time] Assign time value to schedule the change in value
@@ -143,9 +147,9 @@ define(function (require) {
143147
/**
144148
* Get current ratio or set value w/ time ramp
145149
* @method ratio
146-
*
150+
* @for p5.Compressor
147151
* @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
149153
* @param {Number} [time] Assign time value to schedule the change in value
150154
*/
151155
p5.Compressor.prototype.ratio = function (ratio, time){
@@ -164,7 +168,7 @@ define(function (require) {
164168
/**
165169
* Get current threshold or set value w/ time ramp
166170
* @method threshold
167-
*
171+
* @for p5.Compressor
168172
* @param {Number} threshold The decibel value above which the compression will start taking effect
169173
* default = -24, range -100 - 0
170174
* @param {Number} [time] Assign time value to schedule the change in value
@@ -185,7 +189,7 @@ define(function (require) {
185189
/**
186190
* Get current release or set value w/ time ramp
187191
* @method release
188-
*
192+
* @for p5.Compressor
189193
* @param {Number} release The amount of time (in seconds) to increase the gain by 10dB
190194
* default = .25, range 0 - 1
191195
*
@@ -207,6 +211,7 @@ define(function (require) {
207211
* Return the current reduction value
208212
*
209213
* @method reduction
214+
* @for p5.Compressor
210215
* @return {Number} Value of the amount of gain reduction that is applied to the signal
211216
*/
212217
p5.Compressor.prototype.reduction =function() {

src/delay.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ define(function (require) {
1515
* original source.
1616
*
1717
*
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
2121
* <a href = "/reference/#/p5.Effect/disconnect">disconnect()</a> are available.
2222
* @class p5.Delay
2323
* @extends p5.Effect
@@ -123,6 +123,7 @@ define(function (require) {
123123
* of delay parameters.
124124
*
125125
* @method process
126+
* @for p5.Delay
126127
* @param {Object} Signal An object that outputs audio
127128
* @param {Number} [delayTime] Time (in seconds) of the delay/echo.
128129
* Some browsers limit delayTime to
@@ -161,6 +162,7 @@ define(function (require) {
161162
* a floating point number between 0.0 and 1.0.
162163
*
163164
* @method delayTime
165+
* @for p5.Delay
164166
* @param {Number} delayTime Time (in seconds) of the delay
165167
*/
166168
p5.Delay.prototype.delayTime = function(t) {
@@ -186,6 +188,7 @@ define(function (require) {
186188
* creating an infinite feedback loop. The default value is 0.5
187189
*
188190
* @method feedback
191+
* @for p5.Delay
189192
* @param {Number|Object} feedback 0.0 to 1.0, or an object such as an
190193
* Oscillator that can be used to
191194
* modulate this param
@@ -215,6 +218,7 @@ define(function (require) {
215218
* will cut off any frequencies higher than the filter frequency.
216219
*
217220
* @method filter
221+
* @for p5.Delay
218222
* @param {Number|Object} cutoffFreq A lowpass filter will cut off any
219223
* frequencies higher than the filter frequency.
220224
* @param {Number|Object} res Resonance of the filter frequency
@@ -235,6 +239,7 @@ define(function (require) {
235239
* Any other parameter will revert to the default delay setting.
236240
*
237241
* @method setType
242+
* @for p5.Delay
238243
* @param {String|Number} type 'pingPong' (1) or 'default' (0)
239244
*/
240245
p5.Delay.prototype.setType = function(t) {
@@ -267,6 +272,7 @@ define(function (require) {
267272
* Set the output level of the delay effect.
268273
*
269274
* @method amp
275+
* @for p5.Delay
270276
* @param {Number} volume amplitude between 0 and 1.0
271277
* @param {Number} [rampTime] create a fade that lasts rampTime
272278
* @param {Number} [timeFromNow] schedule this event to happen
@@ -276,12 +282,14 @@ define(function (require) {
276282
* Send output to a p5.sound or web audio object
277283
*
278284
* @method connect
285+
* @for p5.Delay
279286
* @param {Object} unit
280287
*/
281288
/**
282289
* Disconnect all output.
283290
*
284291
* @method disconnect
292+
* @for p5.Delay
285293
*/
286294

287295
p5.Delay.prototype.dispose = function() {

0 commit comments

Comments
 (0)