mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2024-12-22 14:02:29 -05:00
effects cleanup and comments
This commit is contained in:
parent
72733b6e7a
commit
c47957f421
1 changed files with 6 additions and 7 deletions
13
src/index.js
13
src/index.js
|
@ -8,19 +8,22 @@ function AudioEngine (sounds) {
|
|||
this.tone = new Tone();
|
||||
|
||||
// effects setup
|
||||
// each effect has a single parameter controlled by the effects block
|
||||
|
||||
this.delay = new Tone.FeedbackDelay(0.25, 0.5);
|
||||
this.panner = new Tone.Panner();
|
||||
this.reverb = new Tone.Freeverb();
|
||||
this.pitchShiftRatio = 1;
|
||||
this.pitchShiftRatio;
|
||||
|
||||
// reset effects to their default parameters
|
||||
this.clearEffects();
|
||||
|
||||
// the effects are chained to an effects node for this clone, then to the master output
|
||||
// so audio is sent from each sampler or instrument, through the effects in order, then out
|
||||
// note that the pitch effect works differently - it sets the playback rate for each sampler
|
||||
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
|
||||
|
||||
// var drumFileNames = ['high_conga', 'small_cowbell',
|
||||
|
@ -138,10 +141,6 @@ AudioEngine.prototype.clearEffects = function () {
|
|||
this.reverb.wet.value = 0;
|
||||
};
|
||||
|
||||
// AudioEngine.prototype.loadSoundFromUrl = function(url) {
|
||||
|
||||
// };
|
||||
|
||||
AudioEngine.prototype._clamp = function (input, min, max) {
|
||||
return Math.min(Math.max(input, min), max);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue