summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mdaPianoCommon.h1
-rw-r--r--src/mdaPianoVoice.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/mdaPianoCommon.h b/src/mdaPianoCommon.h
index 581ffd5..ce41fbd 100644
--- a/src/mdaPianoCommon.h
+++ b/src/mdaPianoCommon.h
@@ -7,6 +7,7 @@
#define SUSTAIN 128
#define SILENCE 0.0001f //voice choking
#define PARAM_OFFSET 3 //offset for param enum
+#define SAMPLES_PER_NOTE 1
struct KGRP //keygroup
{
diff --git a/src/mdaPianoVoice.cpp b/src/mdaPianoVoice.cpp
index 0657baf..8198d13 100644
--- a/src/mdaPianoVoice.cpp
+++ b/src/mdaPianoVoice.cpp
@@ -52,7 +52,7 @@ void mdaPianoVoice::on(unsigned char key, unsigned char velocity) {
if(velocity > 40) s += (uint32_t)(sizevel * (float)(velocity - 40));
k = 0;
- while(key > (kgrp[k].high + s)) k++; // find keygroup
+ while(key > (kgrp[k].high + s)) k += SAMPLES_PER_NOTE; // find keygroup
sample_index = k; // store sample index
l += (float)(key - kgrp[k].root); // pitch