[SCM] calf/master: Pulsator process and GUI, slight changes in other GUI's

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


The following commit has been merged in the master branch:
commit 42d322f311ae7417e88d82f368d1a1488141cd87
Author: Markus Schmidt <schmidt at boomshop.net>
Date:   Sun Nov 15 12:16:56 2009 +0100

    Pulsator process and GUI, slight changes in other GUI's

diff --git a/gui/calf.rc b/gui/calf.rc
index 5e93ec9..59c68bd 100644
--- a/gui/calf.rc
+++ b/gui/calf.rc
@@ -484,7 +484,7 @@ style "clearlooks-frame"
 style "clearlooks-frame-title"
 {
 	fg[NORMAL] = "#fff"
-	font_name = "Sans 10"
+	font_name = "Sans 8"
 }
 
 style "clearlooks-tooltips" = "clearlooks-wider"
diff --git a/gui/gui-flanger.xml b/gui/gui-flanger.xml
index d97c1e0..963ee0c 100644
--- a/gui/gui-flanger.xml
+++ b/gui/gui-flanger.xml
@@ -29,12 +29,12 @@
     
     <vbox border="10" attach-x="0" attach-y="0">
         <label param="mod_rate" align-y="1.0" />
-        <knob param="mod_rate" size="4" expand="0" fill="0" />
+        <knob param="mod_rate" size="5" expand="0" fill="0" />
         <value param="mod_rate" align-y="0.0" />
     </vbox>
     <vbox border="10" attach-x="2" attach-y="0">
         <label param="stereo" align-y="1.0" />
-        <knob param="stereo" type="3" size="4" expand="0" fill="0" />
+        <knob param="stereo" type="3" size="5" expand="0" fill="0" />
         <value param="stereo" align-y="0.0" />
     </vbox>
     
diff --git a/gui/gui-phaser.xml b/gui/gui-phaser.xml
index 13061cd..77842ac 100644
--- a/gui/gui-phaser.xml
+++ b/gui/gui-phaser.xml
@@ -34,13 +34,13 @@
     
     <vbox border="10" attach-x="0" attach-y="0">
         <label param="mod_rate" align-y="1.0" />
-        <knob param="mod_rate" size="4" />
+        <knob param="mod_rate" size="5" />
         <value param="mod_rate" align-y="0.0" />
     </vbox>
     
     <vbox border="10" attach-x="2" attach-y="0">
         <label param="stereo" align-y="1.0" />
-        <knob param="stereo" type="3" size="4" />
+        <knob param="stereo" type="3" size="5" />
         <value param="stereo" align-y="0.0" />
     </vbox>
     
