summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mdaPianoVoice.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mdaPianoVoice.cpp b/src/mdaPianoVoice.cpp
index 9e46e6b..4551c6b 100644
--- a/src/mdaPianoVoice.cpp
+++ b/src/mdaPianoVoice.cpp
@@ -77,10 +77,6 @@ void mdaPianoVoice::on(unsigned char key, unsigned char velocity) {
k = 0;
while(key > (kgrp[k].high + s)) k += SAMPLES_PER_NOTE; // find keygroup
-#ifdef EPIANO
- if(velocity > 48) k++; // mid velocity sample
- if(velocity > 80) k++; // high velocity sample
-#endif
sample_index = k; // store sample index
l += (float)(key - kgrp[k].root); // pitch
@@ -94,6 +90,11 @@ void mdaPianoVoice::on(unsigned char key, unsigned char velocity) {
frac = 0;
pos = 0;
+#ifdef EPIANO
+ if(velocity > 48) sample_index++; // mid velocity sample
+ if(velocity > 80) sample_index++; // high velocity sample
+#endif
+
#ifdef PIANO
end = samples[sample_index].size;
#elif defined EPIANO