Refactor: Move application out of main and into temp testing file

Closes: #17

Refs: #17
pull/20/head
rkcf 2023-02-27 15:07:56 -06:00
parent 36dc4a1e3d
commit a349cbed67
1 changed files with 1 additions and 55 deletions

View File

@ -1,60 +1,6 @@
#include <array> #include <iostream>
#include <cstdint>
#include <type_traits>
#include <math.h>
#include "ini.h"
#include "common.h"
#include "wave.h"
#include "generators.h"
#include "wavetable.h"
int main() int main()
{ {
clog("Generating wave cycle lookup tables");
Wave sin_wave, squ_wave, saw_wave, tri_wave, isaw_wave;
// Calculate fundamental wave values
sample_table_t sin_vals = gen_sin();
sample_table_t squ_vals = gen_squ();
sample_table_t saw_vals = gen_saw();
sample_table_t tri_vals = gen_tri();
sample_table_t isaw_vals = gen_isaw();
// Set wave lookup table values
sin_wave.setTable(sin_vals);
squ_wave.setTable(squ_vals);
saw_wave.setTable(saw_vals);
tri_wave.setTable(tri_vals);
isaw_wave.setTable(isaw_vals);
clog("Printing head of sine table");
sin_wave.print_head();
clog("Printing head of square table");
squ_wave.print_head();
clog("Printing head of saw table");
saw_wave.print_head();
clog("Printing head of triangle table");
tri_wave.print_head();
clog("Printing head of inverse saw table");
isaw_wave.print_head();
Wavetable wt_01{"Fundamental Waves"};
clog(wt_01.name());
// Add fundamental waves to wt_01
std::array<Wave, 5> fundies = {sin_wave, squ_wave, saw_wave, tri_wave, isaw_wave};
for (uint8_t i = 0; i < 5; i++){
wt_01.setWave(i, fundies[i]);
}
// Write sine wave table to file
sin_wave.export_csv("data/sine.csv");
// Write full Wavetable data to file
wt_01.export_csv("data");
return 0; return 0;
} }