diff --git a/gui/gui-pulsator.xml b/gui/gui-pulsator.xml
index ce44d78..092a749 100644
--- a/gui/gui-pulsator.xml
+++ b/gui/gui-pulsator.xml
@@ -1,207 +1,67 @@
-<table rows="2" cols="3">
-    <vbox attach-x="0" attach-y="0">
-        <frame label="Input">
-            <vbox spacing="5">
-                <table rows="2" cols="3">
-                    <label param="meter_inL" attach-x="0" attach-y="0" fill-x="0" expand-x="0" fill-y="0" expand-y="0"/>
-                    <vumeter param="meter_inL" hold="1.5" falloff="2.5"  attach-x="1" attach-y="0" fill-x="1" expand-x="1" fill-y="0" expand-y="0"/>
-                    <led param="clip_inL" attach-x="2" attach-y="0" fill-x="0" expand-x="0" fill-y="0" expand-y="0" />
-                    
-                    <label param="meter_inR" attach-x="0" attach-y="1" fill-x="0" expand-x="0" fill-y="0" expand-y="0"/>
-                    <vumeter param="meter_inR" hold="1.5" falloff="2.5" attach-x="1" attach-y="1" fill-x="1" expand-x="1" fill-y="0" expand-y="0"/>
-                    <led param="clip_inR" attach-x="2" attach-y="1" fill-x="0" expand-x="0" fill-y="0" expand-y="0"/>
-                </table>
-                <hbox>
-                    <vbox>
-                        <label />
-                        <toggle param="bypass" size="2" />
-                        <label param="bypass" />
-                    </vbox>
-                    <vbox>
-                        <knob param="level_in" size="3" />
-                        <value param="level_in" />
-                    </vbox>
-                </hbox>
-            </vbox>
-        </frame>
-        <frame label="Highpass">
-            <table cols="2" rows="2">
-                <vbox attach-x="0" attach-y="0" fill-y="0">
-                    <label param="hp_active" expand="0" fill="0"/>
-                    <toggle size="1" param="hp_active" expand="0" fill="0"/>
+<vbox spacing="8">
+    <table expand-y="0" expand-x="1" spacing="5" rows="1" cols="8">
+        <label param="level_in" attach-x="0" attach-y="0" expand-x="0" />
+        <knob param="level_in" attach-x="0" attach-y="1" attach-h="2" expand-x="0" />
+        <value param="level_in" attach-x="0" attach-y="3" expand-x="0" />
+        
+        <label param="meter_inL" attach-x="1" attach-y="0" expand-x="1" />
+        <vumeter param="meter_inL" mode="0" hold="1.5" falloff="2.5" attach-x="1" attach-y="1" expand-x="1" />
+        <vumeter param="meter_inR" mode="0" hold="1.5" falloff="2.5" attach-x="1" attach-y="2" expand-x="1" />
+        <label param="meter_inR" attach-x="1" attach-y="3" expand-x="1" />
+        
+        <label param="clip_inL" attach-x="2" attach-y="0" expand-x="0" />
+        <led param="clip_inL" attach-x="2" attach-y="1" expand-x="0" />
+        <led param="clip_inR" attach-x="2" attach-y="2" expand-x="0" />
+        <label param="clip_inR" attach-x="2" attach-y="3" expand-x="0" />
+        
+        <label param="bypass" attach-x="3" attach-y="0" expand-x="0" />
+        <toggle param="bypass" attach-x="3" attach-y="1" attach-h="2" expand-x="0" />
+        
+        <label param="mono" attach-x="4" attach-y="0" expand-x="0" />
+        <toggle param="mono" attach-x="4" attach-y="1" attach-h="2" expand-x="0" />
+        
+        <label param="meter_outL" attach-x="5" attach-y="0" expand-x="1" />
+        <vumeter param="meter_outL" mode="0" hold="1.5" falloff="2.5" attach-x="5" attach-y="1" expand-x="1" />
+        <vumeter param="meter_outR" mode="0" hold="1.5" falloff="2.5" attach-x="5" attach-y="2" expand-x="1" />
+        <label param="meter_outR" attach-x="5" attach-y="3" expand-x="1" />
+        
+        <label param="clip_outL" attach-x="6" attach-y="0" expand-x="0" />
+        <led param="clip_outL" mode="1" attach-x="6" attach-y="1" expand-x="0" />
+        <led param="clip_outR" mode="1" attach-x="6" attach-y="2" expand-x="0" />
+        <label param="clip_outR" attach-x="6" attach-y="3" expand-x="0" />
+        
+        <label param="level_out" attach-x="7" attach-y="0" expand-x="0" />
+        <knob param="level_out" attach-x="7" attach-y="1" attach-h="2" expand-x="0" />
+        <value param="level_out" attach-x="7" attach-y="3" expand-x="0" />
+    </table>
+    <hbox spacing="20">
+        <vbox spacing="3">
+            <label param="freq" align-y="1.0" />
+            <knob size="5" param="freq" expand="0" fill="0" />
+            <value param="freq" align-y="0.0" />
+        </vbox>
+        <vbox>
+            <frame label="Pulse">
+                <if cond="directlink">
+                    <line-graph refresh="1" width="400" height="100" param="freq"/>
+                </if>
+            </frame>
+            <hbox>
+                <vbox>
+                    <hscale param="offset" />
+                    <label param="offset" />
                 </vbox>
