Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/Audio Filters #809

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

SplitPixl
Copy link
Contributor

This pull request...

  • Fixes a bug
  • Introduces a new feature
  • Improves an existing feature
  • Boosts code quality or performance

Description

Adds the filter command, with a handful of subcommands.

Purpose

Audio Funny

Relevant Issue(s)

N/A

@SplitPixl
Copy link
Contributor Author

SplitPixl commented Sep 15, 2021

This is still a dirty implementation, i did a bad job of keeping Vctr's code seperate from just the filter commands. This will need some cleanup. I do not think this is ready to merge in the state it is in.

@SplitPixl SplitPixl marked this pull request as draft September 16, 2021 18:40
This was linked to issues Oct 6, 2021
@MichailiK MichailiK self-assigned this Oct 6, 2021
@MichailiK MichailiK self-requested a review October 6, 2021 13:00
@MichailiK
Copy link
Collaborator

MichailiK commented Oct 6, 2021

In before-hand: I'm sure just by scrolling through the diff you can easily spot things to fix, like the commented pom dependencies, the IntelliJ project file (which should be removed), the code that's commented out etc.

Copy link
Collaborator

@MichailiK MichailiK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My apologies if I may sound aggressive, offensive or similar in this review. There are too many problems with this pull request. I have doubts that this feature will ever become a thing... not without this being rewritten, at the very least. This pull request seems to be using third party code too, which is something I'm not too fond of. Currently, there is no way to approve this. I'd recommend rewriting this with the master branch (and not in your fork) and not using other people's code. Regardless, here are some of the issues with this pull request:

@@ -2,6 +2,7 @@
/target/
/Playlists/
/test/
.idea
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not modify the gitignore

Suggested change
.idea

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.idea is to be excluded tho.

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file

Comment on lines +102 to +106
<dependency>
<groupId>com.github.natanbc</groupId>
<artifactId>lavadsp</artifactId>
<version>0.7.5</version>
</dependency>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not checked, but is this dependency needed?

Comment on lines +107 to +111
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This project does not use Kotlin.

Suggested change
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>

Comment on lines -76 to +115
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This project does not Kotlin. Revert this to the original state.

Suggested change
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>

else
{
nvolume = Math.abs(nvolume);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look like it will change anything.

Suggested change
nvolume = Math.abs(nvolume);

@@ -61,7 +61,8 @@ protected void execute(CommandEvent event)
+ "\nCustom Prefix: " + (s.getPrefix() == null ? "None" : "`" + s.getPrefix() + "`")
+ "\nRepeat Mode: **" + (s.getRepeatMode() ? "On" : "Off") + "**"
+ "\nDefault Playlist: " + (s.getDefaultPlaylist() == null ? "None" : "**" + s.getDefaultPlaylist() + "**")
)
+ "\nForbidden Audio: **" + (s.getForbiddenAudio() ? "On" : "Off") + "**"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this setting.

@@ -61,7 +61,8 @@ protected void execute(CommandEvent event)
+ "\nCustom Prefix: " + (s.getPrefix() == null ? "None" : "`" + s.getPrefix() + "`")
+ "\nRepeat Mode: **" + (s.getRepeatMode() ? "On" : "Off") + "**"
+ "\nDefault Playlist: " + (s.getDefaultPlaylist() == null ? "None" : "**" + s.getDefaultPlaylist() + "**")
)
+ "\nForbidden Audio: **" + (s.getForbiddenAudio() ? "On" : "Off") + "**"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the text bold only if its turned on.

Suggested change
+ "\nForbidden Audio: **" + (s.getForbiddenAudio() ? "On" : "Off") + "**"
+ "\nForbidden Audio: " + (s.getForbiddenAudio() ? "**On**" : "Off")

@@ -0,0 +1,5 @@
package com.jagrosh.jmusicbot.utils;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing license header. This somewhat looks like someone else's code, though.

Suggested change
package com.jagrosh.jmusicbot.utils;
/*
* Copyright 2021 John Grosh <john.a.grosh@gmail.com>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jagrosh.jmusicbot.utils;

@@ -0,0 +1,115 @@
package com.jagrosh.jmusicbot.utils;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing license header. This looks like someone else's code, though.

Suggested change
package com.jagrosh.jmusicbot.utils;
/*
* Copyright 2021 John Grosh <john.a.grosh@gmail.com>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jagrosh.jmusicbot.utils;

Comment on lines +28 to +48
<!-- <dependency>-->
<!-- <groupId>com.jagrosh</groupId>-->
<!-- <artifactId>JagTag</artifactId>-->
<!-- <version>0.5</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.4.9</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>discord-webhooks</artifactId>
<version>0.3.0</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>de.dfki.mary</groupId>-->
<!-- <artifactId>voice-cmu-slt-hsmm</artifactId>-->
<!-- <version>5.2</version>-->
<!-- </dependency>-->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented & unused dependencies.

Suggested change
<!-- <dependency>-->
<!-- <groupId>com.jagrosh</groupId>-->
<!-- <artifactId>JagTag</artifactId>-->
<!-- <version>0.5</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.mashape.unirest</groupId>
<artifactId>unirest-java</artifactId>
<version>1.4.9</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>discord-webhooks</artifactId>
<version>0.3.0</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>de.dfki.mary</groupId>-->
<!-- <artifactId>voice-cmu-slt-hsmm</artifactId>-->
<!-- <version>5.2</version>-->
<!-- </dependency>-->

Comment on lines +96 to +101
<!-- <dependency>-->
<!-- <groupId>org.hamcrest</groupId>-->
<!-- <artifactId>hamcrest-core</artifactId>-->
<!-- <version>1.3</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented dependency.

Suggested change
<!-- <dependency>-->
<!-- <groupId>org.hamcrest</groupId>-->
<!-- <artifactId>hamcrest-core</artifactId>-->
<!-- <version>1.3</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->

Copy link
Contributor

@Sanduhr32 Sanduhr32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this mess?

/**
* Destroy the player and stop playing track.
*/
public void destroy() {
Copy link
Contributor

@Sanduhr32 Sanduhr32 Oct 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Destructor" in java? U sure u doing this correctly?

for (int i = 0; i < array.length; i++) {
// if (i % 2 == 0 && i % fac2 != 0)
// array[i]=0;
array[i] = array[(i / fac2) * fac2];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mathematically this doesn't make any sense to me.
Why not i-1? or i++ next line?
Did you mean array[i] = array[i] / fac2 * fac2?


init {
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kotlin, which means splits pom changes are required. I don't see a reason why this code is in kotlin tho.

return String.format("Karaoke")
}

init {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty init is redundant.

@@ -0,0 +1,46 @@
/*
* Copyright 2020 natanbc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe Natan is fine with this.

@@ -0,0 +1,5 @@
package com.jagrosh.jmusicbot.utils;

class ScalarFunctions implements VectorSupport.FilterFunctions {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this empty class needed? Afaik if you implement an interface you actually have to implement the methods of it.

@@ -0,0 +1,115 @@
package com.jagrosh.jmusicbot.utils;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is written by natanbc from his github repo of lavaplayer filters.

@Banaanae
Copy link

Banaanae commented Oct 9, 2022

another funny would be a max volume option in the settings
so we can go above 150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bass-boosting [Feature Request] change pitch and speed
4 participants