Skip to content

Commit a22f3b3

Browse files
committed
improvement in documentation of methods of oscillator node
1 parent 686d02f commit a22f3b3

File tree

5 files changed

+43
-5
lines changed

5 files changed

+43
-5
lines changed

lib/p5.sound.js

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** [p5.sound] Version: 0.3.12 - 2020-01-06 */
1+
/** [p5.sound] Version: 0.3.12 - 2020-03-16 */
22
/**
33
* <p>p5.sound extends p5 with <a href="http://caniuse.com/audio-api"
44
* target="_blank">Web Audio</a> functionality including audio input,
@@ -1577,6 +1577,14 @@ var __WEBPACK_AMD_DEFINE_RESULT__;
15771577

15781578

15791579
p5.Oscillator.prototype.fade = p5.Oscillator.prototype.amp;
1580+
/**
1581+
* Returns the value of output gain
1582+
*
1583+
* @method getAmp
1584+
* @for p5.Oscillator
1585+
*
1586+
* @return {number} Amplitude value between 0.0 and 1.0
1587+
*/
15801588

15811589
p5.Oscillator.prototype.getAmp = function () {
15821590
return this.output.gain.value;
@@ -1655,6 +1663,14 @@ var __WEBPACK_AMD_DEFINE_RESULT__;
16551663
return this.oscillator.frequency;
16561664
}
16571665
};
1666+
/**
1667+
* Returns the value of frequency of oscillator
1668+
*
1669+
* @method getFreq
1670+
* @for p5.Oscillator
1671+
* @returns {number} Frequency of oscillator in Hertz
1672+
*/
1673+
16581674

16591675
p5.Oscillator.prototype.getFreq = function () {
16601676
return this.oscillator.frequency.value;
@@ -1671,6 +1687,14 @@ var __WEBPACK_AMD_DEFINE_RESULT__;
16711687
p5.Oscillator.prototype.setType = function (type) {
16721688
this.oscillator.type = type;
16731689
};
1690+
/**
1691+
* Returns current type of oscillator eg. 'sine', 'triangle', 'sawtooth' or 'square'.
1692+
*
1693+
* @method getType
1694+
* @for p5.Oscillator
1695+
* @returns {String} type of oscillator eg . 'sine', 'triangle', 'sawtooth' or 'square'.
1696+
*/
1697+
16741698

16751699
p5.Oscillator.prototype.getType = function () {
16761700
return this.oscillator.type;
@@ -1733,6 +1757,15 @@ var __WEBPACK_AMD_DEFINE_RESULT__;
17331757
this.panPosition = pval;
17341758
this.panner.pan(pval, tFromNow);
17351759
};
1760+
/**
1761+
* Returns the current value of panPosition , between Left (-1) and Right (1)
1762+
*
1763+
* @method getPan
1764+
* @for p5.Oscillator
1765+
*
1766+
* @returns {number} panPosition of oscillator , between Left (-1) and Right (1)
1767+
*/
1768+
17361769

17371770
p5.Oscillator.prototype.getPan = function () {
17381771
return this.panPosition;

lib/p5.sound.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/p5.sound.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/p5.sound.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/oscillator.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ define(function (require) {
218218
*
219219
* @method getAmp
220220
* @for p5.Oscillator
221+
*
222+
* @return {number} Amplitude value between 0.0 and 1.0
221223
*/
222224
p5.Oscillator.prototype.getAmp = function() {
223225
return this.output.gain.value;
@@ -305,6 +307,7 @@ define(function (require) {
305307
*
306308
* @method getFreq
307309
* @for p5.Oscillator
310+
* @returns {number} Frequency of oscillator in Hertz
308311
*/
309312

310313
p5.Oscillator.prototype.getFreq = function() {
@@ -326,7 +329,7 @@ define(function (require) {
326329
*
327330
* @method getType
328331
* @for p5.Oscillator
329-
* @param {String} type 'sine', 'triangle', 'sawtooth' or 'square'.
332+
* @returns {String} type of oscillator eg . 'sine', 'triangle', 'sawtooth' or 'square'.
330333
*/
331334

332335
p5.Oscillator.prototype.getType = function() {
@@ -392,6 +395,8 @@ define(function (require) {
392395
*
393396
* @method getPan
394397
* @for p5.Oscillator
398+
*
399+
* @returns {number} panPosition of oscillator , between Left (-1) and Right (1)
395400
*/
396401

397402
p5.Oscillator.prototype.getPan = function() {

0 commit comments

Comments
 (0)