aboutsummaryrefslogtreecommitdiff
path: root/quantum/audio/luts.c
diff options
context:
space:
mode:
authorIBNobody <IBNobody@users.noreply.github.com>2016-05-03 12:56:40 -0500
committerJack Humbert <jack.humb@gmail.com>2016-05-03 13:56:40 -0400
commit83e1cc241e3aabd69f6cdcd2581477d4b85bb8d3 (patch)
treefd0c9714f93e1afec478ddc42a86a6823136ad5f /quantum/audio/luts.c
parent2c070163ffffffde546fb00acaa2fbb96b93da64 (diff)
downloadqmk_firmware-83e1cc241e3aabd69f6cdcd2581477d4b85bb8d3.tar.gz
qmk_firmware-83e1cc241e3aabd69f6cdcd2581477d4b85bb8d3.zip
Clarified audio.c (#302)
* Updated personal layouts * tweaked personal * Nightly - Audio Cleanup Refactored the LUTs. Abstracted some of the registers out of audio to use more functional names. Split audio into audio and audio_pwm. WIP * nightly - collapsed code * Added check for note playing to LEDs
Diffstat (limited to 'quantum/audio/luts.c')
-rw-r--r--quantum/audio/luts.c382
1 files changed, 382 insertions, 0 deletions
diff --git a/quantum/audio/luts.c b/quantum/audio/luts.c
new file mode 100644
index 000000000..9f3de9a05
--- /dev/null
+++ b/quantum/audio/luts.c
@@ -0,0 +1,382 @@
1#include <avr/io.h>
2#include <avr/interrupt.h>
3#include <avr/pgmspace.h>
4#include "luts.h"
5
6const float vibrato_lut[VIBRATO_LUT_LENGTH] =
7{
8 1.0022336811487,
9 1.0042529943610,
10 1.0058584256028,
11 1.0068905285205,
12 1.0072464122237,
13 1.0068905285205,
14 1.0058584256028,
15 1.0042529943610,
16 1.0022336811487,
17 1.0000000000000,
18 0.9977712970630,
19 0.9957650169978,
20 0.9941756956510,
21 0.9931566259436,
22 0.9928057204913,
23 0.9931566259436,
24 0.9941756956510,
25 0.9957650169978,
26 0.9977712970630,
27 1.0000000000000,
28};
29
30const uint16_t frequency_lut[FREQUENCY_LUT_LENGTH] =
31{
32 0x8E0B,
33 0x8C02,
34 0x8A00,
35 0x8805,
36 0x8612,
37 0x8426,
38 0x8241,
39 0x8063,
40 0x7E8C,
41 0x7CBB,
42 0x7AF2,
43 0x792E,
44 0x7772,
45 0x75BB,
46 0x740B,
47 0x7261,
48 0x70BD,
49 0x6F20,
50 0x6D88,
51 0x6BF6,
52 0x6A69,
53 0x68E3,
54 0x6762,
55 0x65E6,
56 0x6470,
57 0x6300,
58 0x6194,
59 0x602E,
60 0x5ECD,
61 0x5D71,
62 0x5C1A,
63 0x5AC8,
64 0x597B,
65 0x5833,
66 0x56EF,
67 0x55B0,
68 0x5475,
69 0x533F,
70 0x520E,
71 0x50E1,
72 0x4FB8,
73 0x4E93,
74 0x4D73,
75 0x4C57,
76 0x4B3E,
77 0x4A2A,
78 0x491A,
79 0x480E,
80 0x4705,
81 0x4601,
82 0x4500,
83 0x4402,
84 0x4309,
85 0x4213,
86 0x4120,
87 0x4031,
88 0x3F46,
89 0x3E5D,
90 0x3D79,
91 0x3C97,
92 0x3BB9,
93 0x3ADD,
94 0x3A05,
95 0x3930,
96 0x385E,
97 0x3790,
98 0x36C4,
99 0x35FB,
100 0x3534,
101 0x3471,
102 0x33B1,
103 0x32F3,
104 0x3238,
105 0x3180,
106 0x30CA,
107 0x3017,
108 0x2F66,
109 0x2EB8,
110 0x2E0D,
111 0x2D64,
112 0x2CBD,
113 0x2C19,
114 0x2B77,
115 0x2AD8,
116 0x2A3A,
117 0x299F,
118 0x2907,
119 0x2870,
120 0x27DC,
121 0x2749,
122 0x26B9,
123 0x262B,
124 0x259F,
125 0x2515,
126 0x248D,
127 0x2407,
128 0x2382,
129 0x2300,
130 0x2280,
131 0x2201,
132 0x2184,
133 0x2109,
134 0x2090,
135 0x2018,
136 0x1FA3,
137 0x1F2E,
138 0x1EBC,
139 0x1E4B,
140 0x1DDC,
141 0x1D6E,
142 0x1D02,
143 0x1C98,
144 0x1C2F,
145 0x1BC8,
146 0x1B62,
147 0x1AFD,
148 0x1A9A,
149 0x1A38,
150 0x19D8,
151 0x1979,
152 0x191C,
153 0x18C0,
154 0x1865,
155 0x180B,
156 0x17B3,
157 0x175C,
158 0x1706,
159 0x16B2,
160 0x165E,
161 0x160C,
162 0x15BB,
163 0x156C,
164 0x151D,
165 0x14CF,
166 0x1483,
167 0x1438,
168 0x13EE,
169 0x13A4,
170 0x135C,
171 0x1315,
172 0x12CF,
173 0x128A,
174 0x1246,
175 0x1203,
176 0x11C1,
177 0x1180,
178 0x1140,
179 0x1100,
180 0x10C2,
181 0x1084,
182 0x1048,
183 0x100C,
184 0xFD1,
185 0xF97,
186 0xF5E,
187 0xF25,
188 0xEEE,
189 0xEB7,
190 0xE81,
191 0xE4C,
192 0xE17,
193 0xDE4,
194 0xDB1,
195 0xD7E,
196 0xD4D,
197 0xD1C,
198 0xCEC,
199 0xCBC,
200 0xC8E,
201 0xC60,
202 0xC32,
203 0xC05,
204 0xBD9,
205 0xBAE,
206 0xB83,
207 0xB59,
208 0xB2F,
209 0xB06,
210 0xADD,
211 0xAB6,
212 0xA8E,
213 0xA67,
214 0xA41,
215 0xA1C,
216 0x9F7,
217 0x9D2,
218 0x9AE,
219 0x98A,
220 0x967,
221 0x945,
222 0x923,
223 0x901,
224 0x8E0,
225 0x8C0,
226 0x8A0,
227 0x880,
228 0x861,
229 0x842,
230 0x824,
231 0x806,
232 0x7E8,
233 0x7CB,
234 0x7AF,
235 0x792,
236 0x777,
237 0x75B,
238 0x740,
239 0x726,
240 0x70B,
241 0x6F2,
242 0x6D8,
243 0x6BF,
244 0x6A6,
245 0x68E,
246 0x676,
247 0x65E,
248 0x647,
249 0x630,
250 0x619,
251 0x602,
252 0x5EC,
253 0x5D7,
254 0x5C1,
255 0x5AC,
256 0x597,
257 0x583,
258 0x56E,
259 0x55B,
260 0x547,
261 0x533,
262 0x520,
263 0x50E,
264 0x4FB,
265 0x4E9,
266 0x4D7,
267 0x4C5,
268 0x4B3,
269 0x4A2,
270 0x491,
271 0x480,
272 0x470,
273 0x460,
274 0x450,
275 0x440,
276 0x430,
277 0x421,
278 0x412,
279 0x403,
280 0x3F4,
281 0x3E5,
282 0x3D7,
283 0x3C9,
284 0x3BB,
285 0x3AD,
286 0x3A0,
287 0x393,
288 0x385,
289 0x379,
290 0x36C,
291 0x35F,
292 0x353,
293 0x347,
294 0x33B,
295 0x32F,
296 0x323,
297 0x318,
298 0x30C,
299 0x301,
300 0x2F6,
301 0x2EB,
302 0x2E0,
303 0x2D6,
304 0x2CB,
305 0x2C1,
306 0x2B7,
307 0x2AD,
308 0x2A3,
309 0x299,
310 0x290,
311 0x287,
312 0x27D,
313 0x274,
314 0x26B,
315 0x262,
316 0x259,
317 0x251,
318 0x248,
319 0x240,
320 0x238,
321 0x230,
322 0x228,
323 0x220,
324 0x218,
325 0x210,
326 0x209,
327 0x201,
328 0x1FA,
329 0x1F2,
330 0x1EB,
331 0x1E4,
332 0x1DD,
333 0x1D6,
334 0x1D0,
335 0x1C9,
336 0x1C2,
337 0x1BC,
338 0x1B6,
339 0x1AF,
340 0x1A9,
341 0x1A3,
342 0x19D,
343 0x197,
344 0x191,
345 0x18C,
346 0x186,
347 0x180,
348 0x17B,
349 0x175,
350 0x170,
351 0x16B,
352 0x165,
353 0x160,
354 0x15B,
355 0x156,
356 0x151,
357 0x14C,
358 0x148,
359 0x143,
360 0x13E,
361 0x13A,
362 0x135,
363 0x131,
364 0x12C,
365 0x128,
366 0x124,
367 0x120,
368 0x11C,
369 0x118,
370 0x114,
371 0x110,
372 0x10C,
373 0x108,
374 0x104,
375 0x100,
376 0xFD,
377 0xF9,
378 0xF5,
379 0xF2,
380 0xEE,
381};
382