-                <vbox attach-x="1" attach-y="0">
-                    <label param="hp_freq" />
-                    <knob param="hp_freq" />
-                    <value param="hp_freq" />
+                <vbox>
+                    <label />
+                    <combo param="mode" expand="0" fill="0" />
+                    <label param="mode" />
                 </vbox>
-                <vbox attach-x="0" attach-y="1" attach-w="2">
-                    <label param="hp_mode" />
-                    <combo param="hp_mode" />
-                </vbox>
-            </table>
-        </frame>
-    </vbox>
-    
-    <hbox attach-x="0" attach-y="1">
-        <frame label="Lowshelf">
-            <table rows="3" cols="1">
-                <vbox attach-x="0" attach-y="0">
-                    <label param="ls_freq" />
-                    <knob param="ls_freq" />
-                    <value param="ls_freq" />
-                </vbox>
-                <vbox attach-x="0" attach-y="1">
-                    <label param="ls_level" />
-                    <knob param="ls_level" type="1" />
-                    <value param="ls_level" />
-                </vbox>
-                <vbox attach-x="0" attach-y="2">
-                    <label param="ls_active" />
-                    <toggle size="1" param="ls_active" />
-                </vbox>
-            </table>
-        </frame>
-    </hbox>
-    
-    <if cond="directlink">
-        <frame label="Frequency Response" attach-x="1" attach-y="0" pad-x="8">
-            <line-graph refresh="1" param="p1_freq" expand="1" fill="1"/>
-        </frame>
-    </if>
-    
-    <frame label="Parametrics" attach-x="1" attach-y="1" pad-x="8">
-        <table rows="5" cols="5">
-            <label text="Freq" attach-x="0" attach-y="1" />
-            <label text="Level" attach-x="0" attach-y="2" />
-            <label text="Q" attach-x="0" attach-y="3" />
-            <label text="Active" attach-x="0" attach-y="4" />
-            
-            <label text="I" attach-x="1" attach-y="0" />
-            <label text="II" attach-x="2" attach-y="0" />
-            <label text="III" attach-x="3" attach-y="0" />
-            <label text="IV" attach-x="4" attach-y="0" />
-            
-            <vbox attach-x="1" attach-y="1">
-                <knob param="p1_freq" />
-                <value param="p1_freq" />
-            </vbox>
-            <vbox attach-x="1" attach-y="2">
-                <knob param="p1_level" type="1" />
-                <value param="p1_level" />
-            </vbox>
-            <vbox attach-x="1" attach-y="3">
-                <knob param="p1_q" />
-                <value param="p1_q" />
-            </vbox>
-            <vbox attach-x="1" attach-y="4">
-                <toggle size="1" param="p1_active" />
-            </vbox>
-            <vbox attach-x="2" attach-y="1">
-                <knob param="p2_freq" />
-                <value param="p2_freq" />
-            </vbox>
-            <vbox attach-x="2" attach-y="2">
-                <knob param="p2_level" type="1" />
-                <value param="p2_level" />
-            </vbox>
-            <vbox attach-x="2" attach-y="3">
-                <knob param="p2_q" />
-                <value param="p2_q" />
-            </vbox>
-            <vbox attach-x="2" attach-y="4">
-                <toggle size="1" param="p2_active" />
-            </vbox>
-            <vbox attach-x="3" attach-y="1">
-                <knob param="p3_freq" />
-                <value param="p3_freq" />
-            </vbox>
-            <vbox attach-x="3" attach-y="2">
-                <knob param="p3_level" type="1" />
-                <value param="p3_level" />
-            </vbox>
-            <vbox attach-x="3" attach-y="3">
-                <knob param="p3_q" />
-                <value param="p3_q" />
-            </vbox>
-            <vbox attach-x="3" attach-y="4">
-                <toggle size="1" param="p3_active" />
-            </vbox>
-            <vbox attach-x="4" attach-y="1">
-                <knob param="p4_freq" />
-                <value param="p4_freq" />
-            </vbox>
-            <vbox attach-x="4" attach-y="2">
-                <knob param="p4_level" type="1" />
-                <value param="p4_level" />
-            </vbox>
-            <vbox attach-x="4" attach-y="3">
-                <knob param="p4_q" />
-                <value param="p4_q" />
-            </vbox>
-            <vbox  attach-x="4" attach-y="4">
-                <toggle size="1" param="p4_active" />
-            </vbox>
-        </table>
-    </frame>
-    
-    <vbox attach-x="2" attach-y="0">
-        <frame label="Output">
-            <vbox spacing="5">
-                <table rows="2" cols="3">
-                    <label param="meter_outL"  attach-x="0" attach-y="0" fill-x="0" expand-x="0" fill-y="0" expand-y="0"/>
-                    <vumeter param="meter_outL" hold="1.5" falloff="2.5" attach-x="1" attach-y="0" fill-x="1" expand-x="1" fill-y="0" expand-y="0"/>
-                    <led param="clip_outL" mode="1" attach-x="2" attach-y="0" fill-x="0" expand-x="0" fill-y="0" expand-y="0" />
-                    
-                    <label param="meter_outR"  attach-x="0" attach-y="1" fill-x="0" expand-x="0" fill-y="0" expand-y="0"/>
-                    <vumeter param="meter_outR" hold="1.5" falloff="2.5" attach-x="1" attach-y="1" fill-x="1" expand-x="1" fill-y="0" expand-y="0"/>
-                    <led param="clip_outR" mode="1" attach-x="2" attach-y="1" fill-x="0" expand-x="0" fill-y="0" expand-y="0"/>
-                </table>
-                <hbox>
-                    <vbox>
-                        <knob param="level_out" size="3" />
-                        <value param="level_out" />
-                    </vbox>
-                </hbox>
-            </vbox>
-        </frame>
-        <frame label="Lowpass">
-            <table cols="2" rows="2">
-                <vbox attach-x="0" attach-y="0" fill-y="0">
-                    <label param="lp_active" />
-                    <toggle size="1" param="lp_active" />
-                </vbox>
-                <vbox attach-x="1" attach-y="0">
-                    <label param="lp_freq" />
-                    <knob param="lp_freq" />
-                    <value param="lp_freq" />
-                </vbox>
-                <vbox attach-x="0" attach-y="1" attach-w="2">
-                    <label param="lp_mode" />
-                    <combo param="lp_mode" />
-                </vbox>
-            </table>
-        </frame>
-    </vbox>
-    
-    <hbox attach-x="2" attach-y="1">
-        <frame label="Highshelf">
-            <table rows="3" cols="1">
-                <vbox attach-x="0" attach-y="0">
-                    <label param="hs_freq" />
-                    <knob param="hs_freq" />
-                    <value param="hs_freq" />
-                </vbox>
-                <vbox attach-x="0" attach-y="1">
-                    <label param="hs_level" />
-                    <knob param="hs_level" type="1" />
-                    <value param="hs_level" />
-                </vbox>
-                <vbox attach-x="0" attach-y="2">
-                    <label param="hs_active" />
-                    <toggle size="1" param="hs_active" />
-                </vbox>
-            </table>
-        </frame>
+            </hbox>
+        </vbox>
+        <vbox spacing="3">
+            <label param="amount" fill="0" align-y="1.0" />
+            <knob size="5" param="amount" expand="0" fill="0" />
+            <value param="amount" fill="0" align-y="0.0" />
+        </vbox>
     </hbox>
