Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions plugins/Filters/HighShelf.js
Original file line number Diff line number Diff line change
@@ -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";
38 changes: 38 additions & 0 deletions plugins/Filters/LowShelf.js
Original file line number Diff line number Diff line change
@@ -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";
6 changes: 3 additions & 3 deletions plugins/Filters/peaking.js
Original file line number Diff line number Diff line change
@@ -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) {

Expand Down Expand Up @@ -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";