Skip to content

Commit

Permalink
Add 2 new filter 8D and Karaoke. Better Soft filter now
Browse files Browse the repository at this point in the history
  • Loading branch information
rohank05 committed Jul 13, 2021
1 parent a9d9ee0 commit 0c2ec78
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 37 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,32 @@ /~https://github.com/OpenianDevelopment/erela.js-filters
> **Example:** player.nightcore = true;
>
- ### Vaporwave
> Add nighcore filter to the player \
> Add vaporwave filter to the player \
> **Example:** player.vaporwave = true;
>
- ### BassBoost
> Add nighcore filter to the player \
> Add Bass Boost filter to the player \
> **Example:** player.bassboost = true;
>
- ### Pop
> Add nighcore filter to the player \
> Add pop filter to the player \
> **Example:** player.pop = true;
>
- ### Soft
> Add nighcore filter to the player \
> Add soft filter to the player \
> **Example:** player.soft = true;
>
- ### treblebass
> Add treble bass filter to the player \
> **Example:** player.treblebass = true;
>
- ### Eight Dimension
> Add 8D filter to the player \
> **Example:** player.EightD = true;
>
- ### Karaoke
> Add karaoke filter to the player \
> **Example:** player.karaoke = true;
- ### Reset
> Reset the filter
Expand Down
96 changes: 80 additions & 16 deletions dist/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class customFilter extends erela_js_1.Plugin {
this._pop = false;
this._soft = false;
this._treblebass = false;
this._EightD = false;
this._karaoke = false;
//Private Filter Data
this._resetData = {
op: "filters",
Expand Down Expand Up @@ -81,22 +83,9 @@ class customFilter extends erela_js_1.Plugin {
this._softData = {
op: "filters",
guildId: this.guild,
equalizer: [
{ band: 0, gain: 0 },
{ band: 1, gain: 0 },
{ band: 2, gain: 0 },
{ band: 3, gain: 0 },
{ band: 4, gain: 0 },
{ band: 5, gain: 0 },
{ band: 6, gain: 0 },
{ band: 7, gain: 0 },
{ band: 8, gain: -0.25 },
{ band: 9, gain: -0.25 },
{ band: 10, gain: -0.25 },
{ band: 11, gain: -0.25 },
{ band: 12, gain: -0.25 },
{ band: 13, gain: -0.25 },
],
lowPass: {
smoothing: 20.0
}
};
this._treblebassData = {
op: "filters",
Expand All @@ -118,6 +107,23 @@ class customFilter extends erela_js_1.Plugin {
{ band: 13, gain: 0 },
],
};
this._EightDData = {
op: "filter",
guildId: this.guild,
rotation: {
rotationHz: 0.2
}
};
this._karaokeData = {
op: "filter",
guildId: this.guild,
karaoke: {
level: 1.0,
monoLevel: 1.0,
filterBand: 220.0,
filterWidth: 100.0
},
};
}
//Setting the filter
set nightcore(status) {
Expand All @@ -128,6 +134,8 @@ class customFilter extends erela_js_1.Plugin {
this._soft = false;
this._pop = false;
this._treblebass = false;
this._8d = false;
this._karaoke = false;
this.node.send(this._nightcoreData);
}
else
Expand All @@ -141,6 +149,8 @@ class customFilter extends erela_js_1.Plugin {
this._soft = false;
this._pop = false;
this._treblebass = false;
this._8d = false;
this._karaoke = false;
this.node.send(this._vaporwaveData);
}
else
Expand All @@ -154,6 +164,8 @@ class customFilter extends erela_js_1.Plugin {
this._soft = false;
this._pop = false;
this._treblebass = false;
this._8d = false;
this._karaoke = false;
this.node.send(this._bassboostData);
}
else
Expand All @@ -167,6 +179,8 @@ class customFilter extends erela_js_1.Plugin {
this._bassboost = false;
this._soft = false;
this._treblebass = false;
this._8d = false;
this._karaoke = false;
this.node.send(this._popData);
}
else
Expand All @@ -180,6 +194,8 @@ class customFilter extends erela_js_1.Plugin {
this._bassboost = false;
this._pop = false;
this._treblebass = false;
this._8d = false;
this._karaoke = false;
this.node.send(this._soft);
}
else
Expand All @@ -193,11 +209,41 @@ class customFilter extends erela_js_1.Plugin {
this._bassboost = false;
this._pop = false;
this._soft = false;
this._8d = false;
this._karaoke = false;
this.node.send(this._soft);
}
else
this._resetnode();
}
set EightD(status) {
this._8d = status;
if (status) {
this._nightcore = false;
this._vaporwave = false;
this._bassboost = false;
this._pop = false;
this._soft = false;
this._treblebass = false;
this._karaoke = false;
this.node.send(this._8dData);
}
else
this._resetnode();
}
set karaoke(status) {
this._karaoke = status;
if (status) {
this._nightcore = false;
this._vaporwave = false;
this._bassboost = false;
this._pop = false;
this._soft = false;
this._treblebass = false;
this._8d = false;
this.node.send(this._karaokeData);
}
}
//Get Filter Status
get nightcore() {
return this._nightcore;
Expand All @@ -208,6 +254,21 @@ class customFilter extends erela_js_1.Plugin {
get bassboost() {
return this._bassboost;
}
get pop() {
return this._pop;
}
get soft() {
return this._soft;
}
get treblebass() {
return this.treblebass;
}
get EightD() {
return this._8d;
}
get karaoke() {
return this._karaoke;
}
//Reset Everything
_resetnode() {
this.node.send(this._resetData);
Expand All @@ -219,6 +280,9 @@ class customFilter extends erela_js_1.Plugin {
this._bassboost = false;
this._soft = false;
this._pop = false;
this._treblebass = false;
this._8d = false;
this._karaoke = false;
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "erela.js-filters",
"version": "1.1.5",
"version": "1.1.6",
"description": "A custom filter plugin for erela.js",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
Loading

0 comments on commit 0c2ec78

Please sign in to comment.