aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mdaEPiano.cpp13
-rw-r--r--src/mdaEPiano.h1
-rw-r--r--src/mdaPiano.cpp12
-rw-r--r--src/mdaPiano.h1
4 files changed, 20 insertions, 7 deletions
diff --git a/src/mdaEPiano.cpp b/src/mdaEPiano.cpp
index 3aa101a..ece9a94 100644
--- a/src/mdaEPiano.cpp
+++ b/src/mdaEPiano.cpp
@@ -169,12 +169,17 @@ void mdaEPiano::update() //parameter change
}
-void mdaEPiano::resume()
+void mdaEPiano::setSampleRate(float rate)
{
- Fs = getSampleRate();
- iFs = 1.0f / Fs;
- dlfo = 6.283f * iFs * (float)exp(6.22f * programs[curProgram].param[5] - 2.61f); //lfo rate
+ AudioEffectX::setSampleRate(rate);
+ Fs = rate;
+ iFs = 1.0f / Fs;
+ dlfo = 6.283f * iFs * (float)exp(6.22f * programs[curProgram].param[5] - 2.61f); //lfo rate
+}
+
+void mdaEPiano::resume()
+{
DECLARE_LVZ_DEPRECATED (wantEvents) ();
}
diff --git a/src/mdaEPiano.h b/src/mdaEPiano.h
index 41d0fb0..ffa238f 100644
--- a/src/mdaEPiano.h
+++ b/src/mdaEPiano.h
@@ -86,6 +86,7 @@ public:
virtual void getParameterLabel(int32_t index, char *label);
virtual void getParameterDisplay(int32_t index, char *text);
virtual void getParameterName(int32_t index, char *text);
+ virtual void setSampleRate(float sampleRate);
virtual void setBlockSize(int32_t blockSize);
virtual void resume();
diff --git a/src/mdaPiano.cpp b/src/mdaPiano.cpp
index f207079..3a05fbe 100644
--- a/src/mdaPiano.cpp
+++ b/src/mdaPiano.cpp
@@ -145,11 +145,17 @@ void mdaPiano::update() //parameter change
}
+void mdaPiano::setSampleRate(float rate)
+{
+ AudioEffectX::setSampleRate(rate);
+ Fs = rate;
+ iFs = 1.0f / Fs;
+ if(Fs > 64000.0f) cmax = 0xFF; else cmax = 0x7F;
+}
+
+
void mdaPiano::resume()
{
- Fs = getSampleRate();
- iFs = 1.0f / Fs;
- if(Fs > 64000.0f) cmax = 0xFF; else cmax = 0x7F;
memset(comb, 0, sizeof(float) * 256);
DECLARE_LVZ_DEPRECATED (wantEvents) ();
diff --git a/src/mdaPiano.h b/src/mdaPiano.h
index bd6f82a..012fcee 100644
--- a/src/mdaPiano.h
+++ b/src/mdaPiano.h
@@ -90,6 +90,7 @@ public:
virtual void getParameterLabel(int32_t index, char *label);
virtual void getParameterDisplay(int32_t index, char *text);
virtual void getParameterName(int32_t index, char *text);
+ virtual void setSampleRate(float sampleRate);
virtual void setBlockSize(int32_t blockSize);
virtual void resume();