Mercurial > hg > gpsynth
comparison src/sc_default_grammar.cpp @ 0:add35537fdbb tip
Initial import
author | irh <ian.r.hobson@gmail.com> |
---|---|
date | Thu, 25 Aug 2011 11:05:55 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:add35537fdbb |
---|---|
1 // Copyright 2011, Ian Hobson. | |
2 // | |
3 // This file is part of gpsynth. | |
4 // | |
5 // gpsynth is free software: you can redistribute it and/or modify | |
6 // it under the terms of the GNU General Public License as published by | |
7 // the Free Software Foundation, either version 3 of the License, or | |
8 // (at your option) any later version. | |
9 // | |
10 // gpsynth is distributed in the hope that it will be useful, | |
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 // GNU General Public License for more details. | |
14 // | |
15 // You should have received a copy of the GNU General Public License | |
16 // along with gpsynth in the file COPYING. | |
17 // If not, see http://www.gnu.org/licenses/. | |
18 | |
19 // Contents of grammar/sc.json | |
20 | |
21 #include "sc_default_grammar.hpp" | |
22 | |
23 namespace sc { | |
24 | |
25 const char* g_default_grammar = | |
26 "{\n" | |
27 " \"sclang-version\": \"3\",\n" | |
28 " \"name\": \"sc3\",\n" | |
29 " \"arg-types\": [\n" | |
30 " {\n" | |
31 " \"type\": \"frequency\",\n" | |
32 " \"range\": [20, 20000],\n" | |
33 " \"range_control\": [0, 100],\n" | |
34 " \"scaling\": \"log\"\n" | |
35 " },\n" | |
36 " {\n" | |
37 " \"type\": \"radians\",\n" | |
38 " \"range\": [0, 6.2831853072]\n" | |
39 " },\n" | |
40 " {\n" | |
41 " \"type\": \"audio\",\n" | |
42 " \"range\": [-1, 1]\n" | |
43 " },\n" | |
44 " {\n" | |
45 " \"type\": \"time\",\n" | |
46 " \"range\": [0, 10],\n" | |
47 " \"scaling\": \"log\"\n" | |
48 " },\n" | |
49 " {\n" | |
50 " \"type\": \"trigger\",\n" | |
51 " \"range\": [-1, 1],\n" | |
52 " \"fixed_range\": true\n" | |
53 " }\n" | |
54 " ],\n" | |
55 "\n" | |
56 " \"sources\": [\n" | |
57 " // oscillators\n" | |
58 " {\n" | |
59 " \"name\": \"SinOsc\",\n" | |
60 " \"args\": [\n" | |
61 " { \"name\": \"freq\", \"type\": \"frequency\" },\n" | |
62 " { \"name\": \"phase\", \"type\": \"radians\" }\n" | |
63 " ]\n" | |
64 " },\n" | |
65 " {\n" | |
66 " \"name\": \"Saw\",\n" | |
67 " \"args\": { \"name\": \"freq\", \"type\": \"frequency\" }\n" | |
68 " },\n" | |
69 " {\n" | |
70 " \"name\": \"SyncSaw\",\n" | |
71 " \"args\": [\n" | |
72 " { \"name\": \"syncFreq\", \"type\": \"frequency\" },\n" | |
73 " { \"name\": \"sawFreq\", \"type\": \"frequency\" }\n" | |
74 " ]\n" | |
75 " },\n" | |
76 " {\n" | |
77 " \"name\": \"VarSaw\",\n" | |
78 " \"args\": [ { \"name\": \"freq\", \"type\": \"frequency\" }, \"iphase\", \"width\" ]\n" | |
79 " },\n" | |
80 " {\n" | |
81 " \"name\": \"Pulse\",\n" | |
82 " \"args\": [ { \"name\": \"freq\", \"type\": \"frequency\" }, \"width\" ]\n" | |
83 " },\n" | |
84 " {\n" | |
85 " \"name\": \"Impulse\",\n" | |
86 " \"args\": [ { \"name\": \"freq\", \"type\": \"frequency\" }, \"phase\" ]\n" | |
87 " },\n" | |
88 " {\n" | |
89 " \"name\": \"Blip\",\n" | |
90 " \"args\": [\n" | |
91 " { \"name\": \"freq\", \"type\": \"frequency\" },\n" | |
92 " { \"name\": \"numharm\", \"range\": [1, 200] }\n" | |
93 " ]\n" | |
94 " },\n" | |
95 " {\n" | |
96 " \"name\": \"SinOscFB\",\n" | |
97 " \"args\": [\n" | |
98 " { \"name\": \"freq\", \"type\": \"frequency\" },\n" | |
99 " { \"name\": \"feedback\", \"type\": \"radians\" }\n" | |
100 " ]\n" | |
101 " },\n" | |
102 " {\n" | |
103 " \"name\": \"PMOsc\",\n" | |
104 " \"args\": [\n" | |
105 " { \"name\": \"carfreq\", \"type\": \"frequency\" },\n" | |
106 " { \"name\": \"modfreq\", \"type\": \"frequency\" },\n" | |
107 " { \"name\": \"pmindex\", \"type\": \"radians\" },\n" | |
108 " { \"name\": \"modphase\", \"type\": \"radians\" }\n" | |
109 " ]\n" | |
110 " },\n" | |
111 " {\n" | |
112 " \"name\": \"FBSineC\",\n" | |
113 " \"output\": \"audio\",\n" | |
114 " \"args\": [\n" | |
115 " { \"name\": \"freq\", \"type\": \"frequency\" },\n" | |
116 " { \"name\": \"im\", \"range\": [1, 64] },\n" | |
117 " { \"name\": \"fb\", \"range\": [0, 0.5] },\n" | |
118 " { \"name\": \"a\", \"range\": [1, 1.2] },\n" | |
119 " { \"name\": \"c\", \"range\": [0.1, 0.9] }\n" | |
120 " ]\n" | |
121 " },\n" | |
122 " {\n" | |
123 " \"name\": \"FBSineN\",\n" | |
124 " \"output\": \"audio\",\n" | |
125 " \"args\": [\n" | |
126 " { \"name\": \"freq\", \"type\": \"frequency\" },\n" | |
127 " { \"name\": \"im\", \"range\": [1, 64] },\n" | |
128 " { \"name\": \"fb\", \"range\": [0, 0.5] },\n" | |
129 " { \"name\": \"a\", \"range\": [1, 1.2] },\n" | |
130 " { \"name\": \"c\", \"range\": [0.1, 0.9] }\n" | |
131 " ]\n" | |
132 " },\n" | |
133 " {\n" | |
134 " \"name\": \"Logistic\",\n" | |
135 " \"args\": [\n" | |
136 " { \"name\": \"chaosParam\", \"range\": [3, 3.999] },\n" | |
137 " { \"name\": \"freq\", \"type\": \"frequency\" }\n" | |
138 " ]\n" | |
139 " },\n" | |
140 " // Noise\n" | |
141 " {\n" | |
142 " \"name\": \"LFNoise0\",\n" | |
143 " \"args\": { \"name\": \"freq\", \"type\": \"frequency\" }\n" | |
144 " },\n" | |
145 " \"WhiteNoise\",\n" | |
146 " \"BrownNoise\",\n" | |
147 " \"PinkNoise\",\n" | |
148 " {\n" | |
149 " \"name\": \"Crackle\",\n" | |
150 " \"args\": { \"name\": \"chaosParam\", \"range\": [1, 2] }\n" | |
151 " },\n" | |
152 " // Lines/Envelopes\n" | |
153 " {\n" | |
154 " \"name\": \"Line\",\n" | |
155 " \"output\": \"control\",\n" | |
156 " \"args\": { \"name\": \"dur\", \"type\": \"time\" }\n" | |
157 " },\n" | |
158 " {\n" | |
159 " \"name\": \"XLine\",\n" | |
160 " \"output\": \"control\",\n" | |
161 " \"args\": [ \n" | |
162 " { \"name\": \"dur\", \"type\": \"time\" },\n" | |
163 " { \"name\": \"add\", \"constant\": -1 }\n" | |
164 " ]\n" | |
165 " },\n" | |
166 " {\n" | |
167 " \"name\": \"Linen\",\n" | |
168 " \"output\": \"control\",\n" | |
169 " \"args\": [\n" | |
170 " \"gate\",\n" | |
171 " { \"name\": \"attackTime\", \"type\": \"time\" },\n" | |
172 " \"susLevel\", \n" | |
173 " { \"name\": \"releaseTime\", \"type\": \"time\" }\n" | |
174 " ]\n" | |
175 " }\n" | |
176 " ],\n" | |
177 "\n" | |
178 " \"modifiers\": [\n" | |
179 " // Filters\n" | |
180 " {\n" | |
181 " \"name\": \"LPF\",\n" | |
182 " \"args\": { \"name\": \"freq\", \"type\": \"frequency\" }\n" | |
183 " },\n" | |
184 " {\n" | |
185 " \"name\": \"HPF\",\n" | |
186 " \"args\": { \"name\": \"freq\", \"type\": \"frequency\" }\n" | |
187 " },\n" | |
188 " {\n" | |
189 " \"name\": \"BPF\",\n" | |
190 " \"args\": [ { \"name\": \"freq\", \"type\": \"frequency\" }, \"rq\" ]\n" | |
191 " },\n" | |
192 " {\n" | |
193 " \"name\": \"BRF\",\n" | |
194 " \"args\": [ { \"name\": \"freq\", \"type\": \"frequency\" }, \"rq\" ]\n" | |
195 " },\n" | |
196 " {\n" | |
197 " \"name\": \"RLPF\",\n" | |
198 " \"args\": [ { \"name\": \"freq\", \"type\": \"frequency\" }, \"rq\" ]\n" | |
199 " },\n" | |
200 " {\n" | |
201 " \"name\": \"RHPF\",\n" | |
202 " \"args\": [ { \"name\": \"freq\", \"type\": \"frequency\" }, \"rq\" ]\n" | |
203 " },\n" | |
204 " {\n" | |
205 " \"name\": \"Resonz\",\n" | |
206 " \"args\": [ { \"name\": \"freq\", \"type\": \"frequency\" }, \"bwr\" ]\n" | |
207 " },\n" | |
208 " {\n" | |
209 " \"name\": \"Ringz\",\n" | |
210 " \"args\": [ \n" | |
211 " { \"name\": \"freq\", \"type\": \"frequency\" },\n" | |
212 " { \"name\": \"decaytime\", \"type\": \"time\" }\n" | |
213 " ]\n" | |
214 " },\n" | |
215 " {\n" | |
216 " \"name\": \"Formlet\",\n" | |
217 " \"args\": [\n" | |
218 " { \"name\": \"freq\", \"type\": \"frequency\" },\n" | |
219 " { \"name\": \"attacktime\", \"type\": \"time\" },\n" | |
220 " { \"name\": \"decaytime\", \"type\": \"time\" }\n" | |
221 " ]\n" | |
222 " },\n" | |
223 " {\n" | |
224 " \"name\": \"MoogFF\",\n" | |
225 " \"args\": [ \n" | |
226 " { \"name\": \"freq\", \"type\": \"frequency\" },\n" | |
227 " { \"name\": \"gain\", \"range\": [0, 4] }\n" | |
228 " ]\n" | |
229 " },\n" | |
230 " {\n" | |
231 " \"name\": \"FreeVerb\",\n" | |
232 " \"output\": \"audio\",\n" | |
233 " \"args\": [ \"mix\", \"room\", \"damp\" ]\n" | |
234 " },\n" | |
235 " // Dynamics\n" | |
236 " {\n" | |
237 " \"name\": \"Limiter\",\n" | |
238 " \"output\": \"audio\",\n" | |
239 " \"args\": \"level\"\n" | |
240 " },\n" | |
241 " {\n" | |
242 " \"name\": \"Amplitude\",\n" | |
243 " \"output\": \"control\",\n" | |
244 " \"args\": [\n" | |
245 " { \"name\": \"attackTime\", \"type\": \"time\" },\n" | |
246 " { \"name\": \"releaseTime\", \"type\": \"time\" }\n" | |
247 " ]\n" | |
248 " },\n" | |
249 " {\n" | |
250 " \"name\": \"Normalizer\",\n" | |
251 " \"output\": \"audio\",\n" | |
252 " \"args\": [ \"level\", { \"name\": \"dur\", \"range\": [0.001, 0.5] } ]\n" | |
253 " },\n" | |
254 " {\n" | |
255 " \"name\": \"Compander\",\n" | |
256 " \"output\": \"audio\",\n" | |
257 " \"args\": [ \n" | |
258 " { \"name\": \"control\", \"type\": \"audio\" },\n" | |
259 " \"thresh\",\n" | |
260 " { \"name\": \"slopeBelow\", \"type\": \"time\" },\n" | |
261 " { \"name\": \"slopeAbove\", \"type\": \"time\" },\n" | |
262 " { \"name\": \"clampTime\", \"range\": [0.001, 0.2] },\n" | |
263 " { \"name\": \"relaxTime\", \"range\": [0.001, 0.2] }\n" | |
264 " ]\n" | |
265 " },\n" | |
266 " // shifters\n" | |
267 " {\n" | |
268 " \"name\": \"FreqShift\",\n" | |
269 " \"output\": \"audio\",\n" | |
270 " \"args\": [\n" | |
271 " { \"name\": \"freq\", \"range\": [-1000, 1000] },\n" | |
272 " { \"name\": \"phase\", \"type\": \"radians\" }\n" | |
273 " ]\n" | |
274 " },\n" | |
275 " {\n" | |
276 " \"name\": \"PitchShift\",\n" | |
277 " \"output\": \"audio\",\n" | |
278 " \"args\": [\n" | |
279 " { \"name\": \"pitchRatio\", \"range\": [0, 4] },\n" | |
280 " { \"name\": \"pitchDispersion\", \"range\": [0, 4] },\n" | |
281 " { \"name\": \"timeDispersion\", \"range\": [0, 0.2] }\n" | |
282 " ]\n" | |
283 " },\n" | |
284 " // delays\n" | |
285 " {\n" | |
286 " \"name\": \"DelayC\",\n" | |
287 " \"args\": [\n" | |
288 " { \"name\": \"maxdelaytime\", \"constant\": 1 },\n" | |
289 " { \"name\": \"delaytime\", \"range\": [0.001, 1] }\n" | |
290 " ]\n" | |
291 " },\n" | |
292 " {\n" | |
293 " \"name\": \"Pluck\",\n" | |
294 " \"output\": \"audio\",\n" | |
295 " \"args\": [\n" | |
296 " { \"name\": \"trig\", \"type\": \"trigger\" },\n" | |
297 " { \"name\": \"maxdelaytime\", \"constant\": 1 },\n" | |
298 " { \"name\": \"delaytime\" },\n" | |
299 " { \"name\": \"decaytime\", \"type\": \"time\" },\n" | |
300 " { \"name\": \"coef\", \"range\": [-0.9, 0.9] }\n" | |
301 " ]\n" | |
302 " },\n" | |
303 " {\n" | |
304 " \"name\": \"CombC\",\n" | |
305 " \"args\": [\n" | |
306 " { \"name\": \"maxdelaytime\", \"constant\": 1 },\n" | |
307 " { \"name\": \"delaytime\" },\n" | |
308 " { \"name\": \"decaytime\", \"range\": [-1, 1] }\n" | |
309 " ]\n" | |
310 " },\n" | |
311 " // misc\n" | |
312 " {\n" | |
313 " \"name\": \"Decay\",\n" | |
314 " \"args\": { \"name\": \"decayTime\", \"type\": \"time\" }\n" | |
315 " },\n" | |
316 " {\n" | |
317 " \"name\": \"Latch\",\n" | |
318 " \"args\": { \"name\": \"trig\", \"type\": \"trigger\" }\n" | |
319 " }\n" | |
320 " ] // end of modifiers\n" | |
321 "}\n" | |
322 ; | |
323 | |
324 } // sc namespace |