summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrekado <rekado@elephly.net>2013-01-25 19:06:13 +0800
committerrekado <rekado@elephly.net>2013-01-25 19:06:13 +0800
commit1068d0d54b3b39932ae6fc70de3ed4113efabac1 (patch)
treeb596caddceec077d654827004fb44d20fa5291ac
parentfb60dcbbd37cc9e50760a99e08d8fb158c75c24f (diff)
define SAMPLES_PER_NOTE
-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