-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompand_bands.sh
More file actions
executable file
·62 lines (59 loc) · 3 KB
/
compand_bands.sh
File metadata and controls
executable file
·62 lines (59 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
curr_arg=0
attack_delay=()
for arg in "$@"; do
if [ $curr_arg -eq 0 ]; then
output_path=$arg
elif [ $curr_arg -eq 1 ]; then
comp_lvl=$arg
elif [ $curr_arg -eq 2 ]; then
buffer=$arg
else
attack_delay+=($arg)
fi
curr_arg=$((curr_arg+1))
done
rm "${output_path}"soxtmpcomp_*.wav
num_bands=${#attack_delay[@]}
for (( i=0 ; i<$num_bands ; i++ )); do
if [[ "$comp_lvl" == "x" ]]; then
# 1:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm
elif [[ $comp_lvl -eq 0 ]]; then
# 1.1:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm compand ${attack_delay[$i]} 6:-40,-30,-27 -0 -90 norm
elif [[ $comp_lvl -eq 1 ]]; then
# 1.2:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm compand ${attack_delay[$i]} 6:-40,-30,-25 -0 -90 norm
elif [[ $comp_lvl -eq 2 ]]; then
# 1.3:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm compand ${attack_delay[$i]} 6:-40,-30,-23 -0 -90 norm
elif [[ $comp_lvl -eq 3 ]]; then
# 1.5:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm compand ${attack_delay[$i]} 6:-40,-30,-20 -0 -90 norm
elif [[ $comp_lvl -eq 4 ]]; then
# 2:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm compand ${attack_delay[$i]} 6:-40,-30,-15 -0 -90 norm
elif [[ $comp_lvl -eq 5 ]]; then
# 3:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm compand ${attack_delay[$i]} 6:-40,-30,-10 -0 -90 norm
elif [[ $comp_lvl -eq 6 ]]; then
# 4:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm compand ${attack_delay[$i]} 6:-40,-30,-7.5 -0 -90 norm
elif [[ $comp_lvl -eq 7 ]]; then
# 5:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm compand ${attack_delay[$i]} 6:-40,-30,-6 -0 -90 norm
elif [[ $comp_lvl -eq 8 ]]; then
# 8:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm compand ${attack_delay[$i]} 6:-40,-30,-3.75 -0 -90 norm
elif [[ $comp_lvl -eq 9 ]]; then
# 10:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm compand ${attack_delay[$i]} 6:-40,-30,-3 -0 -90 norm
elif [[ $comp_lvl == "A" ]]; then
# 12:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm compand ${attack_delay[$i]} 6:-40,-30,-2.5 -0 -90 norm
elif [[ "$comp_lvl" == "B" ]]; then
# 20:1
sox -V0 --buffer $buffer --multi-threaded "${output_path}soxtmp_$i.wav" "${output_path}soxtmpcomp_$i.wav" norm compand ${attack_delay[$i]} 6:-40,-30,-1.5 -0 -90 norm
fi
done