Skip to content

Commit

Permalink
A quick hack to fix linker error in certain cases. The Wavetable clas…
Browse files Browse the repository at this point in the history
…s should be rewritten, or perhaps removed in favour of using LUTs in Control ROM
  • Loading branch information
skjelten committed Oct 14, 2023
1 parent decf6be commit 8476a65
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions libemusc/src/wavetable.h
Expand Up @@ -27,28 +27,6 @@

namespace EmuSC {


class Wavetable
{
public:
Wavetable(uint32_t sampleRate, bool interpolate = true);
~Wavetable();

void set_frequency(float frequency) { _frequency = frequency; }
float frequency(void) { return _frequency; }

double next_sample();

private:
Wavetable();

float _sampleFactor;

float _index;
float _frequency;

bool _interpolate; // Linear interpolation

static constexpr std::array<float, 256> _sineTable = {
0, 0.0245412, 0.0490677, 0.0735646, 0.0980171, 0.122411, 0.14673,
0.170962, 0.19509, 0.219101, 0.24298, 0.266713, 0.290285, 0.313682, 0.33689,
Expand Down Expand Up @@ -83,6 +61,28 @@ class Wavetable
-0.382683, -0.359895, -0.33689, -0.313682, -0.290285, -0.266713, -0.24298, -0.219101,
-0.19509, -0.170962, -0.14673, -0.122411, -0.0980172, -0.0735646, -0.0490676, -0.0245411 };


class Wavetable
{
public:
Wavetable(uint32_t sampleRate, bool interpolate = true);
~Wavetable();

void set_frequency(float frequency) { _frequency = frequency; }
float frequency(void) { return _frequency; }

double next_sample();

private:
Wavetable();

float _sampleFactor;

float _index;
float _frequency;

bool _interpolate; // Linear interpolation

};

}
Expand Down

0 comments on commit 8476a65

Please sign in to comment.