diff --git a/src/index.js b/src/index.js index 8cc6383..4d821ad 100644 --- a/src/index.js +++ b/src/index.js @@ -12,10 +12,14 @@ function AudioEngine (sounds) { this.delay = new Tone.FeedbackDelay(0.25, 0.5); this.panner = new Tone.Panner(); this.reverb = new Tone.Freeverb(); + this.pitchShiftRatio = 1; this.clearEffects(); - Tone.Master.chain(this.delay, this.panner, this.reverb); + this.effectsNode = new Tone.Gain(); + this.effectsNode.chain(this.delay, this.panner, this.reverb, Tone.Master); + + // Tone.Master.chain(this.delay, this.panner, this.reverb); // drum sounds @@ -38,7 +42,7 @@ function AudioEngine (sounds) { Soundfont.instrument(Tone.context, this.instrumentNames[0]).then( function (inst) { this.instrument = inst; - this.instrument.connect(Tone.Master); + this.instrument.connect(this.effectsNode); }.bind(this) ); } @@ -46,7 +50,8 @@ function AudioEngine (sounds) { AudioEngine.prototype.loadSounds = function (sounds) { for (var i=0; i