Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added documentations for getAmp, getType,getFreq,getPan #420

Merged
merged 2 commits into from
Jun 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions src/oscillator.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,17 @@ define(function (require) {
// these are now the same thing
p5.Oscillator.prototype.fade = p5.Oscillator.prototype.amp;

p5.Oscillator.prototype.getAmp = function () {

/**
* Returns the value of output gain
*
* @method getAmp
* @for p5.Oscillator
*
* @returns {number} Amplitude value between 0.0 and 1.0
*/
endurance21 marked this conversation as resolved.
Show resolved Hide resolved
p5.Oscillator.prototype.getAmp = function() {

return this.output.gain.value;
};

Expand Down Expand Up @@ -293,6 +303,13 @@ define(function (require) {
return this.oscillator.frequency;
}
};
/**
* Returns the value of frequency of oscillator
*
* @method getFreq
* @for p5.Oscillator
* @returns {number} Frequency of oscillator in Hertz
*/
endurance21 marked this conversation as resolved.
Show resolved Hide resolved

p5.Oscillator.prototype.getFreq = function () {
return this.oscillator.frequency.value;
Expand All @@ -308,6 +325,13 @@ define(function (require) {
p5.Oscillator.prototype.setType = function (type) {
this.oscillator.type = type;
};
/**
* Returns current type of oscillator eg. 'sine', 'triangle', 'sawtooth' or 'square'.
*
* @method getType
* @for p5.Oscillator
* @returns {String} type of oscillator eg . 'sine', 'triangle', 'sawtooth' or 'square'.
*/

p5.Oscillator.prototype.getType = function () {
return this.oscillator.type;
Expand Down Expand Up @@ -365,7 +389,17 @@ define(function (require) {
this.panner.pan(pval, tFromNow);
};

p5.Oscillator.prototype.getPan = function () {
/**
* Returns the current value of panPosition , between Left (-1) and Right (1)
*
* @method getPan
* @for p5.Oscillator
*
* @returns {number} panPosition of oscillator , between Left (-1) and Right (1)
*/

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

return this.panPosition;
};

Expand Down