sndfile: use separate variable names for library and format handler
[sox.git] / scripts / synth.sh
blob9705a60a6d0e6ac3d8b9db0fb98462d38f26cbe4
1 #!/bin/sh
3 # SoX script: synth.sh (c) 2008-9 robs@users.sourceforge.net
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; either version 2 of the License, or (at your
8 # option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
13 # Public License for more details.
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 # Demonstrates the use of some of the features new in SoX 14.3.0, viz
20 # nested SoX commands, the synth `pluck' type, and the overdrive
21 # effect (also used are several other effects).
22 # Music (c) 2008 robs@users.sourceforge.net. All rights reserved.
24 sox=../src/sox
26 G0="pl %-26 pl %-19 pl %-14 pl %-10 pl %-7 pl %-2"
27 A0="pl %-24 pl %-17 pl %-12 pl %-8 pl %-5 pl %0"
28 C0="pl %-26 pl %-21 pl %-14 pl %-9 pl %-5 pl %-2"
29 D0="pl %-24 pl %-19 pl %-12 pl %-7 pl %-3 pl %0"
30 E0="pl %-22 pl %-17 pl %-10 pl %-5 pl %-1 pl %2"
31 Bb0="pl %-23 pl %-16 pl %-11 pl %-7 pl %-4 pl %1"
33 o="overdrive 27 gain -11"
34 e="delay 0 .02 .04 .06 .08 .1 remix - overdrive 33 gain -8 fade 0"
35 s="$sox -q -n -p synth 0 0 1 60 90"
36 l="$sox -q -n -p synth 0 0 0 50 20"
38 b="$sox -n -p synth 0 0 0 30 20 pl"
39 c3="fade h 0 .75"
40 c="fade h 0 .25"
41 cs="fade h 0 .25 .05"
42 m="fade h 0 .5"
43 sb="fade h 0 1"
44 r="$sox -n -p trim 0 .25"
45 r2="$sox -n -p trim 0 .5"
46 r3="$sox -n -p trim 0 .75"
48 $sox -m -v .8 \
49 "|$sox \
50 \"|$sox -n -p synth noise fade 0 .5 .48 trim 0 .15\" \
51 \"|$sox -n -p synth noise fade h 0 .26 .11 gain -35 lowpass -1 12k\" \
52 -p splice .15,.06,0 gain -14 lowpass -1 12k highpass -1 9k \
53 equalizer 14k 1.3 13 \
54 equalizer 9500 10 8 \
55 equalizer 7000 10 8 \
56 equalizer 5200 10 8 \
57 equalizer 3800 10 8 \
58 equalizer 1500 10 8 pad 0 .21 remix 1 1 reverb 10 repeat 56" \
59 "|$sox \
60 \"|$sox -n -p trim 0 1.4\" \
61 \"|$s $G0 $e 2.6 .1 bend .5,200,.2\" \
62 \"|$s $C0 $e 2 .1\" \
63 \"|$s $D0 $e 4 .1\" \
64 \"|$s $A0 $e 2 .1\" \
65 \"|$s $C0 $e 2 .1\" \
66 \"|$s $D0 $e 4 .1\" \
67 \"|$s $A0 $e 2 .1\" \
68 \"|$s $C0 $e 2 .1\" \
69 \"|$s $D0 $e 2 .1\" \
70 \"|$s $Bb0 $e 2 .1\" \
71 \"|$s $E0 $e 4 .1\" \
72 -p pad 0 3 remix 1 1 flanger reverb 70" \
73 "|$sox \
74 \"|$sox -n -p trim 0 8\" \
75 \"|$l pl %7 $o trim 0 .25\" \
76 \"|$l pl %12 $o trim 0 .2\" \
77 \"|$l pl %10 $o trim 0 .5 bend .2,-300,.1\" \
78 \"|$l pl %5 $o trim 0 .5 bend .2,-200,.1\" \
79 \"|$l pl %0 $o fade 0 .55 .1 bend .2,-200,.1\" \
80 \"|$l pl %0 $o fade h 0 2 .5\" \
81 \"|$sox -n -p trim 0 3.95\" \
82 \"|$l pl %12 $o trim 0 .5 bend .2,-200,.1\" \
83 \"|$l pl %12 $o trim 0 .5 bend .2,-200,.1\" \
84 \"|$l pl %12 $o fade 0 .8 .1 bend .2,-200,.1\" \
85 \"|$l pl %12 $o trim 0 .3 bend .1,-200,.1\" \
86 \"|$l pl %12 $o fade 0 1.95 .6 bend .0,-50,1.75 gain 3\" \
87 \"|$l pl %10 $o fade 0 2 .6 bend .0,-50,1.9\" \
88 \"|$l pl %9 $o trim 0 2 gain -1\" \
89 \"|$l pl %8 $o fade h 0 1 .3\" \
90 \"|$l pl %8 $o fade h 0 1 .1 gain 1.5\" \
91 \"|$l pl %2 pl %7 delay 0 .02 remix - $o trim 0 .25\" \
92 \"|$l pl %-5 $o trim 0 .25\" \
93 \"|$l pl %-5 $o trim 0 .25\" \
94 \"|$l pl %2 pl %7 delay 0 .02 remix - $o trim 0 .25\" \
95 \"|$l pl %-5 $o trim 0 .25\" \
96 \"|$l pl %-5 $o trim 0 .25\" \
97 \"|$l pl %2 pl %7 delay 0 .02 remix - $o trim 0 .25\" \
98 \"|$l pl %-5 $o trim 0 .25\" \
99 \"|$l pl %2 pl %7 delay 0 .02 remix - $o fade h 0 6 6\" \
100 -p gain -4 remix 1 1 flanger" \
101 "|$sox \
102 \"|$sox -n -p trim 0 1.5\" \
103 \"|$b G1 $m contrast\" \
104 \"|$b A1 $c3 contrast\" \
105 \"|$b G#1 $c\" \
106 \"|$b A1 $c3\" \
107 \"|$r\" \
109 \"|$b C2 $cs\" \
110 \"|$b C2 $cs\" \
111 \"|$r\" \
112 \"|$b B1 $cs\" \
113 \"|$b C2 $c3\" \
114 \"|$r\" \
116 \"|$b D2 $cs\" \
117 \"|$b D2 $cs\" \
118 \"|$r\" \
119 \"|$b C#2 $cs\" \
120 \"|$b D2 $c\" \
121 \"|$b C#2 $m\" \
122 \"|$r\" \
124 \"|$b D2 $cs\" \
125 \"|$b D2 $cs\" \
126 \"|$r\" \
127 \"|$b C#2 $cs\" \
128 \"|$b D2 $c\" \
129 \"|$b C#2 $c\" \
130 \"|$b D2 $c\" \
131 \"|$b E2 $c\" \
133 \"|$b A1 $c3 contrast\" \
134 \"|$b B1 $c\" \
135 \"|$b A1 $c\" \
136 \"|$b G#1 $c\" \
137 \"|$b A1 $c\" \
138 \"|$b B1 $c\" \
140 \"|$b C2 $c3\" \
141 \"|$b B1 $c\" \
142 \"|$b C2 $c\" \
143 \"|$b D2 $c\" \
144 \"|$b C2 $c\" \
145 \"|$b B1 $c\" \
147 \"|$b D2 $c3\" \
148 \"|$b E2 $c\" \
149 \"|$b D2 $c\" \
150 \"|$b C#2 $c\" \
151 \"|$b D2 $c\" \
152 \"|$b E2 $c\" \
154 \"|$b D2 $c3\" \
155 \"|$b C#2 $c\" \
156 \"|$b D2 $c\" \
157 \"|$b E2 $c\" \
158 \"|$b D2 $c\" \
159 \"|$b C#2 $c\" \
161 \"|$b A1 $cs\" \
162 \"|$b A1 $cs\" \
163 \"|$r\" \
164 \"|$b G#1 $c\" \
165 \"|$b A1 $c3\" \
166 \"|$b B1 $c\" \
168 \"|$b C2 $c\" \
169 \"|$b B1 $c\" \
170 \"|$b C2 $c\" \
171 \"|$b D2 $c\" \
172 \"|$b C2 $c3\" \
173 \"|$r\" \
175 \"|$b D2 $m\" \
176 \"|$b E2 $m\" \
177 \"|$b D2 $c\" \
178 \"|$b C#2 $c\" \
179 \"|$b D2 $c\" \
180 \"|$b E2 $c\" \
182 \"|$b F2 $m\" \
183 \"|$b Bb1 $m\" \
184 \"|$b C2 $c\" \
185 \"|$b F2 $c\" \
186 \"|$b D2 $c\" \
187 \"|$b Bb1 $c\" \
189 \"|$b E1 $m\" \
190 \"|$b E2 $m\" \
191 \"|$b D2 $c\" \
192 \"|$b E2 $m\" \
193 \"|$b B1 $c\" \
195 \"|$b E1 $sb\" \
196 -p lowpass -1 1k remix 1p-12 1p-12" -d