checkpoint
This commit is contained in:
@@ -16,6 +16,14 @@ WavetableController::WavetableController() {
|
||||
|
||||
void WavetableController::init() {
|
||||
|
||||
// find number of wavetable files
|
||||
std::vector<std::filesystem::path> wavetableFiles;
|
||||
for(std::filesystem::directory_entry entry : std::filesystem::directory_iterator(wavetablesRoot_)) {
|
||||
if(std::filesystem::is_regular_file(entry.status())) {
|
||||
wavetableFiles.push_back(entry.path());
|
||||
}
|
||||
}
|
||||
|
||||
wavetables_.resize(4); // resize for however many files we find
|
||||
|
||||
// wavetable file structure is best explained in scripts/generate_wavetable.py
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
|
||||
#define SYNTH_WAVETABLE_SIZE 2048
|
||||
#ifndef M_PI // I hate my stupid chungus life
|
||||
@@ -30,6 +31,8 @@ private:
|
||||
|
||||
std::vector<Wavetable> wavetables_;
|
||||
|
||||
const std::filesystem::path wavetablesRoot_ = "./config/wavetables";
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user