summaryrefslogtreecommitdiff
path: root/src/instrument.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2014-04-24 21:12:06 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2014-04-24 21:12:06 +0200
commitf40d8ff14a4e51ecc255800c24ce4be291e05eca (patch)
treea61e00183212d00d415b7c34c07448449210ff3f /src/instrument.cc
parent6dbcd24cee07b519981f128c1fae8870e839e79e (diff)
Fix nasty bug in power list handling. Should fix reported velocity problems (all samples played with the same power regardless of midi velocity).
Diffstat (limited to 'src/instrument.cc')
-rw-r--r--src/instrument.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/instrument.cc b/src/instrument.cc
index 43ee4ac..8c88503 100644
--- a/src/instrument.cc
+++ b/src/instrument.cc
@@ -109,14 +109,17 @@ Sample *Instrument::sample(level_t level, size_t pos)
void Instrument::addSample(level_t a, level_t b, Sample *s)
{
samples.insert(a, b, s);
-#ifdef NEW_ALGORITHM
- powerlist.add(s);
-#endif/*NEW_ALGORITHM*/
}
void Instrument::finalise()
{
#ifdef NEW_ALGORITHM
+ std::vector<Sample*>::iterator s = samplelist.begin();
+ while(s != samplelist.end()) {
+ powerlist.add(*s);
+ s++;
+ }
+
powerlist.finalise();
#endif/*NEW_ALGORITHM*/
}