cleanup oscillators

This commit is contained in:
2026-01-17 21:41:37 -06:00
parent be8cb0f890
commit c199a9b42f
6 changed files with 157 additions and 29 deletions

View File

@@ -0,0 +1,34 @@
#pragma once
#include <array>
#include <vector>
#define SYNTH_WAVETABLE_SIZE 2048
#ifndef M_PI // I hate my stupid chungus life
#define M_PI 3.14159265358979323846
#endif
typedef std::array<float, SYNTH_WAVETABLE_SIZE> Wavetable;
class WavetableController {
private:
/* data */
public:
WavetableController();
~WavetableController() = default;
void init();
// phase = [0, 2pi)
float sample(uint8_t wavetableIndex, float phase);
private:
std::vector<Wavetable> wavetables_;
};