Fix: Wavetable wave_table initialization
parent
916f874a8f
commit
23cfca8ccf
|
|
@ -26,12 +26,8 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const uint16_t m_cid; /*!< Unique ID of NEXT wavetable */
|
const uint16_t m_cid; /*!< Unique ID of NEXT wavetable */
|
||||||
Wavetable(std::string name) : m_cid(m_nid++)
|
Wavetable(std::string name, wave_table_t wt)
|
||||||
{
|
: m_name{name}, m_wave_table{wt}, m_cid(m_nid++) {}
|
||||||
m_name = name;
|
|
||||||
/* Initialize table of Waves */
|
|
||||||
wave_table_t wt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! ID getter */
|
/*! ID getter */
|
||||||
uint16_t getId() { return m_cid; }
|
uint16_t getId() { return m_cid; }
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,9 @@ int main()
|
||||||
log("Printing head of inverse saw table");
|
log("Printing head of inverse saw table");
|
||||||
isaw_wave.print_head();
|
isaw_wave.print_head();
|
||||||
|
|
||||||
// Create Wavetable object containing fundamental Wave objects
|
// Create wave table of all fundamental Wave objects
|
||||||
Wavetable wt_01{"Fundamental Waves"};
|
wave_table_t fundies = {sin_wave, squ_wave, saw_wave, tri_wave, isaw_wave};
|
||||||
|
Wavetable wt_01{"Fundamental Waves", fundies};
|
||||||
log(wt_01.name());
|
log(wt_01.name());
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue