]> git.donarmstrong.com Git - qmk_firmware.git/blob - quantum/audio/wave.h
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
[qmk_firmware.git] / quantum / audio / wave.h
1 #include <avr/io.h>
2 #include <avr/interrupt.h>
3 #include <avr/pgmspace.h>
4
5 #define SINE_LENGTH 2048
6
7 const uint8_t sinewave[] PROGMEM= //2048 values
8 {
9 0x80,0x80,0x80,0x81,0x81,0x81,0x82,0x82,
10 0x83,0x83,0x83,0x84,0x84,0x85,0x85,0x85,
11 0x86,0x86,0x87,0x87,0x87,0x88,0x88,0x88,
12 0x89,0x89,0x8a,0x8a,0x8a,0x8b,0x8b,0x8c,
13 0x8c,0x8c,0x8d,0x8d,0x8e,0x8e,0x8e,0x8f,
14 0x8f,0x8f,0x90,0x90,0x91,0x91,0x91,0x92,
15 0x92,0x93,0x93,0x93,0x94,0x94,0x95,0x95,
16 0x95,0x96,0x96,0x96,0x97,0x97,0x98,0x98,
17 0x98,0x99,0x99,0x9a,0x9a,0x9a,0x9b,0x9b,
18 0x9b,0x9c,0x9c,0x9d,0x9d,0x9d,0x9e,0x9e,
19 0x9e,0x9f,0x9f,0xa0,0xa0,0xa0,0xa1,0xa1,
20 0xa2,0xa2,0xa2,0xa3,0xa3,0xa3,0xa4,0xa4,
21 0xa5,0xa5,0xa5,0xa6,0xa6,0xa6,0xa7,0xa7,
22 0xa7,0xa8,0xa8,0xa9,0xa9,0xa9,0xaa,0xaa,
23 0xaa,0xab,0xab,0xac,0xac,0xac,0xad,0xad,
24 0xad,0xae,0xae,0xae,0xaf,0xaf,0xb0,0xb0,
25 0xb0,0xb1,0xb1,0xb1,0xb2,0xb2,0xb2,0xb3,
26 0xb3,0xb4,0xb4,0xb4,0xb5,0xb5,0xb5,0xb6,
27 0xb6,0xb6,0xb7,0xb7,0xb7,0xb8,0xb8,0xb8,
28 0xb9,0xb9,0xba,0xba,0xba,0xbb,0xbb,0xbb,
29 0xbc,0xbc,0xbc,0xbd,0xbd,0xbd,0xbe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9a,0x9a,0x99,0x99,
129 0x98,0x98,0x98,0x97,0x97,0x96,0x96,0x96,
130 0x95,0x95,0x95,0x94,0x94,0x93,0x93,0x93,
131 0x92,0x92,0x91,0x91,0x91,0x90,0x90,0x8f,
132 0x8f,0x8f,0x8e,0x8e,0x8e,0x8d,0x8d,0x8c,
133 0x8c,0x8c,0x8b,0x8b,0x8a,0x8a,0x8a,0x89,
134 0x89,0x88,0x88,0x88,0x87,0x87,0x87,0x86,
135 0x86,0x85,0x85,0x85,0x84,0x84,0x83,0x83,
136 0x83,0x82,0x82,0x81,0x81,0x81,0x80,0x80,
137 0x80,0x7f,0x7f,0x7e,0x7e,0x7e,0x7d,0x7d,
138 0x7c,0x7c,0x7c,0x7b,0x7b,0x7a,0x7a,0x7a,
139 0x79,0x79,0x78,0x78,0x78,0x77,0x77,0x77,
140 0x76,0x76,0x75,0x75,0x75,0x74,0x74,0x73,
141 0x73,0x73,0x72,0x72,0x71,0x71,0x71,0x70,
142 0x70,0x70,0x6f,0x6f,0x6e,0x6e,0x6e,0x6d,
143 0x6d,0x6c,0x6c,0x6c,0x6b,0x6b,0x6a,0x6a,
144 0x6a,0x69,0x69,0x69,0x68,0x68,0x67,0x67,
145 0x67,0x66,0x66,0x65,0x65,0x65,0x64,0x64,
146 0x64,0x63,0x63,0x62,0x62,0x62,0x61,0x61,
147 0x61,0x60,0x60,0x5f,0x5f,0x5f,0x5e,0x5e,
148 0x5d,0x5d,0x5d,0x5c,0x5c,0x5c,0x5b,0x5b,
149 0x5a,0x5a,0x5a,0x59,0x59,0x59,0x58,0x58,
150 0x58,0x57,0x57,0x56,0x56,0x56,0x55,0x55,
151 0x55,0x54,0x54,0x53,0x53,0x53,0x52,0x52,
152 0x52,0x51,0x51,0x51,0x50,0x50,0x4f,0x4f,
153 0x4f,0x4e,0x4e,0x4e,0x4d,0x4d,0x4d,0x4c,
154 0x4c,0x4b,0x4b,0x4b,0x4a,0x4a,0x4a,0x49,
155 0x49,0x49,0x48,0x48,0x48,0x47,0x47,0x47,
156 0x46,0x46,0x45,0x45,0x45,0x44,0x44,0x44,
157 0x43,0x43,0x43,0x42,0x42,0x42,0x41,0x41,
158 0x41,0x40,0x40,0x40,0x3f,0x3f,0x3f,0x3e,
159 0x3e,0x3e,0x3d,0x3d,0x3d,0x3c,0x3c,0x3c,
160 0x3b,0x3b,0x3b,0x3a,0x3a,0x3a,0x39,0x39,
161 0x39,0x38,0x38,0x38,0x37,0x37,0x37,0x36,
162 0x36,0x36,0x35,0x35,0x35,0x34,0x34,0x34,
163 0x34,0x33,0x33,0x33,0x32,0x32,0x32,0x31,
164 0x31,0x31,0x30,0x30,0x30,0x30,0x2f,0x2f,
165 0x2f,0x2e,0x2e,0x2e,0x2d,0x2d,0x2d,0x2d,
166 0x2c,0x2c,0x2c,0x2b,0x2b,0x2b,0x2a,0x2a,
167 0x2a,0x2a,0x29,0x29,0x29,0x28,0x28,0x28,
168 0x28,0x27,0x27,0x27,0x26,0x26,0x26,0x26,
169 0x25,0x25,0x25,0x25,0x24,0x24,0x24,0x23,
170 0x23,0x23,0x23,0x22,0x22,0x22,0x22,0x21,
171 0x21,0x21,0x21,0x20,0x20,0x20,0x1f,0x1f,
172 0x1f,0x1f,0x1e,0x1e,0x1e,0x1e,0x1d,0x1d,
173 0x1d,0x1d,0x1c,0x1c,0x1c,0x1c,0x1b,0x1b,
174 0x1b,0x1b,0x1b,0x1a,0x1a,0x1a,0x1a,0x19,
175 0x19,0x19,0x19,0x18,0x18,0x18,0x18,0x17,
176 0x17,0x17,0x17,0x17,0x16,0x16,0x16,0x16,
177 0x15,0x15,0x15,0x15,0x15,0x14,0x14,0x14,
178 0x14,0x14,0x13,0x13,0x13,0x13,0x13,0x12,
179 0x12,0x12,0x12,0x12,0x11,0x11,0x11,0x11,
180 0x11,0x10,0x10,0x10,0x10,0x10,0xf,0xf,
181 0xf,0xf,0xf,0xf,0xe,0xe,0xe,0xe,
182 0xe,0xd,0xd,0xd,0xd,0xd,0xd,0xc,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5,0x5,0x5,0x5,0x5,0x5,0x5,
213 0x5,0x6,0x6,0x6,0x6,0x6,0x6,0x6,
214 0x6,0x7,0x7,0x7,0x7,0x7,0x7,0x7,
215 0x7,0x8,0x8,0x8,0x8,0x8,0x8,0x8,
216 0x9,0x9,0x9,0x9,0x9,0x9,0x9,0xa,
217 0xa,0xa,0xa,0xa,0xa,0xa,0xb,0xb,
218 0xb,0xb,0xb,0xb,0xc,0xc,0xc,0xc,
219 0xc,0xc,0xd,0xd,0xd,0xd,0xd,0xd,
220 0xe,0xe,0xe,0xe,0xe,0xf,0xf,0xf,
221 0xf,0xf,0xf,0x10,0x10,0x10,0x10,0x10,
222 0x11,0x11,0x11,0x11,0x11,0x12,0x12,0x12,
223 0x12,0x12,0x13,0x13,0x13,0x13,0x13,0x14,
224 0x14,0x14,0x14,0x14,0x15,0x15,0x15,0x15,
225 0x15,0x16,0x16,0x16,0x16,0x17,0x17,0x17,
226 0x17,0x17,0x18,0x18,0x18,0x18,0x19,0x19,
227 0x19,0x19,0x1a,0x1a,0x1a,0x1a,0x1b,0x1b,
228 0x1b,0x1b,0x1b,0x1c,0x1c,0x1c,0x1c,0x1d,
229 0x1d,0x1d,0x1d,0x1e,0x1e,0x1e,0x1e,0x1f,
230 0x1f,0x1f,0x1f,0x20,0x20,0x20,0x21,0x21,
231 0x21,0x21,0x22,0x22,0x22,0x22,0x23,0x23,
232 0x23,0x23,0x24,0x24,0x24,0x25,0x25,0x25,
233 0x25,0x26,0x26,0x26,0x26,0x27,0x27,0x27,
234 0x28,0x28,0x28,0x28,0x29,0x29,0x29,0x2a,
235 0x2a,0x2a,0x2a,0x2b,0x2b,0x2b,0x2c,0x2c,
236 0x2c,0x2d,0x2d,0x2d,0x2d,0x2e,0x2e,0x2e,
237 0x2f,0x2f,0x2f,0x30,0x30,0x30,0x30,0x31,
238 0x31,0x31,0x32,0x32,0x32,0x33,0x33,0x33,
239 0x34,0x34,0x34,0x34,0x35,0x35,0x35,0x36,
240 0x36,0x36,0x37,0x37,0x37,0x38,0x38,0x38,
241 0x39,0x39,0x39,0x3a,0x3a,0x3a,0x3b,0x3b,
242 0x3b,0x3c,0x3c,0x3c,0x3d,0x3d,0x3d,0x3e,
243 0x3e,0x3e,0x3f,0x3f,0x3f,0x40,0x40,0x40,
244 0x41,0x41,0x41,0x42,0x42,0x42,0x43,0x43,
245 0x43,0x44,0x44,0x44,0x45,0x45,0x45,0x46,
246 0x46,0x47,0x47,0x47,0x48,0x48,0x48,0x49,
247 0x49,0x49,0x4a,0x4a,0x4a,0x4b,0x4b,0x4b,
248 0x4c,0x4c,0x4d,0x4d,0x4d,0x4e,0x4e,0x4e,
249 0x4f,0x4f,0x4f,0x50,0x50,0x51,0x51,0x51,
250 0x52,0x52,0x52,0x53,0x53,0x53,0x54,0x54,
251 0x55,0x55,0x55,0x56,0x56,0x56,0x57,0x57,
252 0x58,0x58,0x58,0x59,0x59,0x59,0x5a,0x5a,
253 0x5a,0x5b,0x5b,0x5c,0x5c,0x5c,0x5d,0x5d,
254 0x5d,0x5e,0x5e,0x5f,0x5f,0x5f,0x60,0x60,
255 0x61,0x61,0x61,0x62,0x62,0x62,0x63,0x63,
256 0x64,0x64,0x64,0x65,0x65,0x65,0x66,0x66,
257 0x67,0x67,0x67,0x68,0x68,0x69,0x69,0x69,
258 0x6a,0x6a,0x6a,0x6b,0x6b,0x6c,0x6c,0x6c,
259 0x6d,0x6d,0x6e,0x6e,0x6e,0x6f,0x6f,0x70,
260 0x70,0x70,0x71,0x71,0x71,0x72,0x72,0x73,
261 0x73,0x73,0x74,0x74,0x75,0x75,0x75,0x76,
262 0x76,0x77,0x77,0x77,0x78,0x78,0x78,0x79,
263 0x79,0x7a,0x7a,0x7a,0x7b,0x7b,0x7c,0x7c,
264 0x7c,0x7d,0x7d,0x7e,0x7e,0x7e,0x7f,0x7f
265 };