mirror of
https://github.com/scratchfoundation/scratch-audio.git
synced 2025-01-03 11:35:49 -05:00
comments
This commit is contained in:
parent
cf80c9f9b8
commit
0c2548f6ba
1 changed files with 2 additions and 2 deletions
|
@ -103,7 +103,7 @@ Vocoder.prototype.initBandpassFilters = function () {
|
||||||
modulatorFilter.connect(modulatorFilterPostGain);
|
modulatorFilter.connect(modulatorFilterPostGain);
|
||||||
|
|
||||||
// add a rectifier with a lowpass filter to turn the bandpass filtered signal
|
// add a rectifier with a lowpass filter to turn the bandpass filtered signal
|
||||||
// into a smoothed control signal to control the carrier filter
|
// into a smoothed control signal for the carrier filter
|
||||||
var rectifier = new Tone.WaveShaper([1,0,1]);
|
var rectifier = new Tone.WaveShaper([1,0,1]);
|
||||||
modulatorFilterPostGain.connect(rectifier);
|
modulatorFilterPostGain.connect(rectifier);
|
||||||
var rectifierLowPass = new Tone.Filter(50, 'lowpass');
|
var rectifierLowPass = new Tone.Filter(50, 'lowpass');
|
||||||
|
@ -113,7 +113,6 @@ Vocoder.prototype.initBandpassFilters = function () {
|
||||||
var carrierFilter = new Tone.Filter(this.vocoderBands[i].frequency, 'bandpass', -24);
|
var carrierFilter = new Tone.Filter(this.vocoderBands[i].frequency, 'bandpass', -24);
|
||||||
carrierFilter.Q.value = FILTER_QUALITY;
|
carrierFilter.Q.value = FILTER_QUALITY;
|
||||||
this.carrierInput.connect(carrierFilter);
|
this.carrierInput.connect(carrierFilter);
|
||||||
|
|
||||||
var carrierFilterPostGain = new Tone.Gain(10);
|
var carrierFilterPostGain = new Tone.Gain(10);
|
||||||
carrierFilter.connect(carrierFilterPostGain);
|
carrierFilter.connect(carrierFilterPostGain);
|
||||||
|
|
||||||
|
@ -121,6 +120,7 @@ Vocoder.prototype.initBandpassFilters = function () {
|
||||||
var bandGain = new Tone.Gain(0);
|
var bandGain = new Tone.Gain(0);
|
||||||
carrierFilterPostGain.connect(bandGain);
|
carrierFilterPostGain.connect(bandGain);
|
||||||
|
|
||||||
|
// the modulator band filter output controls the gain of the carrier band
|
||||||
rectifierLowPass.connect(bandGain.gain);
|
rectifierLowPass.connect(bandGain.gain);
|
||||||
|
|
||||||
bandGain.connect(this.outputGain);
|
bandGain.connect(this.outputGain);
|
||||||
|
|
Loading…
Reference in a new issue