From a349cbed67999abed2871189be58e8198c02edce Mon Sep 17 00:00:00 2001 From: rkcf Date: Mon, 27 Feb 2023 15:07:56 -0600 Subject: [PATCH] Refactor: Move application out of main and into temp testing file Closes: #17 Refs: #17 --- src/wtpp.cpp | 56 +--------------------------------------------------- 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/src/wtpp.cpp b/src/wtpp.cpp index a7bcd05..e32c011 100644 --- a/src/wtpp.cpp +++ b/src/wtpp.cpp @@ -1,60 +1,6 @@ -#include -#include -#include - -#include - -#include "ini.h" - -#include "common.h" -#include "wave.h" -#include "generators.h" -#include "wavetable.h" +#include 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 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; }