summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2013-01-16 08:05:45 +0800
committerrekado <rekado@elephly.net>2013-01-16 08:05:45 +0800
commit8756fad2507a864288f8afa7c82354e5dc4146c0 (patch)
tree25a2c983441c8378287e5b852c3f6ba36e430fc1
parent5aefe1cbcc218187e26bd6c67745553d3d756682 (diff)
replace programs[curProgram] with direct parameter lookups
-rw-r--r--src/mdaPianoVoice.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mdaPianoVoice.cpp b/src/mdaPianoVoice.cpp
index deb99f5..a59aee1 100644
--- a/src/mdaPianoVoice.cpp
+++ b/src/mdaPianoVoice.cpp
@@ -50,8 +50,6 @@ void mdaPianoVoice::on(unsigned char note, unsigned char velocity)
// store key that turned this voice on (used in 'get_key')
m_key = note;
- // TODO: replace with this voice's local copy
- float * param = programs[curProgram].param;
float l=99.0f;
uint32_t v, k, s;
@@ -93,7 +91,7 @@ void mdaPianoVoice::on(unsigned char note, unsigned char velocity)
env = (0.5f + velsens) * (float)pow(0.0078f * velocity, velsens); //velocity
- l = 50.0f + param[4] * param[4] * muff + muffvel * (float)(velocity - 64); //muffle
+ l = 50.0f + *p(p_muffling_filter) * *p(p_muffling_filter) * muff + muffvel * (float)(velocity - 64); //muffle
if(l < (55.0f + 0.25f * (float)note)) l = 55.0f + 0.25f * (float)note;
if(l > 210.0f) l = 210.0f;
ff = l * l * iFs;
@@ -106,8 +104,8 @@ void mdaPianoVoice::on(unsigned char note, unsigned char velocity)
outl = l + l - outr;
if(note < 44) note = 44; //limit max decay length
- l = 2.0f * param[0];
- if(l < 1.0f) l += 0.25f - 0.5f * param[0];
+ l = 2.0f * *p(p_envelope_decay);
+ if(l < 1.0f) l += 0.25f - 0.5f * *p(p_envelope_decay);
dec = (float)exp(-iFs * exp(-0.6 + 0.033 * (double)note - l));
}
else //note off