Guest User

Untitled

a guest
Jul 5th, 2020
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.99 KB | None | 0 0
  1. #!/bin/bash
  2. # bash is required for the <<< and more
  3. # for ladspa plugins descriptions, see
  4. # http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html#tth_sEc2.6
  5.  
  6. test_running=true
  7. while $test_running; do
  8.     sinkdata=$(pacmd list-sinks)
  9.     listsink_rv=$?
  10.  
  11.     if (($listsink_rv != 0)); then
  12.         notify-send "pulse plugins" "pulseaudio isn't running"
  13.         paplay ~/Musik/stille.flac
  14.     else
  15.         test_running=false
  16.     fi
  17. done
  18.  
  19. pat="<sammler>"
  20. [[ $sinkdata =~ $pat ]] && {
  21.     notify-send "pulse plugins" "already activated"
  22.     exit
  23. }
  24.  
  25. # Add ladspa sinks
  26. # LADSPA_PATH didn't work for me
  27. pactl load-module module-ladspa-sink master=0 sink_name=lowfre_butt \
  28.     plugin=/usr/local/lib/ladspa/butterworth_1902.so label=buttlow_iir control=50,
  29.     #~ plugin=butterworth_1902 label=buttlow_iir control=50,
  30. pactl load-module module-ladspa-sink master=0 sink_name=lowfre_tsche \
  31.     plugin=/usr/local/lib/ladspa/lowpass_iir_1891.so label=lowpass_iir control=40,3
  32.     #~ plugin=lowpass_iir_1891 label=lowpass_iir control=40,3
  33.  
  34. # Add null sink, loopback the ladspa sinks and original copy into it, set the
  35. # null sink "sammler" as default and adjust volume ratios
  36. # code (modified) provided by georgC (via irc)
  37. pactl load-module module-null-sink sink_name=sammler
  38. my_loopback="pactl load-module module-loopback latency_msec=30 \
  39.     max_latency_msec=40 adjust_time=1 fast_adjust_threshold_msec=150"
  40.     #~ max_latency_msec=40 adjust_time=1"
  41. $my_loopback source=sammler.monitor sink=lowfre_butt
  42. $my_loopback source=sammler.monitor sink=lowfre_tsche
  43. $my_loopback source=sammler.monitor sink=0
  44. pactl set-default-sink sammler
  45. lowfre_index=$(pacmd list-sink-inputs | ag "<lowfre_butt>" -B4 | head -n1 | \
  46.     cut -f2 -d":")
  47. pactl set-sink-input-volume $lowfre_index 0x10000
  48. pactl set-sink-input-volume $((lowfre_index+1)) 0x18675
  49. pactl set-sink-input-volume $((lowfre_index+2)) 0x7800
  50. #~ pacmd set-sink-input-volume $((lowfre_index+1)) 0x7800
  51.  
  52. notify-send "pulse plugins" "activated"
  53.  
  54. # module-combine-sink doesn't remember the volume configurations
Add Comment
Please, Sign In to add comment