[SCM] calf/master: + Monosynth: note-off legato everbody's been asking for ; -)

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:36:59 UTC 2013


The following commit has been merged in the master branch:
commit 34a589f626f6d4e69b6726cad9560e2935ce2c01
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date:   Tue Jan 15 21:10:20 2008 +0000

    + Monosynth: note-off legato everbody's been asking for ;-)
    
    
    
    git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@101 78b06b96-2940-0410-b7fc-879d825d01d8

diff --git a/src/calf/modules_synths.h b/src/calf/modules_synths.h
index 6efb65f..7a9e27a 100644
--- a/src/calf/modules_synths.h
+++ b/src/calf/modules_synths.h
@@ -62,6 +62,7 @@ public:
     int queue_note_on, stop_count;
     int legato;
     synth::adsr envelope;
+    synth::keystack stack;
     
     static parameter_properties param_props[];
     static const char *get_gui_xml();
@@ -73,10 +74,20 @@ public:
         queue_note_on = note;
         last_key = note;
         queue_vel = vel / 127.f;
+        stack.push(note);
     }
     void note_off(int note, int vel)
     {
+        stack.pop(note);
         if (note == last_key) {
+            if (stack.count())
+            {
+                last_key = note = stack.nth(stack.count() - 1);
+                start_freq = freq;
+                target_freq = freq = 440 * pow(2.0, (note - 69) / 12.0);
+                set_frequency();
+                return;
+            }
             gate = false;
             envelope.note_off();
         }
diff --git a/src/monosynth.cpp b/src/monosynth.cpp
index 91907e9..8f11811 100644
--- a/src/monosynth.cpp
+++ b/src/monosynth.cpp
@@ -240,6 +240,7 @@ void monosynth_audio_module::activate() {
     pitchbend = 1.f;
     filter.reset();
     filter2.reset();
+    stack.clear();
 }
 
 waveform_family<11> monosynth_audio_module::waves[wave_count];

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list