[SCM] calf/master: + Organ's rotary speaker (chorus, vibrato, pick your favourite name) fixes/improvements... still sucks, but not as much... also, used Leslie speed names for vibrato settings (as I don't have a "real" scanner vibrato) + Fixed pipe length equivalents in organ synth

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


The following commit has been merged in the master branch:
commit d0ab0e37791ef7c96c58da728c63498f009a7eb2
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date:   Tue Dec 11 20:44:12 2007 +0000

    + Organ's rotary speaker (chorus, vibrato, pick your favourite name) fixes/improvements... still sucks, but not as much... also, used Leslie speed names for vibrato settings (as I don't have a "real" scanner vibrato)
    + Fixed pipe length equivalents in organ synth
    
    
    
    git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@13 78b06b96-2940-0410-b7fc-879d825d01d8

diff --git a/src/calf/delay.h b/src/calf/delay.h
index fa37871..f3a4b0c 100644
--- a/src/calf/delay.h
+++ b/src/calf/delay.h
@@ -69,6 +69,19 @@ struct simple_delay {
         int ppos = wrap_around<N>(pos + N - delay);
         odata = data[ppos];
     }
+    
+    /**
+     * Read and write during the same function call
+     */
+    inline T process(T idata, int delay)
+    {
+        assert(delay >= 0 && delay < N);
+        int ppos = wrap_around<N>(pos + N - delay);
+        T odata = data[ppos];
+        data[pos] = idata;
+        pos = wrap_around<N>(pos+1);
+        return odata;
+    }
 
     /** Read one C-channel sample at fractional position.
      * This version can be used for modulated delays, because
diff --git a/src/calf/modules_dev.h b/src/calf/modules_dev.h
index 50e2a94..9687eea 100644
--- a/src/calf/modules_dev.h
+++ b/src/calf/modules_dev.h
@@ -312,7 +312,7 @@ public:
     void params_changed() {
         for (int i = 0; i < param_count; i++)
             ((float *)&par_values)[i] = *params[i];
-        set_vibrato(parameters->get_vibrato_mode());
+        set_vibrato();
     }
     void activate() {
         setup(srate);
diff --git a/src/calf/onepole.h b/src/calf/onepole.h
index 47e80b5..3b794fb 100644
--- a/src/calf/onepole.h
+++ b/src/calf/onepole.h
@@ -53,7 +53,7 @@ public:
         // x+1  x-1
 		Coeff x = tan (PI * fc / (2 * sr));
 		Coeff q = 1/(1+x);
-		b1 = a0 = (x-1) / (1+x);
+		b1 = a0 = (x-1)*q;
         a1 = 1;
     }
     
@@ -83,7 +83,7 @@ public:
         y1 = out;
         return out;
     }
-    
+
     inline T process_hp(T in)
     {
         T out = (in - x1) * a0 - y1 * b1;
diff --git a/src/calf/organ.h b/src/calf/organ.h
index dd80e90..e2dc055 100644
--- a/src/calf/organ.h
+++ b/src/calf/organ.h
@@ -113,8 +113,8 @@ public:
                 float *drawbars = parameters->drawbars;
                 float osc = 
                     drawbars[0]*sine(phase)+
-                    drawbars[1]*sine(2*phase)+
-                    drawbars[2]*sine(3*phase)+
+                    drawbars[1]*sine(3*phase)+
+                    drawbars[2]*sine(2*phase)+
                     drawbars[3]*sine(h4*phase)+
                     drawbars[4]*sine(h6*phase)+
                     drawbars[5]*sine(h8*phase)+
@@ -172,7 +172,7 @@ public:
         // XXXKF the decay needs work!
         float age_const = mode == 1 ? 0.001f : 0.0003f;
         for (int i = 0; i < nsamples; i++) {
-            float osc = 0.2 * sine(harmonic * phase);
+            float osc = 0.5 * sine(harmonic * phase);
             buf[i] += osc * amp.get();
             amp.age_exp(age_const, 0.0001f);
             phase += dphase;
@@ -191,7 +191,9 @@ struct drawbar_organ: public synth::basic_synth {
     percussion_voice percussion;
     // chorus instead of rotary speaker is, well, cheesy
     // let me think of something better some day
-    dsp::simple_chorus<float> chorus, chorus2;
+    dsp::simple_flanger<float, 4096> chorus, chorus2;
+    dsp::biquad<float> crossover1, crossover2;
+    dsp::simple_delay<8, float> phaseshift;
     
     drawbar_organ(organ_parameters *_parameters)
     : parameters(_parameters)
@@ -204,14 +206,24 @@ struct drawbar_organ: public synth::basic_synth {
         basic_synth::render_to(bufptr, nsamples);
         if (percussion.get_active())
             percussion.render_to(buf, nsamples);
-        float chorus_buffer[4096];
-        float chorus_buffer2[4096];
-        chorus.process(chorus_buffer, buf, nsamples);
-        chorus2.process(chorus_buffer2, buf, nsamples);
         float gain = parameters->master;
+        if (parameters->get_vibrato_mode())
+        {
+            float chorus_buffer[4096];
+            float chorus_buffer2[4096];
+            chorus.process(chorus_buffer, buf, nsamples);
+            chorus2.process(chorus_buffer2, buf, nsamples);
+            for (int i=0; i<nsamples; i++) {
+                float lower_drum = crossover1.process_d2(chorus_buffer[i]);
+                float upper_drum = crossover2.process_d2(chorus_buffer2[i]);
+                output[0][i] = gain*(buf[i] + lower_drum - upper_drum);
+                output[1][i] = gain*(buf[i] - phaseshift.process(lower_drum - upper_drum, 7));
+            }
+        }
+        else
         for (int i=0; i<nsamples; i++) {
-            output[0][i] = gain*(buf[i] + chorus_buffer[i] - chorus_buffer2[i]);
-            output[1][i] = gain*(buf[i] - chorus_buffer[i] + chorus_buffer2[i]);
+            output[0][i] = gain*buf[i];
+            output[1][i] = gain*buf[i];
         }
     }
     synth::voice *alloc_voice() {
@@ -222,34 +234,41 @@ struct drawbar_organ: public synth::basic_synth {
     }
     virtual void setup(int sr) {
         basic_synth::setup(sr);
+        crossover1.set_lp_rbj(800.f, 0.7, (float)sr);
+        crossover2.set_hp_rbj(800.f, 0.7, (float)sr);
+        set_vibrato();
         chorus.setup(sr);chorus2.setup(sr);
-        chorus.set_min_delay(0.001f);chorus2.set_min_delay(0.0015f);
-        chorus.set_mod_depth(0.002f);chorus2.set_mod_depth(0.001f);
+        chorus.set_min_delay(0.0041f);chorus2.set_min_delay(0.0025f);
+        chorus.set_mod_depth(0.0024f);chorus2.set_mod_depth(0.0034f);
 
-        chorus.set_rate(0.63);chorus2.set_rate(0.63);
-        chorus.set_wet(0.25f);chorus2.set_wet(0.25f);
+        chorus.set_rate(0.63f);chorus2.set_rate(0.63f);
+        chorus.set_wet(0.5f);chorus2.set_wet(0.5f);
         chorus.set_dry(0.0f);chorus2.set_dry(0.0f);
         percussion.setup(sr);
     }
-    void set_vibrato(int mode)
+    void set_vibrato()
     {
         switch(parameters->get_vibrato_mode())
         {
-            case 0:
-                chorus.set_wet(0.f);
-                chorus2.set_wet(0.f);
-                break;
             case 1:
-                chorus.set_wet(0.5f);
-                chorus2.set_wet(0.5f);
-                chorus.set_rate(0.6f);
-                chorus2.set_rate(0.66f);
+                chorus.set_min_delay(0.0061f);
+                chorus2.set_min_delay(0.0085f);
+                chorus.set_mod_depth(0.003f);
+                chorus2.set_mod_depth(0.0035f);
+                chorus.set_fb(0.3f);
+                chorus2.set_fb(-0.3f);
+                chorus.set_rate(40.0 / 60.0);
+                chorus2.set_rate(48.0 / 60.0);
                 break;
             case 2:
-                chorus.set_wet(0.5f);
-                chorus2.set_wet(0.5f);
-                chorus.set_rate(6.33f);
-                chorus2.set_rate(6.63f);
+                chorus.set_min_delay(0.0061f);
+                chorus2.set_min_delay(0.0085f);
+                chorus.set_mod_depth(0.0014f);
+                chorus2.set_mod_depth(0.0017f);
+                chorus.set_fb(0.3f);
+                chorus2.set_fb(-0.3f);
+                chorus.set_rate(342.0 / 60.0);
+                chorus2.set_rate(400.0 / 60.0);
                 break;
         }
     }
diff --git a/src/modules.cpp b/src/modules.cpp
index 484420f..d85d84d 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -105,22 +105,22 @@ synth::ladspa_wrapper<filter_audio_module> filter(filter_info);
 
 ////////////////////////////////////////////////////////////////////////////
 #ifdef ENABLE_EXPERIMENTAL
-const char *organ_audio_module::param_names[] = {"Out L", "Out R", "32'", "16'", "10 2/3'", "8'", "4'", "3 1/5'", "2 2/3'", "2'", "1'", "Foldover", "Perc Mode", "Perc Harm", "Vibrato Speed", "Master Volume"};
+const char *organ_audio_module::param_names[] = {"Out L", "Out R", "16'", "5 1/3'", "8'", "4'", "2 2/3'", "2'", "1 3/5'", "1 1/3'", "1'", "Foldover", "Perc Mode", "Perc Harm", "Vibrato Speed", "Master Volume"};
 
 const char *organ_percussion_mode_names[] = { "Off", "Short", "Long" };
 const char *organ_percussion_harmonic_names[] = { "2nd", "3rd" };
-const char *organ_vibrato_speed_names[] = { "Off", "Slow", "Fast" };
+const char *organ_vibrato_speed_names[] = { "Off", "Swell", "Tremolo" };
 
 parameter_properties organ_audio_module::param_props[] = {
     { 0.3,       0,  1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_KNOB, NULL },
     { 0.3,       0,  1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_KNOB, NULL },
-    { 0,         0,  1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_KNOB, NULL },
     { 0.3,       0,  1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_KNOB, NULL },
     { 0,         0,  1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_KNOB, NULL },
     { 0,         0,  1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_KNOB, NULL },
     { 0,         0,  1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_KNOB, NULL },
     { 0,         0,  1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_KNOB, NULL },
     { 0,         0,  1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_KNOB, NULL },
+    { 0,         0,  1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_KNOB, NULL },
 
     { 1,         0,  1, 1.01, PF_BOOL | PF_CTL_TOGGLE, NULL },
     { 1,         0,  2, 1.01, PF_ENUM | PF_CTL_COMBO, organ_percussion_mode_names },

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list