1
0
Fork 0
mirror of https://github.com/notwa/rc synced 2024-05-18 01:53:22 -07:00

why am i doing this

This commit is contained in:
Connor Olding 2015-04-13 22:29:12 -07:00
parent 4dc81b47e6
commit dbff418317
2 changed files with 12 additions and 10 deletions

View File

@ -105,14 +105,17 @@ function trash() {
. ~/sh/z/z.sh
MPV_STREAM_FLAGS="--quiet --no-sub"
LIVESTREAMER_FLAGS=""
[ -e "$HOME/sh/compandy" ] && _MPV_COMPAND="$(~/sh/compandy -30 10 1 140 6 18 1)"
_MPV_LAPTOP='--af=lavfi=[aformat=channel_layouts=stereo,'"$_MPV_COMPAND"',lowpass=f=1000:p=1,lowpass=f=4000:p=2]'
if [[ "$(uname -n)" != "banshee" ]]; then
MPV_STREAM_FLAGS="$MPV_STREAM_FLAGS --vo=opengl:swapinterval=0"
else
_COMPAND="$(~/sh/compandy 1 140 -30 10 6 18 1)"
MPV_STREAM_FLAGS="$MPV_STREAM_FLAGS "'--af=lavfi=\"aformat=channel_layouts=stereo,'"$_COMPAND"',lowpass=f=1000:p=1,lowpass=f=4000:p=2\"'
MPV_STREAM_FLAGS="$MPV_STREAM_FLAGS $_MPV_LAPTOP"
fi
LIVESTREAMER_FLAGS=""
twitch(){
livestreamer "twitch.tv/$1" best -p mpv $LIVESTREAMER_FLAGS -a \
"$MPV_STREAM_FLAGS ${2:+--autofit=}${2:-} {filename}"

View File

@ -2,20 +2,19 @@
# script to make sense of compand's parameters
compandy() {
if [ $# -eq 0 ]; then
echo -E "usage: $0 {attack} {release} {threshold} {ratio} [knee] [gain] [delay]"
echo -E "usage: $0 {threshold} {ratio} [attack] [release] [knee] [gain] [delay]"
return 1
fi
local atk="${1}" rel="${2}"
local thresh="${3}" ratio="${4}"
local thresh="${1:-10}" ratio="${2:-2}"
local atk="${3:-1}" rel="${4:-100}"
local knee="${5:-1}" gain="${6:-0}" delay="${7:-0}"
let 'atk/=1000.'
let 'rel/=1000.'
let 'delay/=1000.'
local end= start=
let 'end=thresh - thresh/(ratio + 0.0)'
local start=$thresh
printf "compand=%.5f|%.5f:%.5f|%.5f:%.1f/%.1f|0/%.2f:%.2f:%.2f:%.1f" \
$atk $atk $rel $rel $thresh $thresh $end $knee $gain $start
#echo "compand=$atk|$atk:$rel|$rel:$thresh/$thresh|0/$end:$knee:$gain:$start:$delay"
let 'start=thresh'
printf "compand=%.5f|%.5f:%.5f|%.5f:%.1f/%.1f|0/%.2f:%.2f:%.2f:%.1f:%.5f" \
$atk $atk $rel $rel $thresh $thresh $end $knee $gain $start $delay
}
compandy "$@"