Fix: Wavetable not initializing with fundamental Waves

main
rkcf 2023-02-27 08:59:12 -06:00
parent 6ba6d6b09e
commit 59d504adf0
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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<Wave, 5> 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<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");