doc'ing components

This commit is contained in:
Seth Kranzler 2015-07-01 20:19:58 -04:00
parent faf289bdd6
commit 12c56011b6
13 changed files with 68 additions and 35 deletions

View file

@ -10,7 +10,11 @@ define(["Tone/core/Tone", "Tone/signal/Signal", "Tone/signal/Expr", "Tone/signal
* @param {NormalRange} [initialFade=0.5]
* @example
* var crossFade = new Tone.CrossFade(0.5);
* //connect effect A to crossfade from
* //effect output 0 to crossfade input 0
* effectA.connect(crossFade, 0, 0);
* //connect effect B to crossfade from
* //effect output 0 to crossfade input 1
* effectB.connect(crossFade, 0, 1);
* crossFade.fade.value = 0;
* // ^ only effectA is output

View file

@ -3,7 +3,7 @@ define(["Tone/core/Tone", "Tone/component/MultibandSplit", "Tone/signal/Signal"]
"use strict";
/**
* @class A 3 band EQ with control over low, mid, and high gain as
* @class EQ3 is a three band EQ with control over low, mid, and high gain as
* well as the low and high crossover frequencies.
*
* @constructor

View file

@ -5,11 +5,14 @@ function(Tone){
"use strict";
/**
* @class A crude envelope follower which will follow the amplitude
* of the incoming signal.
* Careful with small (< 0.02) attack or decay values.
* The follower has some ripple which gets exaggerated
* by small values.
* @class Follower is a crude envelope follower which will follow
* the amplitude of an incoming signal.
* Take care with small (< 0.02) attack or decay values
* as follower has some ripple which is exaggerated
* at these values. More on envelop followers (also known
* as envelope detectors) on
* <a href="https://en.wikipedia.org/wiki/Envelope_detector"
* target="_blank">Wikipedia</a>.
*
* @constructor
* @extends {Tone}
@ -153,8 +156,8 @@ function(Tone){
});
/**
* borrows the connect method from Signal so that the output can be used
* as a control signal {@link Tone.Signal}
* Borrows the connect method from Signal so that the output can be used
* as a Tone.Signal control signal.
* @function
*/
Tone.Follower.prototype.connect = Tone.Signal.prototype.connect;

View file

@ -3,9 +3,12 @@ define(["Tone/core/Tone", "Tone/component/Follower", "Tone/signal/GreaterThan"],
"use strict";
/**
* @class Only pass signal through when it's signal exceeds the
* specified threshold. Uses a Tone.Follower to follow the
* amplitude of the incoming signal.
* @class Tone.Gate only passes a signal through when the incoming
* signal exceeds a specified threshold. To do this, Gate uses
* a Tone.Follower to follow the amplitude of the incoming signal.
* A common implementation of this class is a
* <a href="https://en.wikipedia.org/wiki/Noise_gate" target="_blank">
* Noise Gate</a>.
*
* @constructor
* @extends {Tone}

View file

@ -3,8 +3,12 @@ define(["Tone/core/Tone", "Tone/component/Compressor"], function(Tone){
"use strict";
/**
* @class Limit the loudness of the incoming signal. Composed of a Tone.Compressor
* with a fast attack and release.
* @class Tone.Limiter will limit the loudness of an incoming signal.
* It is composed of a Tone.Compressor with a fast attack
* and release. Limiters are commonly used to safeguard against
* signal clipping. Unlike a compressor, limiters do not provide
* smooth gain reduction and almost completely prevent
* additional gain above the threshold.
*
* @extends {Tone}
* @constructor

View file

@ -3,15 +3,20 @@ define(["Tone/core/Tone"], function(Tone){
"use strict";
/**
* @class Merge two signals into the left and right
* channels of a single, stereo channel.
* @class Tone.Merge brings two signals into the left and right
* channels of a single stereo channel.
*
* @constructor
* @extends {Tone}
* @example
* var merge = new Tone.Merge();
* sigLeft.connect(merge.left);
* sigRight.connect(merge.right);
* var merge = new Tone.Merge().toMaster();
* //routing a sine tone in the left channel
* //and noise in the right channel
* var osc = new Tone.Oscillator().connect(merge.left);
* var noise = new Tone.Noise().connect(merge.right);
* //starting our oscillators
* noise.start();
* osc.start();
*/
Tone.Merge = function(){

View file

@ -3,19 +3,29 @@ define(["Tone/core/Tone", "Tone/core/Master"], function(Tone){
"use strict";
/**
* @class Get the <a href="https://en.wikipedia.org/wiki/Root_mean_square" target="blank">RMS</a>
* of the input signal with some averaging. Can also get the raw value of the signal
* or the value in dB. inspired by
* <a href=" https://github.com/cwilso/volume-meter/blob/master/volume-meter.js" target="_blank">Chris Wilsons Volume Meter</a>
* @class Tone.Meter gets the <a href="https://en.wikipedia.org/wiki/Root_mean_square"
* target="blank">RMS</a> of an input signal with some averaging applied.
* It can also get the raw value of the signal or the value in dB. For signal
* processing, it's better to use Tone.Follower which will produce an audio-rate
* envelope follower instead of needing to poll the Meter to get the output.
* <br><br>
* Note that for signal processing, it's better to use Tone.Follower which will produce
* an audio-rate envelope follower instead of needing to poll the Meter to get the output.
* Meter was inspired by
* <a href=" https://github.com/cwilso/volume-meter/blob/master/volume-meter.js"
* target="_blank">Chris Wilsons Volume Meter</a>
*
* @constructor
* @extends {Tone}
* @param {number} [channels=1] number of channels being metered
* @param {number} [smoothing=0.8] amount of smoothing applied to the volume
* @param {number} [clipMemory=0.5] number in seconds that a "clip" should be remembered
* @example
* var meter = new Tone.Meter();
* var mic = new Tone.Microphone().start();
* //connect mic to the meter
* mic.connect(meter);
* //use getLevel or getDb
* //to access meter level
* meter.getLevel();
*/
Tone.Meter = function(channels, smoothing, clipMemory){
//extends Unit

View file

@ -3,8 +3,10 @@ define(["Tone/core/Tone", "Tone/component/Merge"], function(Tone){
"use strict";
/**
* @class Coerces the incoming mono or stereo signal into a mono signal
* where both left and right channels have the same value.
* @class Tone.Mono coerces the incoming mono or stereo signal into a mono signal
* where both left and right channels have the same value. This is useful
* for <a href="https://en.wikipedia.org/wiki/Stereo_imaging" target="_blank">
* stereo imaging</a>.
*
* @extends {Tone}
* @constructor

View file

@ -3,7 +3,7 @@ define(["Tone/core/Tone", "Tone/component/Panner", "Tone/component/Volume"], fun
"use strict";
/**
* @class A Tone.Panner and Tone.Volume in one.
* @class Tone.PanVol is a Tone.Panner and Tone.Volume in one.
*
* @extends {Tone}
* @constructor

View file

@ -5,7 +5,8 @@ function(Tone){
"use strict";
/**
* @class Equal power Left/Right Panner. Not 3D. Uses the StereoPannerNode when available.
* @class Tone.Panner is an equal power Left/Right Panner and does not
* support 3D. Panner uses the StereoPannerNode when available.
*
* @constructor
* @extends {Tone}

View file

@ -4,9 +4,10 @@ define(["Tone/core/Tone", "Tone/component/Envelope", "Tone/signal/Scale"],
"use strict";
/**
* @class An envelope which can be scaled to any range.
* Useful for applying an envelope to a frequency or
* any other non-NormalRange signal parameter.
* @class Tone.ScaledEnvelop is an envelope which can be scaled
* to any range. It's useful for applying an envelope
* to a frequency or any other non-NormalRange signal
* parameter.
*
* @extends {Tone.Envelope}
* @constructor

View file

@ -3,7 +3,7 @@ define(["Tone/core/Tone"], function(Tone){
"use strict";
/**
* @class Split the incoming signal into left and right channels.
* @class Tone.Split splits an incoming signal into left and right channels.
*
* @constructor
* @extends {Tone}

View file

@ -3,7 +3,7 @@ define(["Tone/core/Tone", "Tone/signal/Signal", "Tone/core/Master"], function(To
"use strict";
/**
* @class A simple volume node. Useful for creating a volume fader.
* @class Tone.Volume is a simple volume node, useful for creating a volume fader.
*
* @extends {Tone}
* @constructor