projects
/
software
/
lv2-mdametapiano.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cda788f
)
fix off-by-one error
author
rekado
<rekado@elephly.net>
Mon, 29 Jul 2013 14:03:12 +0000
(22:03 +0800)
committer
rekado
<rekado@elephly.net>
Mon, 29 Jul 2013 14:03:12 +0000
(22:03 +0800)
src/mdaPianoVoice.cpp
patch
|
blob
|
history
diff --git
a/src/mdaPianoVoice.cpp
b/src/mdaPianoVoice.cpp
index 2b70c3e78cb7a04bfeff50ca6cdbe6246226e3f0..08a3aa44413422f20781bd53fc05028ef54752ad 100644
(file)
--- a/
src/mdaPianoVoice.cpp
+++ b/
src/mdaPianoVoice.cpp
@@
-192,7
+192,9
@@
void mdaPianoVoice::render(uint32_t from, uint32_t to) {
frac += delta; // integer-based linear interpolation
pos += frac >> 16;
frac &= 0xFFFF; // why AND it with all ones?
- if(pos > end) pos -= loop; // jump back to loop sample
+ if (pos >= end) {
+ pos -= loop; // jump to loop point in sample
+ }
#ifdef PIANO
i = samples[sample_index].buffer[pos];