Files
metabalus/src/synth/WavetableController.h
2026-01-22 22:59:28 -06:00

36 lines
540 B
C++

#pragma once
#include <array>
#include <vector>
#include <cstdint>
#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_;
};