Skip to content

Commit b1ab598

Browse files
Spongmantherewasaguy
authored andcommitted
doc comments fixes (#222)
* docs: remove @returns from @constructors, add @extends * docs: fix property types * various doc comments fixes * more doc comments fixes, add missing member names, fix some types * fix up property doc comments
1 parent da1d778 commit b1ab598

16 files changed

+85
-48
lines changed

src/audioVoice.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ define(function() {
77
* should follow the API and implement the methods below in order to
88
* remain compatible with p5.PolySynth();
99
*
10-
* @class AudioVoice
10+
* @class p5.AudioVoice
1111
* @constructor
1212
*/
1313
p5.AudioVoice = function () {

src/compressor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ define(function (require) {
3333
* 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 {WebAudioNode} compressor
36+
* @property {AudioNode} compressor
3737
*/
3838

3939

@@ -205,6 +205,8 @@ define(function (require) {
205205

206206
/**
207207
* Return the current reduction value
208+
*
209+
* @method reduction
208210
* @return {Number} Value of the amount of gain reduction that is applied to the signal
209211
*/
210212
p5.Compressor.prototype.reduction =function() {

src/effect.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ define(function (require) {
1818
*
1919
* @class p5.Effect
2020
* @constructor
21-
*
21+
*
2222
* @param {Object} [ac] Reference to the audio context of the p5 object
23-
* @param {WebAudioNode} [input] Gain Node effect wrapper
24-
* @param {WebAudioNode} [output] Gain Node effect wrapper
23+
* @param {AudioNode} [input] Gain Node effect wrapper
24+
* @param {AudioNode} [output] Gain Node effect wrapper
2525
* @param {Object} [_drywet] Tone.JS CrossFade node (defaults to value: 1)
26-
* @param {WebAudioNode} [wet] Effects that extend this class should connect
26+
* @param {AudioNode} [wet] Effects that extend this class should connect
2727
* to the wet signal to this gain node, so that dry and wet
2828
* signals are mixed properly.
2929
*/

src/eq.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ define(function (require) {
188188
* @method _newBand
189189
* @param {Number} freq
190190
* @param {Number} res
191-
* @return {Obect} Abstracted Filter
191+
* @return {Object} Abstracted Filter
192192
*/
193193
p5.EQ.prototype._newBand = function(freq, res) {
194194
return new EQFilter(freq, res);

src/filter.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ define(function (require) {
199199
* This is distinctly different from .amp() which is inherited from p5.Effect
200200
* .amp() controls the volume via the output gain node
201201
* p5.Filter.gain() controls the gain parameter of a Biquad Filter node.
202-
*
202+
*
203+
* @method gain
203204
* @param {Number} gain
204205
* @return {Number} Returns the current or updated gain value
205206
*/
@@ -218,6 +219,8 @@ define(function (require) {
218219

219220
/**
220221
* Toggle function. Switches between the specified type and allpass
222+
*
223+
* @method toggle
221224
* @return {boolean} [Toggle value]
222225
*/
223226
p5.Filter.prototype.toggle = function() {
@@ -261,7 +264,7 @@ define(function (require) {
261264
*
262265
* @class p5.LowPass
263266
* @constructor
264-
* @extends {p5.Filter}
267+
* @extends p5.Filter
265268
*/
266269
p5.LowPass = function() {
267270
p5.Filter.call(this, 'lowpass');
@@ -276,7 +279,7 @@ define(function (require) {
276279
*
277280
* @class p5.HighPass
278281
* @constructor
279-
* @extends {p5.Filter}
282+
* @extends p5.Filter
280283
*/
281284
p5.HighPass = function() {
282285
p5.Filter.call(this, 'highpass');
@@ -289,9 +292,9 @@ define(function (require) {
289292
* its method <code>setType('bandpass')</code>.
290293
* See p5.Filter for methods.
291294
*
292-
* @class BandPass
295+
* @class p5.BandPass
293296
* @constructor
294-
* @extends {p5.Filter}
297+
* @extends p5.Filter
295298
*/
296299
p5.BandPass = function() {
297300
p5.Filter.call(this, 'bandpass');

src/helpers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ define(function (require) {
2424
* Returns the closest MIDI note value for
2525
* a given frequency.
2626
*
27+
* @method freqToMidi
2728
* @param {Number} frequency A freqeuncy, for example, the "A"
2829
* above Middle C is 440Hz
2930
* @return {Number} MIDI note value

src/listener3d.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,22 @@ define(function (require) {
9595
return this.listener.positionZ.value;
9696
};
9797

98-
/**
99-
* Overrides the listener orient() method because Listener has slightly
100-
* different params. In human terms, Forward vectors are the direction the
101-
* nose is pointing. Up vectors are the direction of the top of the head.
102-
*
103-
* @param {Number} xValF Forward vector X direction
104-
* @param {Number} yValF Forward vector Y direction
105-
* @param {Number} zValF Forward vector Z direction
106-
* @param {Number} xValU Up vector X direction
107-
* @param {Number} yValU Up vector Y direction
108-
* @param {Number} zValU Up vector Z direction
109-
* @param {Number} time
110-
* @return {Array} All orienation params
111-
*/
98+
// cannot define method when class definition is commented
99+
// /**
100+
// * Overrides the listener orient() method because Listener has slightly
101+
// * different params. In human terms, Forward vectors are the direction the
102+
// * nose is pointing. Up vectors are the direction of the top of the head.
103+
// *
104+
// * @method orient
105+
// * @param {Number} xValF Forward vector X direction
106+
// * @param {Number} yValF Forward vector Y direction
107+
// * @param {Number} zValF Forward vector Z direction
108+
// * @param {Number} xValU Up vector X direction
109+
// * @param {Number} yValU Up vector Y direction
110+
// * @param {Number} zValU Up vector Z direction
111+
// * @param {Number} time
112+
// * @return {Array} All orienation params
113+
// */
112114
p5.Listener3D.prototype.orient = function(xValF, yValF, zValF,
113115
xValU, yValU, zValU, time) {
114116

src/looper.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ define(function (require) {
99
* Set the global tempo, in beats per minute, for all
1010
* p5.Parts. This method will impact all active p5.Parts.
1111
*
12+
* @method setBPM
1213
* @param {Number} BPM Beats Per Minute
1314
* @param {Number} rampTime Seconds from now
1415
*/
@@ -494,6 +495,7 @@ define(function (require) {
494495
/**
495496
* Set the tempo for all parts in the score
496497
*
498+
* @method setBPM
497499
* @param {Number} BPM Beats Per Minute
498500
* @param {Number} rampTime Seconds from now
499501
*/

src/monosynth.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ define(function (require) {
9999
* value in Note/Octave format ("C4", "Eb3"...etc")
100100
* See <a href = "https://github.com/Tonejs/Tone.js/wiki/Instruments">
101101
* Tone</a>. Defaults to 440 hz
102-
* @param {Number} secondsFromNow time from now (in seconds)
103102
* @param {Number} [velocity] velocity of the note to play (ranging from 0 to 1)
104103
* @param {Number} [secondsFromNow] time from now (in seconds) at which to play
105104
* @method triggerAttack
@@ -159,8 +158,14 @@ define(function (require) {
159158
/**
160159
* Getters and Setters
161160
* @property {Number} attack
161+
*/
162+
/**
162163
* @property {Number} decay
164+
*/
165+
/**
163166
* @property {Number} sustain
167+
*/
168+
/**
164169
* @property {Number} release
165170
*/
166171
Object.defineProperties(p5.MonoSynth.prototype, {

src/noise.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ define(function (require) {
157157
* Set the amplitude of the noise between 0 and 1.0. Or,
158158
* modulate amplitude with an audio signal such as an oscillator.
159159
*
160+
* @method amp
160161
* @param {Number|Object} volume amplitude between 0 and 1.0
161162
* or modulating signal/oscillator
162163
* @param {Number} [rampTime] create a fade that lasts rampTime

0 commit comments

Comments
 (0)