From 0fcfb78675cfa596d84f5ca47d9f4d6edb366266 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 23 Feb 2013 03:07:31 +0000 Subject: 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 --- src/mdaEPiano.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/mdaEPiano.cpp') 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) (); } -- cgit v1.2.1