[SCM] calf/master: + GUI: added GTK+ notebook container (tabbed interface) + Organ: UI improvement (split into two tabs), more waveforms, new synthesizer-like sound processor

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


The following commit has been merged in the master branch:
commit d4ccb039cd5f03de322569168f4827f9a7a2414f
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date:   Sat Apr 5 20:54:11 2008 +0000

    + GUI: added GTK+ notebook container (tabbed interface)
    + Organ: UI improvement (split into two tabs), more waveforms, new synthesizer-like sound processor
    
    
    git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@144 78b06b96-2940-0410-b7fc-879d825d01d8

diff --git a/src/calf/gui.h b/src/calf/gui.h
index 23a3fc3..d0dbd44 100644
--- a/src/calf/gui.h
+++ b/src/calf/gui.h
@@ -113,6 +113,12 @@ struct hbox_container: public box_container
     virtual GtkWidget *create(plugin_gui *_gui, const char *element, xml_attribute_map &attributes);
 };
 
+struct notebook_container: public control_container
+{
+    virtual void add(GtkWidget *w, control_base *base);
+    virtual GtkWidget *create(plugin_gui *_gui, const char *element, xml_attribute_map &attributes);
+};
+
 struct label_param_control: public param_control
 {
     virtual GtkWidget *create(plugin_gui *_gui, int _param_no);
diff --git a/src/calf/modules_synths.h b/src/calf/modules_synths.h
index 2d91fc6..4a1a474 100644
--- a/src/calf/modules_synths.h
+++ b/src/calf/modules_synths.h
@@ -203,10 +203,14 @@ public:
         par_detune1, par_detune2, par_detune3, par_detune4, par_detune5, par_detune6, par_detune7, par_detune8, par_detune9, 
         par_phase1, par_phase2, par_phase3, par_phase4, par_phase5, par_phase6, par_phase7, par_phase8, par_phase9, 
         par_pan1, par_pan2, par_pan3, par_pan4, par_pan5, par_pan6, par_pan7, par_pan8, par_pan9, 
+        par_routing1, par_routing2, par_routing3, par_routing4, par_routing5, par_routing6, par_routing7, par_routing8, par_routing9, 
         par_foldover,
         par_percdecay, par_perclevel, par_percharm, par_master, 
-        par_f1cutoff, par_f1res, par_f1env1,
+        par_f1cutoff, par_f1res, par_f1env1, par_f1env2, par_f1env3, par_f1keyf,
+        par_f2cutoff, par_f2res, par_f2env1, par_f2env2, par_f2env3, par_f2keyf,
         par_eg1attack, par_eg1decay, par_eg1sustain, par_eg1release,
+        par_eg2attack, par_eg2decay, par_eg2sustain, par_eg2release,
+        par_eg3attack, par_eg3decay, par_eg3sustain, par_eg3release,
         param_count };
     enum { in_count = 0, out_count = 2, support_midi = true, rt_capable = true };
     static const char *port_names[];
