diff options
| author | mick grierson <mickgrierson@gmail.com> | 2016-12-19 22:35:23 +0000 |
|---|---|---|
| committer | mick grierson <mickgrierson@gmail.com> | 2016-12-19 22:35:23 +0000 |
| commit | cfb9046eec768c76baa4c0711870bb255c86ef4a (patch) | |
| tree | 0fdfcc93fe645e3f54662bf59d3fefb7f337c60c /maximilian.h | |
| parent | 17fd15bf2e9cf1163d40d98286abd60378fd9df9 (diff) | |
Fixing errors in new envelope functions. maxiEnvelope now has a ramp function, a ramps function that takes time / value pairs from a std::vector, an adsr and ar that all sync directly to the samplerate. They all take params in seconds. This makes it easier for javascript users when I transpile with emscripten. Wait what?
Diffstat (limited to 'maximilian.h')
| -rwxr-xr-x | maximilian.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/maximilian.h b/maximilian.h index fa53428..54dec4b 100755 --- a/maximilian.h +++ b/maximilian.h @@ -109,27 +109,29 @@ public: class maxiEnvelope { - double period; + double period=0; double output; double phase; double startVal; double endVal; double currentval; double nextval; + bool noteOn; bool releaseMode; bool decayMode; bool sustainMode; - bool attackMode=true; + bool attackMode; int isPlaying; public: - int trigger=1; + int trigger; double line(int numberofsegments,double segments[100]); - double ramp(double startVal=0, double endVal=1, double duration=1, int trigger=1); - double ramps(double rampsArray[1000], int trigger=1); - double ar(double attack=0.1, double release=0.1,int trigger=1); - double adsr(double attack=0.1, double decay=0.1, double sustain=0.1, double release=0.1,int trigger=1); + double ramp(double startVal=0, double endVal=1, double duration=1); + double ramps(std::vector<double> rampsArray); + double ar(double attack=0.1, double release=0.1); + double adsr(double attack=0.1, double decay=0.1, double sustain=0.1, double release=0.1); // void trigger(int index,double amp); + void note(bool noteOn=false); int valindex; double amplitude; |
