Skip to content

Commit c7228ed

Browse files
committed
Merge branch 'dev'
2 parents 4d4065b + 36bfba6 commit c7228ed

File tree

129 files changed

+7128
-1841
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+7128
-1841
lines changed

.travis.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
language: node_js
2-
node_js:
3-
- "4.1"
4-
before_install:
5-
- export CHROME_BIN=chromium-browser
6-
- export DISPLAY=:99.0
7-
- sh -e /etc/init.d/xvfb start
1+
sudo: required
2+
dist: trusty
3+
language: node_js
4+
node_js:
5+
- "4.2"
6+
7+
before_install:
8+
- export CHROME_BIN=/usr/bin/google-chrome
9+
- export DISPLAY=:99.0
10+
- sh -e /etc/init.d/xvfb start
11+
- sudo apt-get update
12+
- sudo apt-get install -y libappindicator1 fonts-liberation
13+
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
14+
- sudo dpkg -i google-chrome*.deb
815
before_script:
916
- cd gulp
1017
- npm install -g karma

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
### r8
2+
3+
* Transport.seconds returns the progress in seconds.
4+
* Buffer.from/toArray, Float32Array <-> Buffer conversions
5+
* Buffer.slice(start, end) slices and returns a subsection of the Buffer
6+
* Source.sync now syncs all subsequent calls to `start` and `stop` to the TransportTime instead of the AudioContext time.
7+
* e.g. source.sync().start(0).stop(0.8); //plays source between 0 and 0.8 of the Transport
8+
* Transport.on("start" / "stop") callbacks are invoked just before the event.
9+
* Param can accept an LFO description in the constructor or .value
10+
* e.g. param.value = {min : 10, max : 20, frequency : 0.4}
11+
* Time.TimeBase has clone/copy methods.
12+
* Tone.Buffer.prototype.load returns Promise
13+
* Using Tone.Delay and Tone.Gain everywhere
14+
* Patch for Chrome 53+ issue of not correctly scheduling AudioParams with setValueAtTime
15+
* Panner3D and Tone.Listener wrap native PannerNode and AudioListener to give 3D panning ability.
16+
17+
118
### r7
219