-</table>
+</vbox>
diff --git a/src/calf/metadata.h b/src/calf/metadata.h
index 48e8393..bf181a7 100644
--- a/src/calf/metadata.h
+++ b/src/calf/metadata.h
@@ -241,7 +241,7 @@ struct pulsator_metadata: public plugin_metadata<pulsator_metadata>
     enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = false, require_midi = false, rt_capable = true };
     enum { param_bypass, param_level_in, param_level_out, param_meter_inL, param_meter_inR,
            param_meter_outL, param_meter_outR, param_clip_inL, param_clip_inR, param_clip_outL, param_clip_outR,
-           param_mode, param_freq, param_amount, param_offset, param_count };
+           param_mode, param_freq, param_amount, param_offset, param_mono, param_count };
     PLUGIN_NAME_ID_LABEL("pulsator", "pulsator", "Pulsator")
 };
 
diff --git a/src/calf/modules.h b/src/calf/modules.h
index 867a48f..879dbc1 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -1259,19 +1259,20 @@ public:
 /// LFO by Markus
 class lfo_audio_module {
 private:
-    float phase, freq, offset;
+    float phase, freq, offset, amount;
     int mode;
     uint32_t srate;
     bool is_active;
 public:
     lfo_audio_module();
-    void set_params(float f, int m, float o, uint32_t sr);
+    void set_params(float f, int m, float o, uint32_t sr, float amount = 1.f);
     float get_value();
     void advance(uint32_t count);
     void activate();
     void deactivate();
-    virtual bool get_graph(int subindex, float *data, int points, cairo_iface *context);
-    virtual bool get_dot(int subindex, float &x, float &y, int &size, cairo_iface *context);
+    float get_value_from_phase(float ph, float off);
+    virtual bool get_graph(float *data, int points, cairo_iface *context);
+    virtual bool get_dot(float &x, float &y, int &size, cairo_iface *context);
 };
 
 /// Pulsator by Markus Schmidt
