commit 87881745715816f6849974dd34a834f5c91cc3a5
parent ab615e5b889eaa6f10d013b24cca4edc17b3d8cd
Author: Matt Demanett <matt@demanett.net>
Date: Mon, 26 Feb 2018 21:59:07 -0500
Trivial waveshaping experiment.
Diffstat:
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/Test.cpp b/src/Test.cpp
@@ -35,6 +35,10 @@ void Test::step() {
_sine.setFrequency(oscillatorPitch());
outputs[OUT_OUTPUT].value = _sine.next();
+ _sine2.setSampleRate(engineGetSampleRate());
+ _sine2.setFrequency(oscillatorPitch());
+ outputs[OUT2_OUTPUT].value = 5.0f * powf(_sine2.next(), 5.0f);
+
#elif SQUARE
_square.setSampleRate(engineGetSampleRate());
_square.setFrequency(oscillatorPitch());
diff --git a/src/Test.hpp b/src/Test.hpp
@@ -6,12 +6,12 @@ extern Model* modelTest;
// #define LPF 1
// #define LPFNOISE 1
-// #define SINE 1
+#define SINE 1
// #define SQUARE 1
// #define SAW 1
// #define TRIANGLE 1
// #define SINEBANK 1
-#define OVERSAMPLING 1
+// #define OVERSAMPLING 1
#include "pitch.hpp"
#ifdef LPF
@@ -74,6 +74,7 @@ struct Test : Module {
LowPassFilter _lpf;
#elif SINE
SineOscillator _sine;
+ SineOscillator _sine2;
#elif SQUARE
SquareOscillator _square;
#elif SAW
@@ -98,6 +99,7 @@ struct Test : Module {
, _lpf(44100.0, 1000.0, 1.0)
#elif SINE
, _sine(44100.0, 1000.0, 5.0)
+ , _sine2(44100.0, 1000.0, 1.0, M_PI/1.0f)
#elif SQUARE
, _square(44100.0, 1000.0, 5.0)
#elif SAW