mirror of
https://github.com/notwa/rc
synced 2024-11-14 08:39:02 -08:00
compander has the worst arguments
This commit is contained in:
parent
56515803bd
commit
4dc81b47e6
1 changed files with 21 additions and 0 deletions
21
sh/compandy
Executable file
21
sh/compandy
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/zsh
|
||||||
|
# script to make sense of compand's parameters
|
||||||
|
compandy() {
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
echo -E "usage: $0 {attack} {release} {threshold} {ratio} [knee] [gain] [delay]"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
local atk="${1}" rel="${2}"
|
||||||
|
local thresh="${3}" ratio="${4}"
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
compandy "$@"
|
Loading…
Reference in a new issue