@@ -1279,6 +1280,8 @@ class pulsator_audio_module: public audio_module<pulsator_metadata>, public freq
 private:
     uint32_t clip_inL, clip_inR, clip_outL, clip_outR;
     float meter_inL, meter_inR, meter_outL, meter_outR;
+    float offset_old;
+    int mode_old;
     lfo_audio_module lfoL, lfoR;
 public:
     float *ins[in_count];
@@ -1295,7 +1298,6 @@ public:
     bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context);
     bool get_dot(int index, int subindex, float &x, float &y, int &size, cairo_iface *context);
     bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context);
-    int  get_changed_offsets(int index, int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline);
 };
 
 /// Filterclavier --- MIDI controlled filter by Hans Baier
diff --git a/src/modules.cpp b/src/modules.cpp
index b45a453..0ac187f 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -579,10 +579,11 @@ CALF_PORT_PROPS(pulsator) = {
     { 0,           0,           1,     0,  PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inR", "0dB-InR" },
     { 0,           0,           1,     0,  PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outL", "0dB-OutL" },
     { 0,           0,           1,     0,  PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outR", "0dB-OutR" },
-    { 0,      0,  4,    0, PF_ENUM | PF_CTL_COMBO, pulsator_mode_names, "mode", "Mode" },
-    { 1,   0.01,   100, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "freq", "Frequency" },
-    { 0,          0,    1,    0, PF_FLOAT | PF_SCALE_PERC, NULL, "amount", "Modulation" },
-    { 0,          0,    1,    0, PF_FLOAT | PF_SCALE_PERC, NULL, "offset", "Offset L/R" },
+    { 0,           0,           4,     0,  PF_ENUM | PF_CTL_COMBO, pulsator_mode_names, "mode", "Mode" },
+    { 1,           0.01,        100,   0,  PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "freq", "Frequency" },
+    { 1,           0,           1,     0,  PF_FLOAT | PF_SCALE_PERC, NULL, "amount", "Modulation" },
+    { 0.5,         0,           1,     0,  PF_FLOAT | PF_SCALE_PERC, NULL, "offset", "Offset L/R" },
+    { 0,           0,           1,     0,  PF_BOOL | PF_CTL_TOGGLE, NULL, "mono", "Mono-in" },
 };
 
 CALF_PLUGIN_INFO(pulsator) = { 0x8502, "Pulsator", "Calf Pulsator", "Markus Schmidt", calf_plugins::calf_copyright_info, "ModulationPlugin" };
diff --git a/src/modules_dsp.cpp b/src/modules_dsp.cpp
index fef86b0..2652b6a 100644
--- a/src/modules_dsp.cpp
+++ b/src/modules_dsp.cpp
@@ -2917,38 +2917,43 @@ void lfo_audio_module::deactivate()
 
 float lfo_audio_module::get_value()
 {
+    return get_value_from_phase(phase, offset) * amount;
+}
+
+float lfo_audio_module::get_value_from_phase(float ph, float off)
+{
     float val = 0.f;
-    float ph = phase + offset;
-    if (ph >= 1.0)
-        ph = fmod(ph, 1.f);
+    float phs = ph + off;
+    if (phs >= 1.0)
+        phs = fmod(phs, 1.f);
     switch (mode) {
         default:
         case 0:
             // sine
-            val = sin(ph * 360.f);
+            val = sin((phs * 360.f) * M_PI / 180);
             break;
         case 1:
             // triangle
-            if(ph > 0.75)
-                val = (ph - 0.75) * 4 - 1;
-            else if(ph > 0.5)
-                val = (ph - 0.5) * 4 * -1;
-            else if(ph > 0.25)
-                val = 1 - (ph - 0.25) * 4;
+            if(phs > 0.75)
+                val = (phs - 0.75) * 4 - 1;
+            else if(phs > 0.5)
+                val = (phs - 0.5) * 4 * -1;
+            else if(phs > 0.25)
+                val = 1 - (phs - 0.25) * 4;
             else
-                val = ph * 4;
+                val = phs * 4;
             break;
         case 2:
             // square
-            val = (ph < 0.f) ? -1 : +1;
+            val = (phs < 0.5) ? -1 : +1;
             break;
         case 3:
             // saw up
-                val = ph * 2.f - 1;
+                val = phs * 2.f - 1;
             break;
         case 4:
             // saw down
-            val = 1 - ph * 2.f;
+            val = 1 - phs * 2.f;
             break;
     }
     return val;
@@ -2956,12 +2961,13 @@ float lfo_audio_module::get_value()
 
 void lfo_audio_module::advance(uint32_t count)
 {
-    phase += count * freq * srate;
+    //this function walks from 0.f to 1.f and starts all over again
+    phase += count * freq * (1.0 / srate);
     if (phase >= 1.0)
         phase = fmod(phase, 1.f);
 }
 
-void lfo_audio_module::set_params(float f, int m, float o, uint32_t sr)
+void lfo_audio_module::set_params(float f, int m, float o, uint32_t sr, float a)
 {
     // freq: a value in Hz
     // mode: sine=0, triangle=1, square=2, saw_up=3, saw_down=4
@@ -2970,20 +2976,29 @@ void lfo_audio_module::set_params(float f, int m, float o, uint32_t sr)
     mode = m;
     offset = o;
     srate = sr;
+    amount = a;
 }
 
-bool lfo_audio_module::get_graph(int subindex, float *data, int points, cairo_iface *context)
+bool lfo_audio_module::get_graph(float *data, int points, cairo_iface *context)
 {
     if (!is_active)
         return false;
+    for (int i = 0; i < points; i++) {
+        float ph = (float)i / (float)points;
+        data[i] = get_value_from_phase(ph, offset) * amount;
+    }
     return true;
 }
 
-bool lfo_audio_module::get_dot(int subindex, float &x, float &y, int &size, cairo_iface *context)
+bool lfo_audio_module::get_dot(float &x, float &y, int &size, cairo_iface *context)
 {
     if (!is_active)
         return false;
-    return false;
+    float phs = phase + offset;
+    if (phs >= 1.0)
+        phs = fmod(phs, 1.f);
+    x = phase;
+    y = get_value_from_phase(phase, offset) * amount;
 }
 
 /// Pulsator by Markus Schmidt
@@ -2996,6 +3011,7 @@ pulsator_audio_module::pulsator_audio_module()
 {
     is_active = false;
     srate = 0;
+//    last_generation = 0;
     clip_inL    = 0.f;
     clip_inR    = 0.f;
     clip_outL   = 0.f;
@@ -3022,8 +3038,8 @@ void pulsator_audio_module::deactivate()
 
 void pulsator_audio_module::params_changed()
 {
-    lfoL.set_params(*params[param_freq], *params[param_mode], 0.f, srate);
-    lfoR.set_params(*params[param_freq], *params[param_mode], *params[param_offset], srate);
+    lfoL.set_params(*params[param_freq], *params[param_mode], 0.f, srate, *params[param_amount]);
+    lfoR.set_params(*params[param_freq], *params[param_mode], *params[param_offset], srate, *params[param_amount]);
 }
 
 void pulsator_audio_module::set_sample_rate(uint32_t sr)
@@ -3073,11 +3089,21 @@ uint32_t pulsator_audio_module::process(uint32_t offset, uint32_t numsamples, ui
             inR *= *params[param_level_in];
             inL *= *params[param_level_in];
             
+            if(*params[param_mono] > 0.5) {
+                inL = (inL + inR) * 0.5;
+                inR = inL;
+            }
             float procL = inL;
             float procR = inR;
             
+            procL *= (lfoL.get_value() * 0.5 + *params[param_amount] / 2);
+            procR *= (lfoR.get_value() * 0.5 + *params[param_amount] / 2);
             
+            outL = procL + inL * (1 - *params[param_amount]);
+            outR = procR + inR * (1 - *params[param_amount]);
             
+            outL *=  *params[param_level_out];
+            outR *=  *params[param_level_out];
             
             // send to output
             outs[0][offset] = outL;
@@ -3112,6 +3138,10 @@ uint32_t pulsator_audio_module::process(uint32_t offset, uint32_t numsamples, ui
             
             // next sample
             ++offset;
+            
+            // advance lfo's
+            lfoL.advance(1);
+            lfoR.advance(1);
         } // cycle trough samples
     }
     // draw meters
@@ -3147,32 +3177,42 @@ bool pulsator_audio_module::get_graph(int index, int subindex, float *data, int
 {
     if (!is_active) {
         return false;
-    } else {
-        return false;
+    } else if(index == param_freq) {
+        if(subindex == 0) {
+            context->set_source_rgba(0.35, 0.4, 0.2, 1);
+            return lfoL.get_graph(data, points, context);
+        }
+        if(subindex == 1) {
+            context->set_source_rgba(0.35, 0.4, 0.2, 0.5);
+            return lfoR.get_graph(data, points, context);
+        }
     }
+    return false;
 }
 bool pulsator_audio_module::get_dot(int index, int subindex, float &x, float &y, int &size, cairo_iface *context)
 {
     if (!is_active) {
         return false;
-    } else {
+    } else if(index == param_freq) {
+        if(subindex == 0) {
+            context->set_source_rgba(0.35, 0.4, 0.2, 1);
+            return lfoL.get_dot(x, y, size, context);
+        }
+        if(subindex == 1) {
+            context->set_source_rgba(0.35, 0.4, 0.2, 0.5);
+            return lfoR.get_dot(x, y, size, context);
+        }
         return false;
     }
+    return false;
 }
 bool pulsator_audio_module::get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context)
 {
-    if (!is_active) {
-        return false;
-    } else {
-        return false;
-    }
-}
-
-int pulsator_audio_module::get_changed_offsets(int index, int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline)
-{
-    if (!is_active) {
-        return false;
-    } else {
-        return false;
+   if (index == param_freq && !subindex)
+    {
+        pos = 0;
+        vertical = false;
+        return true;
     }
+    return false;
 }

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list