-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmasteringsheet
More file actions
executable file
·92 lines (78 loc) · 2.94 KB
/
masteringsheet
File metadata and controls
executable file
·92 lines (78 loc) · 2.94 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
# masteringsheet - jzu@free.fr 2011 - WTFPL
# All WAV files must be alphabetically ordered in the directory
# Should be run from the directory where the WAVs reside, but
# you can use another as long as there is no space in the path
# Needs a titles.txt file matching filenames and titles (same order)
# formatted as text lines with File and Title separated by a space
# Ugly script badly coded in an inappropriate language
# Needs sox and bc
if [ $# -ne 2 ]
then
echo "Usage: $0 \"title\" \"engineer\""
exit 1
fi
# Create a list of durations for each file
for i in *.wav
do
sox $i /tmp/a.wav stat
done 2>&1 \
| grep seconds \
| sed "s/.*://" > temps
# Header
echo
echo "Title : $1"
echo "Engineer : $2"
echo
echo "|----|----|---|---|-------------|--------------------|-------------|"
echo "|Trk |Ind |Cpy|Emp| Time Code | Duration | IRSC |"
echo "|----|----|---|---|-------------|--------------------|-------------|"
echo "| 01 | 0 | x | | 00:00:00.00 | Pause: 2.00 | |"
# Song by song
j=2
k=1
for i in `cat temps`
do
liste[$k]=`cat titles.txt \
| sed ${k}p\;d`
length[$k]=$i
i=`echo $i \
| sed "s/....$//"`
echo "| $k | 1 | x | |" 00:`echo $j/60\
| bc`:`echo $j%60\
| bc` "| Track: "00:0`echo $i/60\
| bc`:`echo $i%60\
| bc` "| |" \
| sed -e "s/:\(.\)[:\.]/:0\1:/g" \
-e "s/:\./:00\./" \
-e "s/^| \(.\) /| 0\1 /" \
-e "s/:\(.\)\./:0\1\./g" \
-e "s/| 01 | 1 | x | | 00:00:2 /| | 1 | | | 00:00:02.00 /"
echo "|----|----|---|---|-------------|--------------------|-------------|"
k=$(($k+1))
j=`echo $i+$j|bc`
done
# Footer
echo "| AA | 1 | | |" 00:`echo $j/60\
| bc`:`echo $j%60\
| bc` "| CD: "00:`echo $j/60\
| bc`:`echo $j%60\
| bc` "| |" \
| sed -e "s/:\(.\)[:\.]/:0\1:/g" \
-e "s/^| \(.\) /| 0\1 /" \
-e "s/| 01 | 1 | x | | 00:00:2 /| | 1 | | | 00:00:02.00 /"
echo "|----|----|---|---|-------------|--------------------|-------------|"
echo
for i in `seq 1 $(($k-1))`
do
echo
echo $i')' ${liste[$i]} - Length: `echo ${length[$i]}/60\
| bc`mn `echo ${length[$i]}%60\
| bc \
| sed "s/\..*//"`s \
| sed -e 's/^\(.\))/0\1)/' \
-e 's/ \(.\)s$/ 0\1s/' \
-e "s/:\(.\)\./:0\1\./g"
done
# Cleanup
/bin/rm temps