wavetables

A collection of wavetables

Negative exponential

See explanation: https://en.wikipedia.org/wiki/Exponentiation#Negative_exponents

This shape could be used for a clap envelope.

Formula

y = b^-x

x being between 0 and 1.

Method

I used Excel to run this formula to generate 257 values:

=ROUND((A1^-0.5)*32767,0)
  • Column A being numbers from 1 to 257.
  • Column B begin this formula.
  • The number 32767 is the maximum value I wanted the wavetable to be filled with.

Then I just copied column B in my code and added commas.

Wavetable

const int16_t customWaveform[257] = {
32767, 23170, 18918, 16384, 14654, 13377, 12385, 11585, 10922, 10362,
9880, 9459, 9088, 8757, 8460, 8192, 7947, 7723, 7517, 7327,
7150, 6986, 6832, 6689, 6553, 6426, 6306, 6192, 6085, 5982,
5885, 5792, 5704, 5619, 5539, 5461, 5387, 5316, 5247, 5181,
5117, 5056, 4997, 4940, 4885, 4831, 4780, 4730, 4681, 4634,
4588, 4544, 4501, 4459, 4418, 4379, 4340, 4303, 4266, 4230,
4195, 4161, 4128, 4096, 4064, 4033, 4003, 3974, 3945, 3916,
3889, 3862, 3835, 3809, 3784, 3759, 3734, 3710, 3687, 3663,
3641, 3619, 3597, 3575, 3554, 3533, 3513, 3493, 3473, 3454,
3435, 3416, 3398, 3380, 3362, 3344, 3327, 3310, 3293, 3277,
3260, 3244, 3229, 3213, 3198, 3183, 3168, 3153, 3139, 3124,
3110, 3096, 3082, 3069, 3056, 3042, 3029, 3016, 3004, 2991,
2979, 2967, 2955, 2943, 2931, 2919, 2908, 2896, 2885, 2874,
2863, 2852, 2841, 2831, 2820, 2810, 2799, 2789, 2779, 2769,
2759, 2750, 2740, 2731, 2721, 2712, 2703, 2693, 2684, 2675,
2667, 2658, 2649, 2640, 2632, 2623, 2615, 2607, 2599, 2590,
2582, 2574, 2567, 2559, 2551, 2543, 2536, 2528, 2521, 2513,
2506, 2498, 2491, 2484, 2477, 2470, 2463, 2456, 2449, 2442,
2436, 2429, 2422, 2416, 2409, 2403, 2396, 2390, 2383, 2377,
2371, 2365, 2359, 2353, 2346, 2341, 2335, 2329, 2323, 2317,
2311, 2305, 2300, 2294, 2289, 2283, 2277, 2272, 2267, 2261,
2256, 2250, 2245, 2240, 2235, 2230, 2224, 2219, 2214, 2209,
2204, 2199, 2194, 2189, 2184, 2180, 2175, 2170, 2165, 2161,
2156, 2151, 2147, 2142, 2137, 2133, 2128, 2124, 2120, 2115,
2111, 2106, 2102, 2098, 2093, 2089, 2085, 2081, 2077, 2072,
2068, 2064, 2060, 2056, 2052, 2048, 0
};