This commit is contained in:
Yotam Mann 2015-12-08 00:07:16 -05:00
parent ea70dde445
commit cfc33cf39c
7 changed files with 34 additions and 18 deletions

View file

@ -241,11 +241,11 @@ function(Tone){
/** /**
* Schedule an event along the timeline. * Schedule an event along the timeline.
* @param {TimelineEvent} event * @param {Function} callback The callback to be invoked at the time.
* @param {Time} time * @param {Time} time The time to invoke the callback at.
* @return {Number} The id of the event which can be used for canceling the event. * @return {Number} The id of the event which can be used for canceling the event.
* @example * @example
* //trigger the callback when the Transport reaches the desired time * //trigger the callback when the Transport reaches the desired time
* Tone.Transport.schedule(function(time){ * Tone.Transport.schedule(function(time){
* envelope.triggerAttack(time); * envelope.triggerAttack(time);
* }, "128i"); * }, "128i");
@ -748,6 +748,7 @@ function(Tone){
* Tone.Transport.setInterval(function(time){ * Tone.Transport.setInterval(function(time){
* envelope.triggerAttack(time); * envelope.triggerAttack(time);
* }, "8n"); * }, "8n");
* @private
*/ */
Tone.Transport.prototype.setInterval = function(callback, interval){ Tone.Transport.prototype.setInterval = function(callback, interval){
console.warn("This method is deprecated. Use Tone.Transport.scheduleRepeat instead."); console.warn("This method is deprecated. Use Tone.Transport.scheduleRepeat instead.");
@ -760,6 +761,7 @@ function(Tone){
* @param {number} intervalID The ID of interval to remove. The interval * @param {number} intervalID The ID of interval to remove. The interval
* ID is given as the return value in Tone.Transport.setInterval. * ID is given as the return value in Tone.Transport.setInterval.
* @return {boolean} true if the event was removed * @return {boolean} true if the event was removed
* @private
*/ */
Tone.Transport.prototype.clearInterval = function(id){ Tone.Transport.prototype.clearInterval = function(id){
console.warn("This method is deprecated. Use Tone.Transport.clear instead."); console.warn("This method is deprecated. Use Tone.Transport.clear instead.");
@ -780,6 +782,7 @@ function(Tone){
* Tone.Transport.setTimeout(function(time){ * Tone.Transport.setTimeout(function(time){
* player.start(time); * player.start(time);
* }, 1) * }, 1)
* @private
*/ */
Tone.Transport.prototype.setTimeout = function(callback, timeout){ Tone.Transport.prototype.setTimeout = function(callback, timeout){
console.warn("This method is deprecated. Use Tone.Transport.scheduleOnce instead."); console.warn("This method is deprecated. Use Tone.Transport.scheduleOnce instead.");
@ -792,6 +795,7 @@ function(Tone){
* @param {number} intervalID The ID of timeout to remove. The timeout * @param {number} intervalID The ID of timeout to remove. The timeout
* ID is given as the return value in Tone.Transport.setTimeout. * ID is given as the return value in Tone.Transport.setTimeout.
* @return {boolean} true if the timeout was removed * @return {boolean} true if the timeout was removed
* @private
*/ */
Tone.Transport.prototype.clearTimeout = function(id){ Tone.Transport.prototype.clearTimeout = function(id){
console.warn("This method is deprecated. Use Tone.Transport.clear instead."); console.warn("This method is deprecated. Use Tone.Transport.clear instead.");
@ -812,6 +816,7 @@ function(Tone){
* Tone.Transport.setTimeline(function(time){ * Tone.Transport.setTimeline(function(time){
* part.start(time); * part.start(time);
* }, "16m"); * }, "16m");
* @private
*/ */
Tone.Transport.prototype.setTimeline = function(callback, time){ Tone.Transport.prototype.setTimeline = function(callback, time){
console.warn("This method is deprecated. Use Tone.Transport.schedule instead."); console.warn("This method is deprecated. Use Tone.Transport.schedule instead.");
@ -823,6 +828,7 @@ function(Tone){
* Clear the timeline event. * Clear the timeline event.
* @param {number} id * @param {number} id
* @return {boolean} true if it was removed * @return {boolean} true if it was removed
* @private
*/ */
Tone.Transport.prototype.clearTimeline = function(id){ Tone.Transport.prototype.clearTimeline = function(id){
console.warn("This method is deprecated. Use Tone.Transport.clear instead."); console.warn("This method is deprecated. Use Tone.Transport.clear instead.");

View file

@ -74,7 +74,7 @@ define(["Tone/core/Tone"], function (Tone) {
*/ */
BPM : "bpm", BPM : "bpm",
/** /**
* The value must be greater than 0. * The value must be greater than or equal to 0.
* @typedef {Positive} * @typedef {Positive}
*/ */
Positive : "positive", Positive : "positive",

View file

@ -8,8 +8,8 @@ define(["Tone/core/Tone", "Tone/component/LFO", "Tone/effect/StereoEffect"], fun
* *
* @extends {Tone.StereoEffect} * @extends {Tone.StereoEffect}
* @constructor * @constructor
* @param {Frequency|Object} [frequency] The rate of the effect. * @param {Frequency} [frequency] The rate of the effect.
* @param {NormalRange} [depth] The depth of the wavering. * @param {NormalRange} [depth] The depth of the effect.
* @example * @example
* //create a tremolo and start it's LFO * //create a tremolo and start it's LFO
* var tremolo = new Tone.Tremolo(9, 0.75).toMaster().start(); * var tremolo = new Tone.Tremolo(9, 0.75).toMaster().start();
@ -143,7 +143,7 @@ define(["Tone/core/Tone", "Tone/component/LFO", "Tone/effect/StereoEffect"], fun
}; };
/** /**
* Type of oscillator attached to the Tremolo. * The Tremolo's oscillator type.
* @memberOf Tone.Tremolo# * @memberOf Tone.Tremolo#
* @type {string} * @type {string}
* @name type * @name type

View file

@ -86,6 +86,9 @@ define(["Tone/core/Tone", "Tone/core/Transport", "Tone/core/Type", "Tone/core/Ti
* The probability that the callback will be invoked * The probability that the callback will be invoked
* at the scheduled time. * at the scheduled time.
* @type {NormalRange} * @type {NormalRange}
* @example
* //the callback will be invoked 50% of the time
* event.probability = 0.5;
*/ */
this.probability = options.probability; this.probability = options.probability;
@ -361,8 +364,8 @@ define(["Tone/core/Tone", "Tone/core/Transport", "Tone/core/Type", "Tone/core/Ti
/** /**
* The current progress of the loop interval. * The current progress of the loop interval.
* Returns 0 if the atom is not started yet or the * Returns 0 if the event is not started yet or
* atom is not set to loop. * it is not set to loop.
* @memberOf Tone.Event# * @memberOf Tone.Event#
* @type {NormalRange} * @type {NormalRange}
* @name progress * @name progress

View file

@ -69,7 +69,7 @@ define(["Tone/core/Tone", "Tone/event/Event"], function (Tone) {
}; };
/** /**
* Stop the arpeggio at the given time. * Stop the loop at the given time.
* @param {Time=} time When to stop the Arpeggio * @param {Time=} time When to stop the Arpeggio
* @return {Tone.Loop} this * @return {Tone.Loop} this
*/ */

View file

@ -16,9 +16,9 @@ define(["Tone/core/Tone", "Tone/event/Event", "Tone/core/Type", "Tone/core/Trans
* synth.triggerAttackRelease(note, "8n", time); * synth.triggerAttackRelease(note, "8n", time);
* }, [[0, "C2"], ["0:2", "C3"], ["0:3:2", "G2"]]); * }, [[0, "C2"], ["0:2", "C3"], ["0:3:2", "G2"]]);
* @example * @example
* //use JSON as long as the object has a "time" attribute * //use an array of objects as long as the object has a "time" attribute
* var part = new Tone.Part(function(time, value){ * var part = new Tone.Part(function(time, value){
* //the value is an object which contains both the ntoe and the velocity * //the value is an object which contains both the note and the velocity
* synth.triggerAttackRelease(value.note, "8n", time, value.velocity); * synth.triggerAttackRelease(value.note, "8n", time, value.velocity);
* }, [{"time" : 0, "note" : "C3", "velocity": 0.9}, * }, [{"time" : 0, "note" : "C3", "velocity": 0.9},
* {"time" : "0:2", "note" : "C4", "velocity": 0.5} * {"time" : "0:2", "note" : "C4", "velocity": 0.5}
@ -259,7 +259,7 @@ define(["Tone/core/Tone", "Tone/event/Event", "Tone/core/Type", "Tone/core/Trans
}; };
/** /**
* Add a note or part to the part. * Add a an event to the part.
* @param {Time} time The time the note should start. * @param {Time} time The time the note should start.
* If an object is passed in, it should * If an object is passed in, it should
* have a 'time' attribute and the rest * have a 'time' attribute and the rest
@ -321,7 +321,7 @@ define(["Tone/core/Tone", "Tone/event/Event", "Tone/core/Type", "Tone/core/Trans
/** /**
* Remove an event from the part. Will recursively iterate * Remove an event from the part. Will recursively iterate
* into the sub-parts to find the event * into nested parts to find the event.
* @param {Time} time The time of the event * @param {Time} time The time of the event
* @param {*} value Optionally select only a specific event value * @param {*} value Optionally select only a specific event value
*/ */
@ -455,6 +455,7 @@ define(["Tone/core/Tone", "Tone/event/Event", "Tone/core/Type", "Tone/core/Trans
* @example * @example
* event.humanize = true; * event.humanize = true;
* @type {Boolean|Time} * @type {Boolean|Time}
* @name humanize
*/ */
Object.defineProperty(Tone.Part.prototype, "humanize", { Object.defineProperty(Tone.Part.prototype, "humanize", {
get : function(){ get : function(){

View file

@ -6,11 +6,12 @@ define(["Tone/core/Tone", "Tone/event/Part", "Tone/core/Transport"], function (T
* @class A sequence is an alternate notation of a part. Instead * @class A sequence is an alternate notation of a part. Instead
* of passing in an array of [time, event] pairs, pass * of passing in an array of [time, event] pairs, pass
* in an array of events which will be spaced at the * in an array of events which will be spaced at the
* given subdivision. Subdivisions are given * given subdivision. Sub-arrays will subdivide that beat
* as sub arrays and will be devided according to how many items are in the array. * by the number of items are in the array.
* Sequence notation inspiration from [Tidal](http://yaxu.org/tidal/) * Sequence notation inspiration from [Tidal](http://yaxu.org/tidal/)
* @param {Function} callback The callback to invoke with every note * @param {Function} callback The callback to invoke with every note
* @param {Array} events The sequence * @param {Array} events The sequence
* @param {Time} subdivision The subdivision between which events are placed.
* @extends {Tone.Part} * @extends {Tone.Part}
* @example * @example
* var seq = new Tone.Sequence(function(time, note){ * var seq = new Tone.Sequence(function(time, note){
@ -81,12 +82,17 @@ define(["Tone/core/Tone", "Tone/event/Part", "Tone/core/Transport"], function (T
}); });
/** /**
* Get/Set an index of the sequence * Get/Set an index of the sequence. If the index contains a subarray,
* a Tone.Sequence representing that sub-array will be returned.
* @example * @example
* var sequence = new Tone.Sequence(playNote, ["E4", "C4", "F#4", "A4"]) * var sequence = new Tone.Sequence(playNote, ["E4", "C4", "F#4", ["A4", "Bb3"]])
* sequence.at(0)// => returns "E4" * sequence.at(0)// => returns "E4"
* //set a value * //set a value
* sequence.at(0, "G3"); * sequence.at(0, "G3");
* //get a nested sequence
* sequence.at(3).at(1)// => returns "Bb3"
* @param {Positive} index The index to get or set
* @param {*} value Optionally pass in the value to set at the given index.
*/ */
Tone.Sequence.prototype.at = function(index, value){ Tone.Sequence.prototype.at = function(index, value){
//if the value is an array, //if the value is an array,