[SCM] calf/master: + Organ: fix a bug causing voices not to be put on inactive list when polyphonic percussion is muted

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:39:20 UTC 2013


The following commit has been merged in the master branch:
commit 8445084cb12af11efd26cfa3a6decf43f1476e31
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Sat Feb 7 15:47:42 2009 +0000

    + Organ: fix a bug causing voices not to be put on inactive list when polyphonic percussion is muted

diff --git a/src/calf/organ.h b/src/calf/organ.h
index 36d0e1f..d4f8e9d 100644
--- a/src/calf/organ.h
+++ b/src/calf/organ.h
@@ -268,12 +268,13 @@ public:
         return note;
     }
     virtual bool get_active() {
+        // printf("note %d getactive %d use_percussion %d pamp active %d\n", note, amp.get_active(), use_percussion(), pamp.get_active());
         return (note != -1) && (amp.get_active() || (use_percussion() && pamp.get_active()));
     }
     void update_pitch();
     inline bool use_percussion()
     {
-        return dsp::fastf2i_drm(parameters->percussion_trigger) == perctrig_polyphonic;
+        return dsp::fastf2i_drm(parameters->percussion_trigger) == perctrig_polyphonic && parameters->percussion_level > 0;
     }
 };
 
diff --git a/src/organ.cpp b/src/organ.cpp
index 338ba1d..c20d174 100644
--- a/src/organ.cpp
+++ b/src/organ.cpp
@@ -765,7 +765,8 @@ void organ_voice_base::perc_note_on(int note, int vel)
     perc_reset();
     released_ref = false;
     this->note = note;
-    pamp.set(1.0f + (vel - 127) * parameters->percussion_vel2amp / 127.0);
+    if (parameters->percussion_level > 0)
+        pamp.set(1.0f + (vel - 127) * parameters->percussion_vel2amp / 127.0);
     update_pitch();
     float (*kt)[2] = parameters->percussion_keytrack;
     // assume last point (will be put there by padding)
diff --git a/src/synth.cpp b/src/synth.cpp
index 5b7518b..35c5cea 100644
--- a/src/synth.cpp
+++ b/src/synth.cpp
@@ -64,14 +64,17 @@ dsp::voice *basic_synth::steal_voice()
 {
     std::list<dsp::voice *>::iterator found = active_voices.end();
     float priority = 10000;
+    //int idx = 0;
     for(std::list<dsp::voice *>::iterator i = active_voices.begin(); i != active_voices.end(); i++)
     {
+        //printf("Voice %d priority %f at %p\n", idx++, (*i)->get_priority(), *i);
         if ((*i)->get_priority() < priority)
         {
             priority = (*i)->get_priority();
             found = i;
         }
     }
+    //printf("Found: %p\n\n", *found);
     if (found == active_voices.end())
         return NULL;
     

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list