diff --git a/src/calf/organ.h b/src/calf/organ.h
index 82e9343..90ee843 100644
--- a/src/calf/organ.h
+++ b/src/calf/organ.h
@@ -28,12 +28,13 @@ namespace synth
 {
 
 struct organ_parameters {
-    enum { FilterCount = 1, EnvCount = 1 };
+    enum { FilterCount = 2, EnvCount = 3 };
     struct organ_filter_parameters
     {
         float cutoff;
         float resonance;
         float envmod[organ_parameters::EnvCount];
+        float keyf;
     };
 
     struct organ_env_parameters
@@ -47,6 +48,7 @@ struct organ_parameters {
     float detune[9];
     float phase[9];
     float pan[9];
+    float routing[9];
     float foldover;
     float percussion_time;
     float percussion_level;
@@ -69,8 +71,9 @@ struct organ_parameters {
 
 class organ_voice_base
 {
+public:
+    enum { wave_sine, wave_sinepl1, wave_sinepl2, wave_sinepl3, wave_ssaw, wave_ssqr, wave_spls, wave_saw, wave_sqr, wave_pulse, wave_sinepl05, wave_sqr05, wave_halfsin, wave_clvg, wave_count };
 protected:
-    enum { wave_sine, wave_sinepl1, wave_sinepl2, wave_sinepl3, wave_ssaw, wave_ssqr, wave_spls, wave_saw, wave_sqr, wave_pulse, wave_count };
     static waveform_family<ORGAN_WAVE_BITS> waves[wave_count];
     // dsp::sine_table<float, ORGAN_WAVE_SIZE, 1> sine_wave;
     int note;
@@ -87,11 +90,14 @@ public:
 
 class organ_voice: public synth::voice, public organ_voice_base {
 protected:    
-    enum { Channels = 2, BlockSize = 32, EnvCount = organ_parameters::EnvCount, FilterCount = organ_parameters::FilterCount };
-    float output_buffer[BlockSize][Channels];
+    enum { Channels = 2, BlockSize = 64, EnvCount = organ_parameters::EnvCount, FilterCount = organ_parameters::FilterCount };
+    union {
+        float output_buffer[BlockSize][Channels];
+        float aux_buffers[3][BlockSize][Channels];
+    };
     bool released;
     dsp::fixed_point<int64_t, 52> phase, dphase;
-    biquad<float> filterL, filterR;
+    biquad<float> filterL[2], filterR[2];
     adsr envs[EnvCount];
     int age;
 
@@ -102,18 +108,21 @@ public:
 
     void reset() {
         phase = 0;
-        filterL.reset();
-        filterR.reset();
+        for (int i = 0; i < FilterCount; i++)
+        {
+            filterL[i].reset();
+            filterR[i].reset();
+        }
         age = 0;
     }
 
     void note_on(int note, int /*vel*/) {
         reset();
         this->note = note;
+        const float sf = 0.001f;
         for (int i = 0; i < EnvCount; i++)
         {
             organ_parameters::organ_env_parameters &p = parameters->envs[i];
-            float sf = 0.001f;
             envs[i].set(sf * p.attack, sf * p.decay, p.sustain, sf * p.release, sample_rate / BlockSize);
             envs[i].note_on();
         }
@@ -130,7 +139,8 @@ public:
         if (note == -1)
             return;
 
-        dsp::zero(&output_buffer[0][0], 2 * BlockSize);
+        dsp::zero(&output_buffer[0][0], Channels * BlockSize);
+        dsp::zero(&aux_buffers[1][0][0], 2 * Channels * BlockSize);
         if (!amp.get_active())
             return;
         
@@ -141,7 +151,7 @@ public:
             if (amp < small_value<float>())
                 continue;
             float *data;
-            dsp::fixed_point<int, 24> hm = dsp::fixed_point<int, 24>(parameters->multiplier[h]);
+            dsp::fixed_point<int, 24> hm = dsp::fixed_point<int, 24>(parameters->multiplier[h] * (1.0 / 2.0));
             int waveid = (int)parameters->waveforms[h];
             if (waveid < 0 || waveid >= wave_count)
                 waveid = 0;
@@ -153,26 +163,37 @@ public:
             }
             if (!data)
                 continue;
-            tphase.set(((phase * hm).get() & 0xFFFFFFFF) + parameters->phaseshift[h]);
-            tdphase.set((dphase * hm).get() & 0xFFFFFFFF);
+            tphase.set((uint32_t)((phase * hm).get()) + parameters->phaseshift[h]);
+            tdphase.set((uint32_t)(dphase * hm).get());
             float ampl = amp * 0.5f * (-1 + parameters->pan[h]);
             float ampr = amp * 0.5f * (1 + parameters->pan[h]);
+            float (*out)[Channels] = aux_buffers[dsp::fastf2i_drm(parameters->routing[h])];
             for (int i=0; i < (int)BlockSize; i++) {
                 float wv = wave(data, tphase);
-                output_buffer[i][0] += wv * ampl;
-                output_buffer[i][1] += wv * ampr;
+                out[i][0] += wv * ampl;
+                out[i][1] += wv * ampr;
                 tphase += tdphase;
             }
         }
         phase += dphase * BlockSize;
-        float fc = parameters->filters[0].cutoff * pow(2.0, parameters->filters[0].envmod[0] * envs[0].value * (1.f / 1200.f));
-        filterL.set_lp_rbj(dsp::clip<float>(fc, 10, 18000), parameters->filters[0].resonance, sample_rate);
-        filterR.copy_coeffs(filterL);
-        envs[0].advance();
+        for (int i = 0; i < FilterCount; i++)
+        {
+            float mod = parameters->filters[i].envmod[0] * envs[0].value;
+            mod += parameters->filters[i].keyf * 100 * (note - 60);
+            for (int j = 1; j < EnvCount; j++)
+            {
+                mod += parameters->filters[i].envmod[j] * envs[j].value;
+            }
+            float fc = parameters->filters[i].cutoff * pow(2.0f, mod * (1.f / 1200.f));
+            filterL[i].set_lp_rbj(dsp::clip<float>(fc, 10, 18000), parameters->filters[i].resonance, sample_rate);
+            filterR[i].copy_coeffs(filterL[i]);
+        }
+        for (int i = 0; i < EnvCount; i++)
+            envs[i].advance();
         age++;
         for (int i=0; i < (int) BlockSize; i++) {
-            output_buffer[i][0] = filterL.process_d1(output_buffer[i][0]);
-            output_buffer[i][1] = filterR.process_d1(output_buffer[i][1]);
+            output_buffer[i][0] += filterL[0].process_d1(aux_buffers[1][i][0]) + filterL[1].process_d1(aux_buffers[2][i][0]);
+            output_buffer[i][1] += filterR[0].process_d1(aux_buffers[1][i][1]) + filterR[1].process_d1(aux_buffers[2][i][1]);
         }
         if (released)
         {
diff --git a/src/gui.cpp b/src/gui.cpp
index cf9f780..cbf0d23 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -569,6 +569,21 @@ GtkWidget *vbox_container::create(plugin_gui *_gui, const char *element, xml_att
     return vbox;
 }
 
+/******************************** GtkNotebook container ********************************/
+
+
+GtkWidget *notebook_container::create(plugin_gui *_gui, const char *element, xml_attribute_map &attributes)
+{
+    GtkWidget *nb = gtk_notebook_new();
+    container = GTK_CONTAINER(nb);
+    return nb;
+}
+
+void notebook_container::add(GtkWidget *w, control_base *base)
+{
+    gtk_notebook_append_page(GTK_NOTEBOOK(container), w, gtk_label_new_with_mnemonic(base->attribs["page"].c_str()));
+}
+
 /******************************** GUI proper ********************************/
 
 param_control *plugin_gui::create_control_from_xml(const char *element, const char *attributes[])
@@ -606,6 +621,8 @@ control_container *plugin_gui::create_container_from_xml(const char *element, co
         return new alignment_container;
     if (!strcmp(element, "frame"))
         return new frame_container;
+    if (!strcmp(element, "notebook"))
+        return new notebook_container;
     return NULL;
 }
 
diff --git a/src/organ.cpp b/src/organ.cpp
index 0f98ed5..260a5df 100644
--- a/src/organ.cpp
+++ b/src/organ.cpp
@@ -45,7 +45,8 @@ using namespace std;
             "<knob   attach-x=\"" no "\" attach-y=\"8\" param=\"phase" no "\"/>" \
             "<value  attach-x=\"" no "\" attach-y=\"9\" param=\"phase" no "\"/>" \
             "<knob   attach-x=\"" no "\" attach-y=\"10\" param=\"pan" no "\"/>" \
-            "<value  attach-x=\"" no "\" attach-y=\"11\" param=\"pan" no "\"/>"
+            "<value  attach-x=\"" no "\" attach-y=\"11\" param=\"pan" no "\"/>" \
+            "<combo  attach-x=\"" no "\" attach-y=\"12\" param=\"routing" no "\"/>" 
 
 const char *organ_audio_module::get_gui_xml()
 {
@@ -76,54 +77,167 @@ const char *organ_audio_module::get_gui_xml()
                 "<value param=\"master\"/>"
             "</vbox>"
         "</hbox>"
-        "<table rows=\"12\" cols=\"9\">"
-            "<label  attach-x=\"0\" attach-y=\"1\" text=\"Level\"/>"
-            "<label  attach-x=\"0\" attach-y=\"3\" text=\"Harmonic\"/>"
-            "<label  attach-x=\"0\" attach-y=\"5\" text=\"Wave\"/>"
-            "<label  attach-x=\"0\" attach-y=\"6\" text=\"Detune\"/>"
-            "<label  attach-x=\"0\" attach-y=\"8\" text=\"Phase\"/>"
-            "<label  attach-x=\"0\" attach-y=\"10\" text=\"Pan\"/>"
-
-            DRAWBAR_UI("1")
-            DRAWBAR_UI("2")
-            DRAWBAR_UI("3")
-            DRAWBAR_UI("4")
-            DRAWBAR_UI("5")
-            DRAWBAR_UI("6")
-            DRAWBAR_UI("7")
-            DRAWBAR_UI("8")
-            DRAWBAR_UI("9")
-        "</table>"
-        "<hbox>"
-            "<vbox>"
-            "  <label param=\"f1_cutoff\" />"
-            "  <align><knob param=\"f1_cutoff\" expand=\"0\" fill=\"0\"/></align><value param=\"f1_cutoff\"/>"
-            "</vbox>"
-            "<vbox>"
-            "  <label param=\"f1_res\" />"
-            "  <align><knob param=\"f1_res\" expand=\"0\" fill=\"0\"/></align><value param=\"f1_res\"/>"
-            "</vbox>"
-            "<vbox>"
-            "  <label param=\"f1_env1\" />"
-            "  <align><knob param=\"f1_env1\" expand=\"0\" fill=\"0\"/></align><value param=\"f1_env1\"/>"
-            "</vbox>"
-            "<vbox>"
-            "  <label param=\"adsr_a\" />"
-            "  <align><knob param=\"adsr_a\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr_a\"/>"
-            "</vbox>"
-            "<vbox>"
-            "  <label param=\"adsr_d\" />"
-            "  <align><knob param=\"adsr_d\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr_d\"/>"
-            "</vbox>"
-            "<vbox>"
-            "  <label param=\"adsr_s\" />"
-            "  <align><knob param=\"adsr_s\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr_s\"/>"
+        "<notebook>"
+            "<vbox page=\"Tone generator\">"
+                "<table rows=\"12\" cols=\"9\">"
+                    "<label  attach-x=\"0\" attach-y=\"1\" text=\"Level\"/>"
+                    "<label  attach-x=\"0\" attach-y=\"3\" text=\"Harmonic\"/>"
+                    "<label  attach-x=\"0\" attach-y=\"5\" text=\"Wave\"/>"
+                    "<label  attach-x=\"0\" attach-y=\"6\" text=\"Detune\"/>"
+                    "<label  attach-x=\"0\" attach-y=\"8\" text=\"Phase\"/>"
+                    "<label  attach-x=\"0\" attach-y=\"10\" text=\"Pan\"/>"
+                    "<label  attach-x=\"0\" attach-y=\"12\" text=\"Send to\"/>"
+
+                    DRAWBAR_UI("1")
+                    DRAWBAR_UI("2")
+                    DRAWBAR_UI("3")
+                    DRAWBAR_UI("4")
+                    DRAWBAR_UI("5")
+                    DRAWBAR_UI("6")
+                    DRAWBAR_UI("7")
+                    DRAWBAR_UI("8")
+                    DRAWBAR_UI("9")
+                "</table>"
             "</vbox>"
-            "<vbox>"
-            "  <label param=\"adsr_r\" />"
-            "  <align><knob param=\"adsr_r\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr_r\"/>"
+            "<vbox page=\"Sound processor\">"
+                "<hbox>"
+                    "<frame label=\"Filter 1\">"
+                        "<vbox>"
+                            "<hbox>"
+                                "<vbox>"
+                                    "<label param=\"f1_cutoff\" />"
+                                    "<align><knob param=\"f1_cutoff\" expand=\"0\" fill=\"0\"/></align><value param=\"f1_cutoff\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"f1_res\" />"
+                                    "<align><knob param=\"f1_res\" expand=\"0\" fill=\"0\"/></align><value param=\"f1_res\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"f1_keyf\" />"
+                                    "<align><knob param=\"f1_keyf\" expand=\"0\" fill=\"0\"/></align><value param=\"f1_keyf\"/>"
+                                "</vbox>"
+                            "</hbox>"
+                            "<hbox>"
+                                "<vbox>"
+                                    "<label param=\"f1_env1\" />"
+                                    "<align><knob param=\"f1_env1\" expand=\"0\" fill=\"0\"/></align><value param=\"f1_env1\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"f1_env2\" />"
+                                    "<align><knob param=\"f1_env2\" expand=\"0\" fill=\"0\"/></align><value param=\"f1_env2\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"f1_env3\" />"
+                                    "<align><knob param=\"f1_env3\" expand=\"0\" fill=\"0\"/></align><value param=\"f1_env3\"/>"
+                                "</vbox>"
+                            "</hbox>"
+                        "</vbox>"
+                    "</frame>"
+                    "<frame label=\"EG 1\">"
+                        "<vbox>"
+                            "<hbox>"
+                                "<vbox>"
+                                    "<label param=\"adsr_a\" />"
+                                    "<align><knob param=\"adsr_a\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr_a\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"adsr_d\" />"
+                                    "<align><knob param=\"adsr_d\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr_d\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"adsr_s\" />"
+                                    "<align><knob param=\"adsr_s\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr_s\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"adsr_r\" />"
+                                    "<align><knob param=\"adsr_r\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr_r\"/>"
+                                "</vbox>"
+                            "</hbox>"
+                        "</vbox>"
+                    "</frame>"
+                "</hbox>"
+                "<hbox>"
+                    "<frame label=\"Filter 2\">"
+                        "<vbox>"
+                            "<hbox>"
+                                "<vbox>"
+                                    "<label param=\"f2_cutoff\" />"
+                                    "<align><knob param=\"f2_cutoff\" expand=\"0\" fill=\"0\"/></align><value param=\"f2_cutoff\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"f2_res\" />"
+                                    "<align><knob param=\"f2_res\" expand=\"0\" fill=\"0\"/></align><value param=\"f2_res\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"f2_keyf\" />"
+                                    "<align><knob param=\"f2_keyf\" expand=\"0\" fill=\"0\"/></align><value param=\"f2_keyf\"/>"
+                                "</vbox>"
+                            "</hbox>"
+                            "<hbox>"
+                                "<vbox>"
+                                    "<label param=\"f2_env1\" />"
+                                    "<align><knob param=\"f2_env1\" expand=\"0\" fill=\"0\"/></align><value param=\"f2_env1\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"f2_env2\" />"
+                                    "<align><knob param=\"f2_env2\" expand=\"0\" fill=\"0\"/></align><value param=\"f2_env2\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"f2_env3\" />"
+                                    "<align><knob param=\"f2_env3\" expand=\"0\" fill=\"0\"/></align><value param=\"f2_env3\"/>"
+                                "</vbox>"
+                            "</hbox>"
+                        "</vbox>"
+                    "</frame>"
+                    "<frame label=\"EG 2\">"
+                        "<vbox>"
+                            "<hbox>"
+                                "<vbox>"
+                                    "<label param=\"adsr2_a\" />"
+                                    "<align><knob param=\"adsr2_a\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr2_a\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"adsr2_d\" />"
+                                    "<align><knob param=\"adsr2_d\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr2_d\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"adsr2_s\" />"
+                                    "<align><knob param=\"adsr2_s\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr2_s\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"adsr2_r\" />"
+                                    "<align><knob param=\"adsr2_r\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr2_r\"/>"
+                                "</vbox>"
+                            "</hbox>"
+                        "</vbox>"
+                    "</frame>"
+                "</hbox>"
+                "<hbox>"
+                    "<frame label=\"EG 3\">"
+                        "<vbox>"
+                            "<hbox>"
+                                "<vbox>"
+                                    "<label param=\"adsr3_a\" />"
+                                    "<align><knob param=\"adsr3_a\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr3_a\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"adsr3_d\" />"
+                                    "<align><knob param=\"adsr3_d\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr3_d\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"adsr3_s\" />"
+                                    "<align><knob param=\"adsr3_s\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr3_s\"/>"
+                                "</vbox>"
+                                "<vbox>"
+                                    "<label param=\"adsr3_r\" />"
+                                    "<align><knob param=\"adsr3_r\" expand=\"0\" fill=\"0\"/></align><value param=\"adsr3_r\"/>"
+                                "</vbox>"
+                            "</hbox>"
+                        "</vbox>"
+                    "</frame>"
+                "</hbox>"
             "</vbox>"
-        "</hbox>"
+        "</notebook>"
     "</vbox>"
     ;
 }
@@ -132,7 +246,9 @@ const char *organ_audio_module::port_names[] = {"Out L", "Out R"};
 
 const char *organ_percussion_harmonic_names[] = { "2nd", "3rd" };
 
-const char *organ_wave_names[] = { "Sin", "S0", "S00", "S000", "SSaw", "SSqr", "SPls", "Saw", "Sqr", "Pls"  };
+const char *organ_wave_names[] = { "Sin", "S0", "S00", "S000", "SSaw", "SSqr", "SPls", "Saw", "Sqr", "Pls", "S(", "Sq(", "S+", "Clvg" };
+
+const char *organ_routing_names[] = { "Out", "Flt 1", "Flt 2"  };
 
 parameter_properties organ_audio_module::param_props[] = {
     { 8,       0,  8, 80, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_FADER, NULL, "l1", "16'" },
@@ -155,15 +271,15 @@ parameter_properties organ_audio_module::param_props[] = {
     { 12,      1, 32, 32, PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB, NULL, "f8", "Freq 8" },
     { 16,      1, 32, 32, PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB, NULL, "f9", "Freq 9" },
 
-    { 0,       0,  9, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w1", "Wave 1" },
-    { 0,       0,  9, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w2", "Wave 2" },
-    { 0,       0,  9, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w3", "Wave 3" },
-    { 0,       0,  9, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w4", "Wave 4" },
-    { 0,       0,  9, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w5", "Wave 5" },
-    { 0,       0,  9, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w6", "Wave 6" },
-    { 0,       0,  9, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w7", "Wave 7" },
-    { 0,       0,  9, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w8", "Wave 8" },
-    { 0,       0,  9, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w9", "Wave 9" },
+    { 0,       0,  organ_voice_base::wave_count - 1, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w1", "Wave 1" },
+    { 0,       0,  organ_voice_base::wave_count - 1, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w2", "Wave 2" },
+    { 0,       0,  organ_voice_base::wave_count - 1, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w3", "Wave 3" },
+    { 0,       0,  organ_voice_base::wave_count - 1, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w4", "Wave 4" },
+    { 0,       0,  organ_voice_base::wave_count - 1, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w5", "Wave 5" },
+    { 0,       0,  organ_voice_base::wave_count - 1, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w6", "Wave 6" },
+    { 0,       0,  organ_voice_base::wave_count - 1, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w7", "Wave 7" },
+    { 0,       0,  organ_voice_base::wave_count - 1, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w8", "Wave 8" },
+    { 0,       0,  organ_voice_base::wave_count - 1, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_wave_names, "w9", "Wave 9" },
 
     { 0,    -100,100, 401, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "detune1", "Detune 1" },
     { 0,    -100,100, 401, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "detune2", "Detune 2" },
@@ -195,6 +311,16 @@ parameter_properties organ_audio_module::param_props[] = {
     { 0,      -1,  1, 201, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB, NULL, "pan8", "Pan 8" },
     { 0,      -1,  1, 201, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB, NULL, "pan9", "Pan 9" },
 
+    { 0,       0,  2, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_routing_names, "routing1", "Routing 1" },
+    { 0,       0,  2, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_routing_names, "routing2", "Routing 2" },
+    { 0,       0,  2, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_routing_names, "routing3", "Routing 3" },
+    { 0,       0,  2, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_routing_names, "routing4", "Routing 4" },
+    { 0,       0,  2, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_routing_names, "routing5", "Routing 5" },
+    { 0,       0,  2, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_routing_names, "routing6", "Routing 6" },
+    { 0,       0,  2, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_routing_names, "routing7", "Routing 7" },
+    { 0,       0,  2, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_routing_names, "routing8", "Routing 8" },
+    { 0,       0,  2, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_routing_names, "routing9", "Routing 9" },
+
     { 1,         0,  1, 2, PF_BOOL | PF_CTL_TOGGLE, NULL, "foldover", "Foldover" },
     { 200,         10,  3000, 100, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "perc_decay", "Perc. decay" },
     { 0.25,      0,  1, 100, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB, NULL, "perc_level", "Perc. level" },
@@ -205,11 +331,31 @@ parameter_properties organ_audio_module::param_props[] = {
     { 2000,   20, 20000, 100, PF_FLOAT | PF_SCALE_LOG | PF_UNIT_HZ | PF_CTL_KNOB, NULL, "f1_cutoff", "F1 Cutoff" },
     { 2,        0.7,    8,    0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB, NULL, "f1_res", "F1 Res" },
     { 8000,  -10800,10800,    0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "f1_env1", "F1 Env1" },
+    { 0,     -10800,10800,    0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "f1_env2", "F1 Env2" },
+    { 0,     -10800,10800,    0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "f1_env3", "F1 Env3" },
+    { 0,          0,    2,    0, PF_FLOAT | PF_SCALE_PERC, NULL, "f1_keyf", "F1 KeyFollow" },
+
+    { 2000,   20, 20000, 100, PF_FLOAT | PF_SCALE_LOG | PF_UNIT_HZ | PF_CTL_KNOB, NULL, "f2_cutoff", "F2 Cutoff" },
+    { 2,        0.7,    8,    0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB, NULL, "f2_res", "F2 Res" },
+    { 0,     -10800,10800,    0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "f2_env1", "F2 Env1" },
+    { 8000,  -10800,10800,    0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "f2_env2", "F2 Env2" },
+    { 0,     -10800,10800,    0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "f2_env3", "F2 Env3" },
+    { 0,          0,    2,    0, PF_FLOAT | PF_SCALE_PERC, NULL, "f2_keyf", "F2 KeyFollow" },
 
     { 1,          1,20000,    0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr_a", "EG1 Attack" },
     { 350,       10,20000,    0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr_d", "EG1 Decay" },
     { 0.5,        0,    1,    0, PF_FLOAT | PF_SCALE_PERC, NULL, "adsr_s", "EG1 Sustain" },
     { 50,       10,20000,     0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr_r", "EG1 Release" },
+
+    { 1,          1,20000,    0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr2_a", "EG2 Attack" },
+    { 350,       10,20000,    0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr2_d", "EG2 Decay" },
+    { 0.5,        0,    1,    0, PF_FLOAT | PF_SCALE_PERC, NULL, "adsr2_s", "EG2 Sustain" },
+    { 50,       10,20000,     0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr2_r", "EG2 Release" },
+
+    { 1,          1,20000,    0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr3_a", "EG3 Attack" },
+    { 350,       10,20000,    0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr3_d", "EG3 Decay" },
+    { 0.5,        0,    1,    0, PF_FLOAT | PF_SCALE_PERC, NULL, "adsr3_s", "EG3 Sustain" },
+    { 50,       10,20000,     0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr3_r", "EG3 Release" },
 };
 
 ////////////////////////////////////////////////////////////////////////////
@@ -286,5 +432,17 @@ organ_voice_base::organ_voice_base(organ_parameters *_parameters)
             tmp[i] = (i < (ORGAN_WAVE_SIZE / 16)) ? 1 : 0;
         smoothen(bl, tmp);
         waves[wave_spls].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+            tmp[i] = i < (ORGAN_WAVE_SIZE / 1.5) ? sin(i * 1.5 * 2 * M_PI / ORGAN_WAVE_SIZE) : 0;
+        waves[wave_sinepl05].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+            tmp[i] = i < (ORGAN_WAVE_SIZE / 1.5) ? (i < ORGAN_WAVE_SIZE / 3 ? -1 : +1) : 0;
+        waves[wave_sqr05].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+            tmp[i] = sin(i * M_PI / ORGAN_WAVE_SIZE);
+        waves[wave_halfsin].make(bl, tmp);
+        for (int i = 0; i < ORGAN_WAVE_SIZE; i++)
+            tmp[i] = sin(i * 3 * M_PI / ORGAN_WAVE_SIZE);
+        waves[wave_clvg].make(bl, tmp);
     }
 }

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list