320
* MetalSynth creates metalic, cymbal sounds

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Tone.js is a Web Audio framework for creating interactive music in the browser.
3232
* [MsCompose 95 - Autotel](http://autotel.co/mscompose95/)
3333
* [Pedalboard - Micha Hanselmann](https://deermichel.github.io/pedalboard/)
3434
* [Keyboard Boogie - Douglas Tarr](http://douglastarr.com/keyboard-boogie)
35+
* [Reflect - Sydneyzh](http://reflect.sydneyzh.com/)
36+
* [Anxiety - Eve Weinberg, Aaron Montoya-Moraga](http://anxietybrain.net/)
37+
* [Ramsophone - Robert Vinluan](http://robertvinluan.com/Ramsophone/)
3538

3639
Using Tone.js? I'd love to hear it: [email protected]
3740

@@ -150,7 +153,7 @@ synth.connect(distortion);
150153

151154
# Sources
152155

153-
Tone has a few basic audio sources like [Tone.Oscillator](https://tonejs.github.io/docs/#Oscillator) which has sine, square, triangle, and sawtooth waveforms, a buffer player ([Tone.Player](https://tonejs.github.io/docs/#Player)), a noise generator ([Tone.Noise]((https://tonejs.github.io/docs/#Noise))), two additional oscillator types ([pwm](https://tonejs.github.io/docs/#PWMOscillator), [pulse](https://tonejs.github.io/docs/#PulseOscillator)) and [external audio input](https://tonejs.github.io/docs/#Microphone) (when [WebRTC is supported](http://caniuse.com/#feat=stream)).
156+
Tone has a few basic audio sources like [Tone.Oscillator](https://tonejs.github.io/docs/#Oscillator) which has sine, square, triangle, and sawtooth waveforms, a buffer player ([Tone.Player](https://tonejs.github.io/docs/#Player)), a noise generator ([Tone.Noise](https://tonejs.github.io/docs/#Noise)), a few additional oscillator types ([pwm](https://tonejs.github.io/docs/#PWMOscillator), [pulse](https://tonejs.github.io/docs/#PulseOscillator), [fat](https://tonejs.github.io/docs/#FatOscillator), [fm](https://tonejs.github.io/docs/#FMOscillator)) and [external audio input](https://tonejs.github.io/docs/#Microphone) (when [WebRTC is supported](http://caniuse.com/#feat=stream)).
154157

155158
```javascript
156159
//a pwm oscillator which is connected to the speaker and started right away

Tone/component/CrossFade.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
define(["Tone/core/Tone", "Tone/signal/Signal", "Tone/signal/Expr", "Tone/signal/EqualPowerGain"], function(Tone){
1+
define(["Tone/core/Tone", "Tone/signal/Signal", "Tone/signal/Expr",
2+
"Tone/signal/EqualPowerGain", "Tone/core/Gain"], function(Tone){
23

34
"use strict";
45

@@ -26,19 +27,19 @@ define(["Tone/core/Tone", "Tone/signal/Signal", "Tone/signal/Expr", "Tone/signal
2627
*/
2728
Tone.CrossFade = function(initialFade){
2829

29-
Tone.call(this, 2, 1);
30+
this.createInsOuts(2, 1);
3031

3132
/**
3233
* Alias for <code>input[0]</code>.
33-
* @type {GainNode}
34+
* @type {Tone.Gain}
3435
*/
35-
this.a = this.input[0] = this.context.createGain();
36+
this.a = this.input[0] = new Tone.Gain();
3637

3738
/**
3839
* Alias for <code>input[1]</code>.
39-
* @type {GainNode}
40+
* @type {Tone.Gain}
4041
*/
41-
this.b = this.input[1] = this.context.createGain();
42+
this.b = this.input[1] = new Tone.Gain();
4243

4344
/**
4445
* The mix between the two inputs. A fade value of 0
@@ -95,9 +96,9 @@ define(["Tone/core/Tone", "Tone/signal/Signal", "Tone/signal/Expr", "Tone/signal
9596
this.fade = null;
9697
this._invert.dispose();
9798
this._invert = null;
98-
this.a.disconnect();
99+
this.a.dispose();
99100
this.a = null;
100-
this.b.disconnect();
101+
this.b.dispose();
101102
this.b = null;
102103
return this;
103104
};

Tone/component/EQ3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ define(["Tone/core/Tone", "Tone/component/MultibandSplit", "Tone/core/Gain"], fu
2424
* @type {GainNode}
2525
* @private
2626
*/
27-
this.output = this.context.createGain();
27+
this.output = new Tone.Gain();
2828

2929
/**
3030
* the multiband split

Tone/component/Envelope.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,7 @@ define(["Tone/core/Tone", "Tone/signal/TimelineSignal",
228228
* env.triggerAttack("+0.5", 0.2);
229229
*/
230230
Tone.Envelope.prototype.triggerAttack = function(time, velocity){
231-
//to seconds
232-
var now = this.now() + this.blockTime;
233-
time = this.toSeconds(time, now);
231+
time = this.toSeconds(time);
234232
var originalAttack = this.toSeconds(this.attack);
235233
var attack = originalAttack;
236234
var decay = this.toSeconds(this.decay);
@@ -276,8 +274,7 @@ define(["Tone/core/Tone", "Tone/signal/TimelineSignal",
276274
* env.triggerRelease();
277275
*/
278276
Tone.Envelope.prototype.triggerRelease = function(time){
279-
var now = this.now() + this.blockTime;
280-
time = this.toSeconds(time, now);
277+
time = this.toSeconds(time);
281278
var currentValue = this.getValueAtTime(time);
282279
if (currentValue > 0){
283280
var release = this.toSeconds(this.release);

Tone/component/FeedbackCombFilter.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
define(["Tone/core/Tone", "Tone/signal/ScaleExp", "Tone/signal/Signal", "Tone/core/Param"], function(Tone){
1+
define(["Tone/core/Tone", "Tone/signal/ScaleExp", "Tone/signal/Signal",
2+
"Tone/core/Param", "Tone/core/Delay", "Tone/core/Gain"], function(Tone){
23

34
"use strict";
45

@@ -13,44 +14,35 @@ define(["Tone/core/Tone", "Tone/signal/ScaleExp", "Tone/signal/Signal", "Tone/co
1314
*/
1415
Tone.FeedbackCombFilter = function(){
1516

16-
Tone.call(this);
1717
var options = this.optionsObject(arguments, ["delayTime", "resonance"], Tone.FeedbackCombFilter.defaults);
1818

1919
/**
2020
* the delay node
2121
* @type {DelayNode}
2222
* @private
2323
*/
24-
this._delay = this.input = this.output = this.context.createDelay(1);
24+
this._delay = this.input = this.output = new Tone.Delay(options.delayTime);
2525

2626
/**
2727
* The amount of delay of the comb filter.
2828
* @type {Time}
2929
* @signal
3030
*/
31-
this.delayTime = new Tone.Param({
32-
"param" : this._delay.delayTime,
33-
"value" : options.delayTime,
34-
"units" : Tone.Type.Time
35-
});
31+
this.delayTime = this._delay.delayTime;
3632

3733
/**
3834
* the feedback node
3935
* @type {GainNode}
4036
* @private
4137
*/
42-
this._feedback = this.context.createGain();
38+
this._feedback = new Tone.Gain(options.resonance, Tone.Type.NormalRange);
4339

4440
/**
4541
* The amount of feedback of the delayed signal.
4642
* @type {NormalRange}
4743
* @signal
4844
*/
49-
this.resonance = new Tone.Param({
50-
"param" : this._feedback.gain,
51-
"value" : options.resonance,
52-
"units" : Tone.Type.NormalRange
53-
});
45+
this.resonance = this._feedback.gain;
5446

5547
this._delay.chain(this._feedback, this._delay);
5648
this._readOnly(["resonance", "delayTime"]);
@@ -76,14 +68,12 @@ define(["Tone/core/Tone", "Tone/signal/ScaleExp", "Tone/signal/Signal", "Tone/co
7668
Tone.FeedbackCombFilter.prototype.dispose = function(){
7769
Tone.prototype.dispose.call(this);
7870
this._writable(["resonance", "delayTime"]);
79-
this._delay.disconnect();
71+
this._delay.dispose();
8072
this._delay = null;
81-
this.delayTime.dispose();
8273
this.delayTime = null;
83-
this.resonance.dispose();
84-
this.resonance = null;
85-
this._feedback.disconnect();
74+
this._feedback.dispose();
8675
this._feedback = null;
76+
this.resonance = null;
8777
return this;
8878
};
8979

Tone/component/Filter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ define(["Tone/core/Tone", "Tone/signal/Signal"], function(Tone){
1818
* var filter = new Tone.Filter(200, "highpass");
1919
*/
2020
Tone.Filter = function(){
21-
Tone.call(this);
21+
this.createInsOuts(1, 1);
2222

2323
var options = this.optionsObject(arguments, ["frequency", "type", "rolloff"], Tone.Filter.defaults);
2424

Tone/component/Follower.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
define(["Tone/core/Tone", "Tone/signal/Abs", "Tone/signal/Subtract",
2-
"Tone/signal/Multiply", "Tone/signal/Signal", "Tone/signal/WaveShaper", "Tone/type/Type"],
1+
define(["Tone/core/Tone", "Tone/signal/Abs", "Tone/signal/Subtract", "Tone/signal/Multiply",
2+
"Tone/signal/Signal", "Tone/signal/WaveShaper", "Tone/type/Type", "Tone/core/Delay"],
33
function(Tone){
44

55
"use strict";
@@ -21,7 +21,7 @@ function(Tone){
2121
*/
2222
Tone.Follower = function(){
2323

24-
Tone.call(this);
24+
this.createInsOuts(1, 1);
2525
var options = this.optionsObject(arguments, ["attack", "release"], Tone.Follower.defaults);
2626

2727
/**
@@ -53,11 +53,10 @@ function(Tone){
5353
this._sub = new Tone.Subtract();
5454

5555
/**
56-
* @type {DelayNode}
56+
* @type {Tone.Delay}
5757
* @private
5858
*/
59-
this._delay = this.context.createDelay();
60-
this._delay.delayTime.value = this.blockTime;
59+
this._delay = new Tone.Delay(this.blockTime);
6160

6261
/**
6362
* this keeps it far from 0, even for very small differences
@@ -170,7 +169,7 @@ function(Tone){
170169
this._filter = null;
171170
this._frequencyValues.disconnect();
172171
this._frequencyValues = null;
173-
this._delay.disconnect();
172+
this._delay.dispose();
174173
this._delay = null;
175174
this._sub.disconnect();
176175
this._sub = null;

Tone/component/FrequencyEnvelope.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ define(["Tone/core/Tone", "Tone/component/ScaledEnvelope", "Tone/component/Envel
6464
},
6565
set : function(min){
6666
this._scale.min = this.toFrequency(min);
67+
//also update the octaves
68+
this.octaves = this._octaves;
6769
}
6870
});
6971

0 commit comments

Comments
 (0)