diff options
| author | mick <mickgrierson@gmail.com> | 2014-10-15 10:14:02 +0100 |
|---|---|---|
| committer | mick <mickgrierson@gmail.com> | 2014-10-15 10:14:02 +0100 |
| commit | bbe04a0f9254e81ca6be8a23164fb3e8743e6c82 (patch) | |
| tree | d47bf6cbc9d23da2f41c15da94a8977fe1d10218 /maximilian.cpp | |
| parent | a38ec23a22a45f7fd902f97e5fe38c9f1a7fb6e6 (diff) | |
bug fixes that I should have done last year
arg
Diffstat (limited to 'maximilian.cpp')
| -rw-r--r-- | maximilian.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/maximilian.cpp b/maximilian.cpp index e89a8b7..eff0fe8 100644 --- a/maximilian.cpp +++ b/maximilian.cpp @@ -368,7 +368,7 @@ double maxiEnvelope::line(int numberofsegments,double segments[1000]) { //This is a basic multi-segment ramp generator that you can use for more or less anything. //However, it's not that intuitive. if (isPlaying==1) {//only make a sound once you've been triggered - period=2./(segments[valindex+1]*0.004); + period=4./(segments[valindex+1]*0.0044); nextval=segments[valindex+2]; currentval=segments[valindex]; if (currentval-amplitude > 0.0000001 && valindex < numberofsegments) { @@ -440,9 +440,9 @@ double maxiFilter::hipass(double input, double cutoff) { } //awesome. cuttof is freq in hz. res is between 1 and whatever. Watch out! double maxiFilter::lores(double input,double cutoff1, double resonance) { - cutoff=cutoff1*0.5; + cutoff=cutoff1; if (cutoff<10) cutoff=10; - if (cutoff>(maxiSettings::sampleRate*0.5)) cutoff=(maxiSettings::sampleRate*0.5); + if (cutoff>(maxiSettings::sampleRate)) cutoff=(maxiSettings::sampleRate); if (resonance<1.) resonance = 1.; z=cos(TWOPI*cutoff/maxiSettings::sampleRate); c=2-2*z; @@ -456,9 +456,9 @@ double maxiFilter::lores(double input,double cutoff1, double resonance) { //working hires filter double maxiFilter::hires(double input,double cutoff1, double resonance) { - cutoff=cutoff1*0.5; + cutoff=cutoff1; if (cutoff<10) cutoff=10; - if (cutoff>(maxiSettings::sampleRate*0.5)) cutoff=(maxiSettings::sampleRate*0.5); + if (cutoff>(maxiSettings::sampleRate)) cutoff=(maxiSettings::sampleRate); if (resonance<1.) resonance = 1.; z=cos(TWOPI*cutoff/maxiSettings::sampleRate); c=2-2*z; @@ -1202,7 +1202,7 @@ double maxiEnv::ar(double input, double attack, double release, long holdtime, i return output; } -/* and here's a new adsr. It's not bad, very simple to use*/ +/* adsr. It's not bad, very simple to use*/ double maxiEnv::adsr(double input, double attack, double decay, double sustain, double release, long holdtime, int trigger) { |
