Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # bash is required for the <<< and more
- # for ladspa plugins descriptions, see
- # http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html#tth_sEc2.6
- test_running=true
- while $test_running; do
- sinkdata=$(pacmd list-sinks)
- listsink_rv=$?
- if (($listsink_rv != 0)); then
- notify-send "pulse plugins" "pulseaudio isn't running"
- paplay ~/Musik/stille.flac
- else
- test_running=false
- fi
- done
- pat="<sammler>"
- [[ $sinkdata =~ $pat ]] && {
- notify-send "pulse plugins" "already activated"
- exit
- }
- # Add ladspa sinks
- # LADSPA_PATH didn't work for me
- pactl load-module module-ladspa-sink master=0 sink_name=lowfre_butt \
- plugin=/usr/local/lib/ladspa/butterworth_1902.so label=buttlow_iir control=50,
- #~ plugin=butterworth_1902 label=buttlow_iir control=50,
- pactl load-module module-ladspa-sink master=0 sink_name=lowfre_tsche \
- plugin=/usr/local/lib/ladspa/lowpass_iir_1891.so label=lowpass_iir control=40,3
- #~ plugin=lowpass_iir_1891 label=lowpass_iir control=40,3
- # Add null sink, loopback the ladspa sinks and original copy into it, set the
- # null sink "sammler" as default and adjust volume ratios
- # code (modified) provided by georgC (via irc)
- pactl load-module module-null-sink sink_name=sammler
- my_loopback="pactl load-module module-loopback latency_msec=30 \
- max_latency_msec=40 adjust_time=1 fast_adjust_threshold_msec=150"
- #~ max_latency_msec=40 adjust_time=1"
- $my_loopback source=sammler.monitor sink=lowfre_butt
- $my_loopback source=sammler.monitor sink=lowfre_tsche
- $my_loopback source=sammler.monitor sink=0
- pactl set-default-sink sammler
- lowfre_index=$(pacmd list-sink-inputs | ag "<lowfre_butt>" -B4 | head -n1 | \
- cut -f2 -d":")
- pactl set-sink-input-volume $lowfre_index 0x10000
- pactl set-sink-input-volume $((lowfre_index+1)) 0x18675
- pactl set-sink-input-volume $((lowfre_index+2)) 0x7800
- #~ pacmd set-sink-input-volume $((lowfre_index+1)) 0x7800
- notify-send "pulse plugins" "activated"
- # module-combine-sink doesn't remember the volume configurations
Add Comment
Please, Sign In to add comment