[SCM] calf/master: + Small modules: added pulse LFO and T flip-flop (edge-triggered toggle), better port hints in edge detector

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


The following commit has been merged in the master branch:
commit 09443cc45e077bb86202da67500ad412783b50fb
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date:   Thu Sep 25 20:54:30 2008 +0000

    + Small modules: added pulse LFO and T flip-flop (edge-triggered toggle), better port hints in edge detector
    
    
    git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@298 78b06b96-2940-0410-b7fc-879d825d01d8

diff --git a/src/calf/modulelist.h b/src/calf/modulelist.h
index aceed87..94a2e66 100644
--- a/src/calf/modulelist.h
+++ b/src/calf/modulelist.h
@@ -25,6 +25,7 @@
     PER_SMALL_MODULE_ITEM(saw_osc, "saw_osc")
     PER_SMALL_MODULE_ITEM(square_lfo, "square_lfo")
     PER_SMALL_MODULE_ITEM(saw_lfo, "saw_lfo")
+    PER_SMALL_MODULE_ITEM(pulse_lfo, "pulse_lfo")
     PER_SMALL_MODULE_ITEM(print, "print")
     PER_SMALL_MODULE_ITEM(print2, "print2")
     PER_SMALL_MODULE_ITEM(quadpower_a, "quadpower_a")
@@ -36,6 +37,7 @@
     PER_SMALL_MODULE_ITEM(logical_and_c, "logical_and_c")
     PER_SMALL_MODULE_ITEM(logical_or_c, "logical_or_c")
     PER_SMALL_MODULE_ITEM(logical_not_c, "logical_not_c")
+    PER_SMALL_MODULE_ITEM(flipflop_c, "flipflop_c")
 #endif
 #undef PER_MODULE_ITEM
 #undef PER_SMALL_MODULE_ITEM
diff --git a/src/modules_small.cpp b/src/modules_small.cpp
index bfd462f..687d8ba 100644
--- a/src/modules_small.cpp
+++ b/src/modules_small.cpp
@@ -327,7 +327,32 @@ public:
         pii->names("level2edge_c", "Level to edge (C)", "kf:BooleanPlugin");
         control_port_info_iface *cports[2];
         port_info(pii, cports);
+        cports[0]->toggle();
+        cports[1]->toggle().trigger();
+    }
+};
+
+class flipflop_c_audio_module: public control_operator_audio_module<1>
+{
+public:
+    bool last_value, output;
+    void activate() {
+        last_value = false;
+        output = false;
+    }
+    void process(uint32_t count) {
+        if (*ins[0] > 0 && !last_value)
+            output = !output;
+        *outs[0] = output ? 1.f : 0.f;
+        last_value = *ins[0] > 0;
+    }
+    static void plugin_info(plugin_info_iface *pii)
+    {
+        pii->names("flipflop_c", "T Flip-Flop (C)", "kf:BooleanPlugin");
+        control_port_info_iface *cports[2];
+        port_info(pii, cports);
         cports[0]->toggle().trigger();
+        cports[1]->toggle();
     }
 };
 
@@ -465,6 +490,27 @@ public:
     }
 };
 
+class pulse_lfo_audio_module: public freq_phase_lfo_base
+{
+public:
+    inline void activate()
+    {
+        phase = 1.0;
+    }
+    void process(uint32_t count)
+    {
+        check_inputs();
+        double oldphase = phase;
+        advance(count);
+        *outs[0] = (phase < oldphase) ? 1.f : 0.f;
+    }
+    static void plugin_info(plugin_info_iface *pii)
+    {
+        pii->names("pulse_lfo", "Pulse LFO", "lv2:OscillatorPlugin");
+        port_info(pii);
+    }
+};
+
 #define SMALL_OSC_TABLE_BITS 12
 
 class freq_only_osc_base: public null_small_audio_module

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list