diff --git a/src/wavetable.h b/src/wavetable.h index 4e48506..6b462bf 100644 --- a/src/wavetable.h +++ b/src/wavetable.h @@ -26,12 +26,8 @@ private: public: const uint16_t m_cid; /*!< Unique ID of NEXT wavetable */ - Wavetable(std::string name) : m_cid(m_nid++) - { - m_name = name; - /* Initialize table of Waves */ - wave_table_t wt; - } + Wavetable(std::string name, wave_table_t wt) + : m_name{name}, m_wave_table{wt}, m_cid(m_nid++) {} /*! ID getter */ uint16_t getId() { return m_cid; } diff --git a/src/wtpp.cpp b/src/wtpp.cpp index e6150ab..bc65bfb 100644 --- a/src/wtpp.cpp +++ b/src/wtpp.cpp @@ -52,8 +52,9 @@ int main() log("Printing head of inverse saw table"); isaw_wave.print_head(); - // Create Wavetable object containing fundamental Wave objects - Wavetable wt_01{"Fundamental Waves"}; + // Create wave table of all fundamental Wave objects + wave_table_t fundies = {sin_wave, squ_wave, saw_wave, tri_wave, isaw_wave}; + Wavetable wt_01{"Fundamental Waves", fundies}; log(wt_01.name()); return 0;