mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-15 08:17:07 +00:00
linting
This commit is contained in:
parent
c7006d584b
commit
dded291a25
47 changed files with 76 additions and 73 deletions
|
@ -33,6 +33,9 @@ module.exports = {
|
|||
"no-unneeded-ternary": [ "error" ],
|
||||
"object-curly-spacing": [ "error" , "always" ],
|
||||
"space-unary-ops": [ "error" , { "words" : true, "nonwords" : false } ],
|
||||
"block-spacing" : ["error", "always"],
|
||||
"keyword-spacing" : ["error", { "before": true }],
|
||||
"space-before-function-paren": ["error", "never"]
|
||||
// "one-var-declaration-per-line": [ "error" , "always" ],
|
||||
// "object-curly-newline": [ "error" , { "multiline": true }],
|
||||
// "array-bracket-newline": [ "error" , "always" ],
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/AudioNode", "Tone/shim/AnalyserNode"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/AudioNode", "Tone/shim/AnalyserNode"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ define(["Tone/core/Tone", "Tone/signal/Signal",
|
|||
this._sig.linearRampTo(0, release, time);
|
||||
} else if (this._releaseCurve === "exponential"){
|
||||
this._sig.targetRampTo(0, release, time);
|
||||
} else{
|
||||
} else {
|
||||
var curve = this._releaseCurve;
|
||||
if (Tone.isArray(curve)){
|
||||
this._sig.cancelAndHoldAtTime(time);
|
||||
|
@ -328,7 +328,7 @@ define(["Tone/core/Tone", "Tone/signal/Signal",
|
|||
* @param {Time} after
|
||||
* @returns {Tone.Envelope} this
|
||||
*/
|
||||
Tone.Envelope.prototype.cancel = function (after) {
|
||||
Tone.Envelope.prototype.cancel = function(after) {
|
||||
this._sig.cancelScheduledValues(after);
|
||||
return this;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/component/Analyser", "Tone/core/AudioNode"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/component/Analyser", "Tone/core/AudioNode"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Get the current waveform data of the connected audio source.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Gain", "Tone/core/AudioNode"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Gain", "Tone/core/AudioNode"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.Solo lets you isolate a specific audio stream. When
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/component/Analyser", "Tone/core/AudioNode"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/component/Analyser", "Tone/core/AudioNode"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Get the current waveform data of the connected audio source.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/type/Type"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/type/Type"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone"], function (Tone) {
|
||||
define(["Tone/core/Tone"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone"], function (Tone) {
|
||||
define(["Tone/core/Tone"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -251,7 +251,7 @@ define(["Tone/core/Tone"], function (Tone) {
|
|||
for (var i = 0; i < this.values.length; i++){
|
||||
copy[i] = i;
|
||||
}
|
||||
while(copy.length > 0){
|
||||
while (copy.length > 0){
|
||||
var randVal = copy.splice(Math.floor(copy.length * Math.random()), 1);
|
||||
this._shuffled.push(randVal[0]);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/type/Type"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/type/Type"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Context"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Context"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.AudioNode is the base class for classes which process audio.
|
||||
|
@ -179,7 +179,7 @@ define(["Tone/core/Tone", "Tone/core/Context"], function (Tone) {
|
|||
* Dispose and disconnect
|
||||
* @return {Tone.AudioNode} this
|
||||
*/
|
||||
Tone.AudioNode.prototype.dispose = function () {
|
||||
Tone.AudioNode.prototype.dispose = function() {
|
||||
if (!Tone.isUndef(this.input)){
|
||||
if (this.input instanceof AudioNode){
|
||||
this.input.disconnect();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Buffer"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Buffer"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class A data structure for holding multiple buffers.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
define(["Tone/core/Tone", "Tone/signal/TickSignal", "Tone/core/TimelineState",
|
||||
"Tone/core/Emitter", "Tone/core/Context"], function (Tone) {
|
||||
"Tone/core/Emitter", "Tone/core/Context"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -257,7 +257,7 @@ define(["Tone/core/Tone", "Tone/signal/TickSignal", "Tone/core/TimelineState",
|
|||
//state change events
|
||||
if (event.state !== this._lastState){
|
||||
this._lastState = event.state;
|
||||
switch(event.state){
|
||||
switch (event.state){
|
||||
case Tone.State.Started:
|
||||
this._ticks = event.offset;
|
||||
this._nextTick = event.time;
|
||||
|
@ -274,7 +274,7 @@ define(["Tone/core/Tone", "Tone/signal/TickSignal", "Tone/core/TimelineState",
|
|||
}
|
||||
|
||||
//all the tick events
|
||||
while(endTime > this._nextTick && this._state){
|
||||
while (endTime > this._nextTick && this._state){
|
||||
var tickTime = this._nextTick;
|
||||
if (this.frequency){
|
||||
this._nextTick += this.frequency.getDurationOfTicks(1, this._nextTick);
|
||||
|
@ -282,7 +282,7 @@ define(["Tone/core/Tone", "Tone/signal/TickSignal", "Tone/core/TimelineState",
|
|||
try {
|
||||
this.callback(tickTime);
|
||||
this._ticks++;
|
||||
} catch(e){
|
||||
} catch (e){
|
||||
this._ticks++;
|
||||
throw e;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Emitter", "Tone/core/Timeline", "Tone/shim/AudioContext"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Emitter", "Tone/core/Timeline", "Tone/shim/AudioContext"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Wrapper around the native AudioContext.
|
||||
|
@ -192,7 +192,7 @@ define(["Tone/core/Tone", "Tone/core/Emitter", "Tone/core/Timeline", "Tone/shim/
|
|||
*/
|
||||
Tone.Context.prototype._timeoutLoop = function(){
|
||||
var now = this.now();
|
||||
while(this._timeouts && this._timeouts.length && this._timeouts.peek().time <= now){
|
||||
while (this._timeouts && this._timeouts.length && this._timeouts.peek().time <= now){
|
||||
this._timeouts.shift().callback();
|
||||
}
|
||||
};
|
||||
|
@ -286,7 +286,7 @@ define(["Tone/core/Tone", "Tone/core/Emitter", "Tone/core/Timeline", "Tone/shim/
|
|||
var lookAhead = hint;
|
||||
this._latencyHint = hint;
|
||||
if (Tone.isString(hint)){
|
||||
switch(hint){
|
||||
switch (hint){
|
||||
case "interactive" :
|
||||
lookAhead = 0.1;
|
||||
this._context.latencyHint = hint;
|
||||
|
@ -322,7 +322,7 @@ define(["Tone/core/Tone", "Tone/core/Emitter", "Tone/core/Timeline", "Tone/shim/
|
|||
this._ticker = null;
|
||||
this._timeouts.dispose();
|
||||
this._timeouts = null;
|
||||
for(var con in this._constants){
|
||||
for (var con in this._constants){
|
||||
this._constants[con].disconnect();
|
||||
}
|
||||
this._constants = null;
|
||||
|
@ -425,7 +425,7 @@ define(["Tone/core/Tone", "Tone/core/Emitter", "Tone/core/Timeline", "Tone/shim/
|
|||
if (this._type === Ticker.Type.Worker){
|
||||
try {
|
||||
this._createWorker();
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
// workers not supported, fallback to timeout
|
||||
this._type = Ticker.Type.Timeout;
|
||||
this._createClock();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Param", "Tone/core/AudioNode"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Param", "Tone/core/AudioNode"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Timeline"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Timeline"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -94,7 +94,7 @@ define(["Tone/core/Tone", "Tone/core/Timeline"], function (Tone) {
|
|||
*/
|
||||
Tone.Draw.prototype._drawLoop = function(){
|
||||
var now = Tone.now();
|
||||
while(this._events.length && this._events.peek().time - this.anticipation <= now){
|
||||
while (this._events.length && this._events.peek().time - this.anticipation <= now){
|
||||
var event = this._events.shift();
|
||||
if (now - event.time <= this.expiration){
|
||||
event.callback();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone"], function (Tone) {
|
||||
define(["Tone/core/Tone"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Param", "Tone/type/Type", "Tone/core/AudioNode"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Param", "Tone/type/Type", "Tone/core/AudioNode"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/type/Type"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/type/Type"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -216,10 +216,10 @@ define(["Tone/core/Tone", "Tone/type/Type"], function (Tone) {
|
|||
if (parent !== null){
|
||||
if (isLeftChild){
|
||||
parent.left = pivotNode;
|
||||
} else{
|
||||
} else {
|
||||
parent.right = pivotNode;
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
this._setRoot(pivotNode);
|
||||
}
|
||||
};
|
||||
|
@ -241,10 +241,10 @@ define(["Tone/core/Tone", "Tone/type/Type"], function (Tone) {
|
|||
if (parent !== null){
|
||||
if (isLeftChild){
|
||||
parent.left = pivotNode;
|
||||
} else{
|
||||
} else {
|
||||
parent.right = pivotNode;
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
this._setRoot(pivotNode);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Transport", "Tone/core/Buffer", "Tone/core/OfflineContext"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Transport", "Tone/core/Buffer", "Tone/core/OfflineContext"], function(Tone) {
|
||||
|
||||
/**
|
||||
* Generate a buffer by rendering all of the Tone.js code within the callback using the OfflineAudioContext.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Context", "Tone/shim/OfflineAudioContext"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Context", "Tone/shim/OfflineAudioContext"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Wrapper around the OfflineAudioContext
|
||||
|
@ -54,7 +54,7 @@ define(["Tone/core/Tone", "Tone/core/Context", "Tone/shim/OfflineAudioContext"],
|
|||
* @return {Promise}
|
||||
*/
|
||||
Tone.OfflineContext.prototype.render = function(){
|
||||
while(this._duration - this._currentTime >= 0){
|
||||
while (this._duration - this._currentTime >= 0){
|
||||
//invoke all the callbacks on that time
|
||||
this.emit("tick");
|
||||
//increment the clock
|
||||
|
|
|
@ -135,7 +135,7 @@ define(["Tone/core/Tone", "Tone/type/Type", "Tone/core/AudioNode", "Tone/core/Ti
|
|||
*/
|
||||
Tone.Param.prototype._fromUnits = function(val){
|
||||
if (this.convert || Tone.isUndef(this.convert)){
|
||||
switch(this.units){
|
||||
switch (this.units){
|
||||
case Tone.Type.Time:
|
||||
return this.toSeconds(val);
|
||||
case Tone.Type.Frequency:
|
||||
|
@ -164,7 +164,7 @@ define(["Tone/core/Tone", "Tone/type/Type", "Tone/core/AudioNode", "Tone/core/Ti
|
|||
*/
|
||||
Tone.Param.prototype._toUnits = function(val){
|
||||
if (this.convert || Tone.isUndef(this.convert)){
|
||||
switch(this.units){
|
||||
switch (this.units){
|
||||
case Tone.Type.Decibels:
|
||||
return Tone.gainToDb(val);
|
||||
default:
|
||||
|
@ -448,7 +448,7 @@ define(["Tone/core/Tone", "Tone/type/Type", "Tone/core/AudioNode", "Tone/core/Ti
|
|||
* @param {NormalRange} [scaling=1] If the values in the curve should be scaled by some value
|
||||
* @returns {Tone.Param} this
|
||||
*/
|
||||
Tone.Param.prototype.setValueCurveAtTime = function (values, startTime, duration, scaling) {
|
||||
Tone.Param.prototype.setValueCurveAtTime = function(values, startTime, duration, scaling) {
|
||||
scaling = Tone.defaultArg(scaling, 1);
|
||||
duration = this.toSeconds(duration);
|
||||
startTime = this.toSeconds(startTime);
|
||||
|
@ -570,17 +570,17 @@ define(["Tone/core/Tone", "Tone/type/Type", "Tone/core/AudioNode", "Tone/core/Ti
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Calculates the the value along the curve produced by setTargetAtTime
|
||||
Tone.Param.prototype._exponentialApproach = function (t0, v0, v1, timeConstant, t) {
|
||||
Tone.Param.prototype._exponentialApproach = function(t0, v0, v1, timeConstant, t) {
|
||||
return v1 + (v0 - v1) * Math.exp(-(t - t0) / timeConstant);
|
||||
};
|
||||
|
||||
// Calculates the the value along the curve produced by linearRampToValueAtTime
|
||||
Tone.Param.prototype._linearInterpolate = function (t0, v0, t1, v1, t) {
|
||||
Tone.Param.prototype._linearInterpolate = function(t0, v0, t1, v1, t) {
|
||||
return v0 + (v1 - v0) * ((t - t0) / (t1 - t0));
|
||||
};
|
||||
|
||||
// Calculates the the value along the curve produced by exponentialRampToValueAtTime
|
||||
Tone.Param.prototype._exponentialInterpolate = function (t0, v0, t1, v1, t) {
|
||||
Tone.Param.prototype._exponentialInterpolate = function(t0, v0, t1, v1, t) {
|
||||
return v0 * Math.pow(v1 / v0, (t - t0) / (t1 - t0));
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone"], function (Tone) {
|
||||
define(["Tone/core/Tone"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Timeline", "Tone/type/Type"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Timeline", "Tone/type/Type"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
define(["Tone/core/Tone", "Tone/component/LFO", "Tone/component/CrossFade",
|
||||
"Tone/signal/Signal", "Tone/effect/FeedbackEffect", "Tone/core/Delay"], function (Tone) {
|
||||
"Tone/signal/Signal", "Tone/effect/FeedbackEffect", "Tone/core/Delay"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/effect/Effect", "Tone/core/Delay", "Tone/component/LFO"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/effect/Effect", "Tone/core/Delay", "Tone/component/LFO"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Transport", "Tone/type/Type", "Tone/core/TimelineState"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Transport", "Tone/type/Type", "Tone/core/TimelineState"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/event/Event"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/event/Event"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.Loop creates a looped callback at the
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/event/Event", "Tone/type/Type", "Tone/core/Transport"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/event/Event", "Tone/type/Type", "Tone/core/Transport"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/event/Loop", "Tone/control/CtrlPattern"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/event/Loop", "Tone/control/CtrlPattern"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.Pattern arpeggiates between the given notes
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/event/Part", "Tone/core/Transport"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/event/Part", "Tone/core/Transport"], function(Tone) {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
define(["Tone/core/Tone", "Tone/instrument/Instrument", "Tone/source/FMOscillator", "Tone/component/Filter",
|
||||
"Tone/component/FrequencyEnvelope", "Tone/component/AmplitudeEnvelope", "Tone/core/Gain",
|
||||
"Tone/signal/Scale", "Tone/signal/Multiply"], function (Tone) {
|
||||
"Tone/signal/Scale", "Tone/signal/Multiply"], function(Tone) {
|
||||
|
||||
/**
|
||||
* Inharmonic ratio of frequencies based on the Roland TR-808
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/instrument/Instrument", "Tone/core/Buffers", "Tone/source/BufferSource"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/instrument/Instrument", "Tone/core/Buffers", "Tone/source/BufferSource"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Automatically interpolates between a set of pitched samples. Pass in an object which maps the note's pitch or midi value to the url, then you can trigger the attack and release of that note like other instruments. By automatically repitching the samples, it is possible to play pitches which were not explicitly included which can save loading time.
|
||||
|
@ -92,7 +92,7 @@ define(["Tone/core/Tone", "Tone/instrument/Instrument", "Tone/core/Buffers", "To
|
|||
Tone.Sampler.prototype._findClosest = function(midi){
|
||||
var MAX_INTERVAL = 24;
|
||||
var interval = 0;
|
||||
while(interval < MAX_INTERVAL){
|
||||
while (interval < MAX_INTERVAL){
|
||||
// check above and below
|
||||
if (this._buffers.has(midi + interval)){
|
||||
return -interval;
|
||||
|
@ -163,7 +163,7 @@ define(["Tone/core/Tone", "Tone/instrument/Instrument", "Tone/core/Buffers", "To
|
|||
time = this.toSeconds(time);
|
||||
for (var note in this._activeSources){
|
||||
var sources = this._activeSources[note];
|
||||
while(sources.length){
|
||||
while (sources.length){
|
||||
var source = sources.shift().source;
|
||||
source.stop(time + this.release, this.release);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ define(["Tone/core/Tone"], function(Tone){
|
|||
* @private
|
||||
*/
|
||||
if (Tone.supported){
|
||||
if(!AudioBuffer.prototype.copyToChannel){
|
||||
if (!AudioBuffer.prototype.copyToChannel){
|
||||
AudioBuffer.prototype.copyToChannel = function(src, chanNum, start){
|
||||
var channel = this.getChannelData(chanNum);
|
||||
start = start || 0;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/signal/Signal"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/signal/Signal"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.TickSignal extends Tone.Signal, but adds the capability
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Transport", "Tone/signal/Signal", "Tone/type/TransportTime"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Transport", "Tone/signal/Signal", "Tone/type/TransportTime"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.TransportTimelineSignal extends Tone.Signal, but adds the ability to synchronize the signal to the signal to the Tone.Transport
|
||||
|
@ -158,7 +158,7 @@ define(["Tone/core/Tone", "Tone/core/Transport", "Tone/signal/Signal", "Tone/typ
|
|||
* @param {NormalRange} [scaling=1] If the values in the curve should be scaled by some value
|
||||
* @returns {Tone.Signal} this
|
||||
*/
|
||||
Tone.TransportTimelineSignal.prototype.setValueCurveAtTime = function (values, startTime, duration, scaling) {
|
||||
Tone.TransportTimelineSignal.prototype.setValueCurveAtTime = function(values, startTime, duration, scaling) {
|
||||
startTime = Tone.TransportTime(startTime);
|
||||
duration = Tone.TransportTime(duration);
|
||||
Tone.Signal.prototype.setValueCurveAtTime.call(this, values, startTime, duration, scaling);
|
||||
|
@ -171,7 +171,7 @@ define(["Tone/core/Tone", "Tone/core/Transport", "Tone/signal/Signal", "Tone/typ
|
|||
* @param {Time} time
|
||||
* @returns {Tone.TransportTimelineSignal} this
|
||||
*/
|
||||
Tone.TransportTimelineSignal.prototype.cancelAndHoldAtTime = function (time) {
|
||||
Tone.TransportTimelineSignal.prototype.cancelAndHoldAtTime = function(time) {
|
||||
return Tone.Signal.prototype.cancelAndHoldAtTime.call(this, Tone.TransportTime(time));
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Gain", "Tone/signal/SignalBase"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/core/Gain", "Tone/signal/SignalBase"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.Zero outputs 0's at audio-rate. The reason this has to be
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
define(["Tone/core/Tone", "Tone/core/Buffer", "Tone/source/Source", "Tone/core/Gain",
|
||||
"Tone/core/AudioNode"], function (Tone) {
|
||||
"Tone/core/AudioNode"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Wrapper around the native BufferSourceNode.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/source/Source", "Tone/core/Buffer", "Tone/source/BufferSource"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/source/Source", "Tone/core/Buffer", "Tone/source/BufferSource"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.GrainPlayer implements [granular synthesis](https://en.wikipedia.org/wiki/Granular_synthesis).
|
||||
|
|
|
@ -135,7 +135,7 @@ define(["Tone/core/Tone", "Tone/component/Volume", "Tone/core/AudioNode"], funct
|
|||
* @return {Tone.UserMedia} this
|
||||
*/
|
||||
Tone.UserMedia.prototype.close = function(){
|
||||
if(this._stream){
|
||||
if (this._stream){
|
||||
this._stream.getAudioTracks().forEach(function(track){
|
||||
track.stop();
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/type/TimeBase"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/type/TimeBase"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.Frequency is a primitive type for encoding Frequency values.
|
||||
|
@ -124,7 +124,7 @@ define(["Tone/core/Tone", "Tone/type/TimeBase"], function (Tone) {
|
|||
var log = Math.log2(freq / Tone.Frequency.A4);
|
||||
var noteNumber = Math.round(12 * log) + 57;
|
||||
var octave = Math.floor(noteNumber/12);
|
||||
if(octave < 0){
|
||||
if (octave < 0){
|
||||
noteNumber += -12 * octave;
|
||||
}
|
||||
var noteName = scaleIndexToNote[noteNumber % 12];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/type/Frequency"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/type/Frequency"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.Midi is a primitive type for encoding Time values.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/type/TransportTime"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/type/TransportTime"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.Ticks is a primitive type for encoding Time values.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/type/TimeBase", "Tone/type/Frequency"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/type/TimeBase", "Tone/type/Frequency"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.Time is a primitive type for encoding Time values.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone"], function (Tone) {
|
||||
define(["Tone/core/Tone"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.TimeBase is a flexible encoding of time
|
||||
|
@ -41,7 +41,7 @@ define(["Tone/core/Tone"], function (Tone) {
|
|||
this._val = val._val;
|
||||
this._units = val._units;
|
||||
} else if (val instanceof Tone.TimeBase){
|
||||
switch(this._defaultUnits){
|
||||
switch (this._defaultUnits){
|
||||
case "s" :
|
||||
this._val = val.toSeconds();
|
||||
break;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/type/Time"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/type/Time"], function(Tone) {
|
||||
|
||||
/**
|
||||
* @class Tone.TransportTime is a the time along the Transport's
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(["Tone/core/Tone", "Tone/type/Time", "Tone/type/Frequency", "Tone/type/TransportTime", "Tone/core/Context"], function (Tone) {
|
||||
define(["Tone/core/Tone", "Tone/type/Time", "Tone/type/Frequency", "Tone/type/TransportTime", "Tone/core/Context"], function(Tone) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// TYPES
|
||||
|
|
Loading…
Reference in a new issue