From f40d8ff14a4e51ecc255800c24ce4be291e05eca Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 24 Apr 2014 21:12:06 +0200 Subject: Fix nasty bug in power list handling. Should fix reported velocity problems (all samples played with the same power regardless of midi velocity). --- src/instrument.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/instrument.cc') 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::iterator s = samplelist.begin(); + while(s != samplelist.end()) { + powerlist.add(*s); + s++; + } + powerlist.finalise(); #endif/*NEW_ALGORITHM*/ } -- cgit v1.2.3