diff --git a/plugins/Filters/HighShelf.js b/plugins/Filters/HighShelf.js new file mode 100644 index 0000000..3a6ebd8 --- /dev/null +++ b/plugins/Filters/HighShelf.js @@ -0,0 +1,38 @@ +/*globals BasePlugin */ +/* + High Shelf + A 2nd order biquad high shelf filter +*/ +var HighShelf = function (factory, owner) { + + // This attaches the base plugin items to the Object + BasePlugin.call(this, factory, owner); + + /* USER MODIFIABLE BEGIN */ + // Only modify between this line and the end of the object! + + var inputNode = this.context.createGain(), + outputNode = this.context.createGain(), + filter = this.context.createBiquadFilter(); + + filter.type = "highshelf"; + + inputNode.connect(filter); + filter.connect(outputNode); + + var frequency = this.parameters.createNumberParameter("frequency", 8000, 10, 20000); + var gain = this.parameters.createNumberParameter("gain", 0, -24, +24); + + frequency.bindToAudioParam(filter.frequency); + gain.bindToAudioParam(filter.gain); + + this.addInput(inputNode); + this.addOutput(outputNode); +}; + +// Also update the prototype function here! +HighShelf.prototype = Object.create(BasePlugin.prototype); +HighShelf.prototype.constructor = HighShelf; +HighShelf.prototype.name = "HighShelf"; +HighShelf.prototype.version = "1.0.0"; +HighShelf.prototype.uniqueID = "JSHS"; diff --git a/plugins/Filters/LowShelf.js b/plugins/Filters/LowShelf.js new file mode 100644 index 0000000..2b82450 --- /dev/null +++ b/plugins/Filters/LowShelf.js @@ -0,0 +1,38 @@ +/*globals BasePlugin */ +/* + Low Shelf + A 2nd order biquad high shelf filter +*/ +var LowShelf = function (factory, owner) { + + // This attaches the base plugin items to the Object + BasePlugin.call(this, factory, owner); + + /* USER MODIFIABLE BEGIN */ + // Only modify between this line and the end of the object! + + var inputNode = this.context.createGain(), + outputNode = this.context.createGain(), + filter = this.context.createBiquadFilter(); + + filter.type = "lowshelf"; + + inputNode.connect(filter); + filter.connect(outputNode); + + var frequency = this.parameters.createNumberParameter("frequency", 80, 10, 20000); + var gain = this.parameters.createNumberParameter("gain", 0, -24, +24); + + frequency.bindToAudioParam(filter.frequency); + gain.bindToAudioParam(filter.gain); + + this.addInput(inputNode); + this.addOutput(outputNode); +}; + +// Also update the prototype function here! +LowShelf.prototype = Object.create(BasePlugin.prototype); +LowShelf.prototype.constructor = LowShelf; +LowShelf.prototype.name = "LowShelf"; +LowShelf.prototype.version = "1.0.0"; +LowShelf.prototype.uniqueID = "JSLS"; diff --git a/plugins/Filters/peaking.js b/plugins/Filters/peaking.js index ff9ae98..4a1d4de 100644 --- a/plugins/Filters/peaking.js +++ b/plugins/Filters/peaking.js @@ -1,7 +1,7 @@ /*globals BasePlugin */ /* - HPF - A 2nd order biquad high pass filter + Peaking + A 2nd order biquad peaking filter */ var PeakingFilter = function (factory, owner) { @@ -37,4 +37,4 @@ PeakingFilter.prototype = Object.create(BasePlugin.prototype); PeakingFilter.prototype.constructor = PeakingFilter; PeakingFilter.prototype.name = "PeakingFilter"; PeakingFilter.prototype.version = "1.0.0"; -PeakingFilter.prototype.uniqueID = "JSHP"; +PeakingFilter.prototype.uniqueID = "JSPK";