Browse Source

Removed old - oscillator.cpp

akshaycadambi 5 years ago
parent
commit
994faca756
2 changed files with 0 additions and 82 deletions
  1. 0 40
      oscillator.cpp
  2. 0 42
      oscillator.h

+ 0 - 40
oscillator.cpp

@@ -1,40 +0,0 @@
-#include <iostream>
-#include "oscillator.h"
-#include "math.h"
-
-double oscillator::WavetableSynth::freqMod(float freq)
-{
-    phase_inc = floor( frequency * (double) Tables::table_length() / SystemSR );
-    return this->tick();
-}
-
-double oscillator::WavetableSynth::tick()
-{
-    current_phase += phase_inc;
-    current_phase = current_phase & Tables::phase_mask();
-    return *(tbl + current_phase - phase_inc);
-}
-
-void oscillator::WavetableSynth::setFreq(float freq)
-{
-    frequency = freq;
-    phase_inc = lrint( frequency * (double) Tables::table_length() / SystemSR );
-}
-
-oscillator::WavetableSynth::WavetableSynth()
-{
-    current_phase = 0;
-    tbl = NULL;
-}
-
-oscillator::Sine::Sine(float freq)
-{
-    setFreq(freq);
-    tbl = Tables::sine();
-}
-
-oscillator::Saw::Saw(float freq)
-{
-    setFreq(freq);
-    tbl = Tables::saw();
-}

+ 0 - 42
oscillator.h

@@ -1,42 +0,0 @@
-#ifndef OSCILLATOR
-#define OSCILLATOR
-
-#include <inttypes.h>
-#include <cstdlib>
-#include "table.h"
-#include "math.h"
-
-namespace oscillator{
-
-class WavetableSynth
-    {
-    public:
-        float frequency;
-        float phase;
-        int current_phase;
-        int phase_inc;
-        double *tbl;
-
-        WavetableSynth();
-        void setFreq(float freq);
-        double tick();
-        double freqMod(float freq);
-
-    protected:
-    };
-
-class Sine : public WavetableSynth
-    {
-    public:
-        Sine(float freq);
-    };
-
-class Saw: public WavetableSynth
-    {
-    public:
-        Saw(float freq);
-    };
-
-}
-
-#endif // OSCILLATOR