diff --git a/src/wave.h b/src/wave.h index 5914bfc..26a2587 100644 --- a/src/wave.h +++ b/src/wave.h @@ -44,7 +44,7 @@ public: @param i index of target @return float_t value at index */ - float_t getVal(uint16_t i) { return (*m_tp+i); } + float_t getVal(uint16_t i) { return *(m_tp+i); } /*! Sample data table setter @param table Sample data table diff --git a/src/wtpp.cpp b/src/wtpp.cpp index 864c242..a7bcd05 100644 --- a/src/wtpp.cpp +++ b/src/wtpp.cpp @@ -41,11 +41,15 @@ int main() clog("Printing head of inverse saw table"); isaw_wave.print_head(); - // Create wave table of all fundamental Wave objects - std::array fundies = {sin_wave, squ_wave, saw_wave, tri_wave, isaw_wave}; 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");