Skip to content

Instantly share code, notes, and snippets.

@spion
Last active December 3, 2018 18:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spion/90f46c0c27ba6f374845 to your computer and use it in GitHub Desktop.
Save spion/90f46c0c27ba6f374845 to your computer and use it in GitHub Desktop.
#!/bin/bash
#----------------------------------------------------------------------------------
# Settings
#----------------------------------------------------------------------------------
#BANDN="Toggle,Freq,Band,Gain"
BAND1="1,150,1.3,-7"
BAND2="1,100,0.4,4"
BAND3="1,5400,0.9,-5"
BAND4="1,3400,1.5,3"
#EQ="Toggle,Gain,Bands"
EQ="1,0,$BAND1,$BAND2,$BAND3,$BAND4"
#----------------------------------------------------------------------------------
# Code
#----------------------------------------------------------------------------------
function getname {
pactl list short $1 | grep $2 | awk '{print $2}'
}
function getid {
pactl list short $1 | grep $2 | awk '{print $1}'
}
for existing_eq in `getid modules paraeq`
do
echo "Unloading existing EQ"
pactl unload-module $existing_eq
done
for existing_bt in `getid modules loopback.*bluez`
do
echo "Disconnecting bluetooth from master output"
pactl unload-module $existing_bt
done
OUT=`getname sinks alsa`
pactl load-module module-ladspa-sink sink_name=paraeq master=$OUT plugin=filters label=Parametric1 control=$EQ
INP=`getname sources bluez`
OUTEQ=`getname sinks paraeq`
pactl load-module module-loopback source=$INP sink=$OUTEQ
@Wario84
Copy link

Wario84 commented Mar 25, 2017

Hi there, I have been trying to run a system-wide parametric equalizer for some time, but I'm pretty new in Linux. I believe that your script can help me out, I try to run it, but I get Failure: Module initialization failed.

@Wario84
Copy link

Wario84 commented Mar 26, 2017

Hey, thanks a lot, I implemented the eq. Do you know where I can read more about this particular filter? I don't know with precision the interaction between toggle/frequency and band.

@spion
Copy link
Author

spion commented Dec 3, 2018

You should look into pulseeffects, a much more elaborate parametric EQ with a GUI :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment