diff options
author | David Robillard <d@drobilla.net> | 2013-02-23 03:07:31 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-02-23 03:07:31 +0000 |
commit | 0fcfb78675cfa596d84f5ca47d9f4d6edb366266 (patch) | |
tree | 44d44b24ce7d8caace3f98ac1b6767d288af2898 /src/mdaEPiano.cpp | |
parent | 6d5085640d4fa0648fd8f0d1971f4500570431f8 (diff) | |
download | mda.lv2-0fcfb78675cfa596d84f5ca47d9f4d6edb366266.tar.gz mda.lv2-0fcfb78675cfa596d84f5ca47d9f4d6edb366266.tar.bz2 mda.lv2-0fcfb78675cfa596d84f5ca47d9f4d6edb366266.zip |
Fix tuning of Piano and EPiano at sample rates other than 44.1 kHz.
git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/mda.lv2@5068 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/mdaEPiano.cpp')
-rw-r--r-- | src/mdaEPiano.cpp | 13 |
1 files changed, 9 insertions, 4 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) (); } |