@@ -24,6 +24,8 @@ public FilterCommand(){
2424 new VibratoCommand (),
2525 new RotationCommand (),
2626 new DistortionCommand (),
27+ new ChannelMixCommand (),
28+ new LowPassCommand (),
2729 new ClearCommand ()
2830 );
2931 }
@@ -262,6 +264,70 @@ public void run(Options options, GuildInteraction ia){
262264
263265 }
264266
267+ private static class ChannelMixCommand extends GuildSubCommand {
268+
269+ public ChannelMixCommand (){
270+ super ("channel-mix" , "Mixes both channels, with a configurable factor on how much each channel affects the other." );
271+ addOptions (
272+ new CommandOptionFloat ("left-to-left" , "How much audio from the left channel goes to the left channel" ),
273+ new CommandOptionFloat ("left-to-right" , "How much audio from the left channel goes to the right channel" ),
274+ new CommandOptionFloat ("right-to-left" , "How much audio from the right channel goes to the left channel" ),
275+ new CommandOptionFloat ("right-to-right" , "How much audio from the right channel goes to the right channel" )
276+ );
277+ }
278+
279+ @ Override
280+ public void run (Options options , GuildInteraction ia ){
281+ var scheduler = ia .get (MusicModule .class ).getScheduler (ia .getGuildId ());
282+ if (!MusicUtils .checkCommandRequirements (ia , scheduler ) || !MusicUtils .checkMusicPermissions (ia , scheduler )){
283+ return ;
284+ }
285+ var channelMix = new ChannelMix ();
286+ if (options .has ("left-to-left" )){
287+ channelMix = channelMix .setLeftToLeft (options .getFloat ("left-to-left" ));
288+ }
289+ if (options .has ("left-to-right" )){
290+ channelMix = channelMix .setLeftToRight (options .getFloat ("left-to-right" ));
291+ }
292+ if (options .has ("right-to-left" )){
293+ channelMix = channelMix .setRightToLeft (options .getFloat ("right-to-left" ));
294+ }
295+ if (options .has ("right-to-right" )){
296+ channelMix = channelMix .setRightToLeft (options .getFloat ("right-to-right" ));
297+ }
298+
299+ scheduler .getFilters ().setChannelMix (channelMix ).commit ();
300+ ia .reply ("Set channel-mix filter" );
301+ }
302+
303+ }
304+
305+ private static class LowPassCommand extends GuildSubCommand {
306+
307+ public LowPassCommand (){
308+ super ("low-pass" , "Higher frequencies get suppressed, while lower frequencies pass through this filter." );
309+ addOptions (
310+ new CommandOptionFloat ("smoothing" , "The smoothing level" )
311+ );
312+ }
313+
314+ @ Override
315+ public void run (Options options , GuildInteraction ia ){
316+ var scheduler = ia .get (MusicModule .class ).getScheduler (ia .getGuildId ());
317+ if (!MusicUtils .checkCommandRequirements (ia , scheduler ) || !MusicUtils .checkMusicPermissions (ia , scheduler )){
318+ return ;
319+ }
320+ var lowPass = new LowPass ();
321+ if (options .has ("smoothing" )){
322+ lowPass = lowPass .setSmoothing (options .getFloat ("smoothing" ));
323+ }
324+
325+ scheduler .getFilters ().setLowPass (lowPass ).commit ();
326+ ia .reply ("Set low-pass filter" );
327+ }
328+
329+ }
330+
265331 private static class ClearCommand extends GuildSubCommand {
266332
267333 public ClearCommand (){
0 commit comments