[SCM] calf/master: + Organ: implement quadratic amplitude envelope, GUI cleanup

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


The following commit has been merged in the master branch:
commit 8eaf4eaf1831e0ebf7d0affb609da903ca68c2ac
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Wed Jan 28 20:36:17 2009 +0000

    + Organ: implement quadratic amplitude envelope, GUI cleanup

diff --git a/gui/gui-organ.xml b/gui/gui-organ.xml
index ee1d6b1..f945d5f 100644
--- a/gui/gui-organ.xml
+++ b/gui/gui-organ.xml
@@ -259,20 +259,31 @@
           </vbox>
         </frame>
         <frame label="Amplifier">
-          <vbox>
-            <hbox>
-              <label param="eg1_amp_ctl"/>
-              <combo param="eg1_amp_ctl"/>
-            </hbox>
-            <hbox>
-              <label param="eg2_amp_ctl"/>
-              <combo param="eg2_amp_ctl"/>
-            </hbox>
-            <hbox>
-              <label param="eg3_amp_ctl"/>
-              <combo param="eg3_amp_ctl"/>
-            </hbox>
-          </vbox>
+          <hbox>
+            <vbox>
+              <hbox>
+                <label param="eg1_amp_ctl"/>
+                <combo param="eg1_amp_ctl"/>
+              </hbox>
+              <hbox>
+                <label param="eg2_amp_ctl"/>
+                <combo param="eg2_amp_ctl"/>
+              </hbox>
+              <hbox>
+                <label param="eg3_amp_ctl"/>
+                <combo param="eg3_amp_ctl"/>
+              </hbox>
+            </vbox>
+            <align>
+              <vbox >
+                <label param="quad_env" />
+                <align>
+                  <toggle param="quad_env" />
+                </align>
+                <label />
+              </vbox>
+            </align>
+          </hbox>
         </frame>
       </vbox>
       <vbox>
@@ -402,152 +413,138 @@
       </vbox>
     </hbox>
     <vbox page="Advanced">
-      <align scale-x="1.0" scale-y="0.3">
-        <frame label="Percussive section">
-          <vbox>
-            <align scale-x="0.0" scale-y="1.0">
-              <vbox>
-                <keyboard octaves="10"/>
-                <curve key="map_curve" maxpoints="4"/>
+      <frame label="Percussive section">
+        <vbox>
+          <align scale-x="0.0" scale-y="1.0">
+            <vbox>
+              <keyboard octaves="10"/>
+              <curve key="map_curve" maxpoints="4"/>
+            </vbox>
+          </align>
+          <hbox>
+            <table rows="2" cols="5">
+              <vbox attach-x="0" attach-y="0">
+                <label param="perc_waveform"/>
+                <align>
+                  <combo param="perc_waveform"/>
+                </align>
+                <label/>
               </vbox>
-            </align>
-            <hbox>
-              <table rows="2" cols="5">
-                <vbox attach-x="0" attach-y="0">
-                  <label param="perc_waveform"/>
-                  <align>
-                    <combo param="perc_waveform"/>
-                  </align>
-                </vbox>
-                <vbox attach-x="1" attach-y="0">
-                  <label param="perc_harmonic"/>
-                  <knob param="perc_harmonic" expand="0" fill="0"/>
-                  <value param="perc_harmonic"/>
-                </vbox>
-                <vbox attach-x="2" attach-y="0">
-                  <label param="perc_level"/>
-                  <knob param="perc_level" expand="0" fill="0"/>
-                  <value param="perc_level"/>
-                </vbox>
-                <vbox attach-x="3" attach-y="0">
-                  <label param="perc_decay"/>
-                  <knob param="perc_decay" expand="0" fill="0"/>
-                  <value param="perc_decay"/>
-                </vbox>
-                <vbox attach-x="4" attach-y="0">
-                  <label param="perc_vel2amp"/>
-                  <knob param="perc_vel2amp" expand="0" fill="0"/>
-                  <value param="perc_vel2amp"/>
-                </vbox>
-                <vbox attach-x="0" attach-y="1">
-                  <label param="perc_fm_waveform"/>
-                  <align>
-                    <combo param="perc_fm_waveform"/>
-                  </align>
-                </vbox>
-                <vbox attach-x="1" attach-y="1">
-                  <label param="perc_fm_harmonic"/>
-                  <knob param="perc_fm_harmonic" expand="0" fill="0"/>
-                  <value param="perc_fm_harmonic"/>
-                </vbox>
-                <vbox attach-x="2" attach-y="1">
-                  <label param="perc_fm_depth"/>
-                  <knob param="perc_fm_depth" expand="0" fill="0"/>
-                  <value param="perc_fm_depth"/>
-                </vbox>
-                <vbox attach-x="3" attach-y="1">
-                  <label param="perc_fm_decay"/>
-                  <knob param="perc_fm_decay" expand="0" fill="0"/>
-                  <value param="perc_fm_decay"/>
-                </vbox>
-                <vbox attach-x="4" attach-y="1">
-                  <label param="perc_vel2fm"/>
-                  <knob param="perc_vel2fm" expand="0" fill="0"/>
-                  <value param="perc_vel2fm"/>
-                </vbox>
-              </table>
-              <vbox>
-                <hbox>
-                  <align>
-                    <vbox>
-                      <label param="perc_stereo"/>
-                      <knob param="perc_stereo" expand="0" fill="0" type="3"/>
-                      <value param="perc_stereo"/>
-                    </vbox>
-                  </align>
-                  <align>
-                    <vbox>
-                      <label param="perc_trigger"/>
-                      <align>
-                        <combo param="perc_trigger"/>
-                      </align>
-                    </vbox>
-                  </align>
-                </hbox>
+              <vbox attach-x="1" attach-y="0">
+                <label param="perc_harmonic"/>
+                <knob param="perc_harmonic" />
+                <value param="perc_harmonic"/>
               </vbox>
-            </hbox>
-          </vbox>
-        </frame>
-      </align>
-      <frame label="Vibrato">
+              <vbox attach-x="2" attach-y="0">
+                <label param="perc_level"/>
+                <knob param="perc_level" />
+                <value param="perc_level"/>
+              </vbox>
+              <vbox attach-x="3" attach-y="0">
+                <label param="perc_decay"/>
+                <knob param="perc_decay" />
+                <value param="perc_decay"/>
+              </vbox>
+              <vbox attach-x="4" attach-y="0">
+                <label param="perc_vel2amp"/>
+                <knob param="perc_vel2amp" />
+                <value param="perc_vel2amp"/>
+              </vbox>
+              <hbox attach-x="0" attach-y="1" attach-w="5" attach-h="1" />
+              <vbox attach-x="0" attach-y="2">
+                <label param="perc_fm_waveform"/>
+                <align>
+                  <combo param="perc_fm_waveform"/>
+                </align>
+                <label/>
+              </vbox>
+              <vbox attach-x="1" attach-y="2">
+                <label param="perc_fm_harmonic"/>
+                <knob param="perc_fm_harmonic" />
+                <value param="perc_fm_harmonic"/>
+              </vbox>
+              <vbox attach-x="2" attach-y="2">
+                <label param="perc_fm_depth"/>
+                <knob param="perc_fm_depth" />
+                <value param="perc_fm_depth"/>
+              </vbox>
+              <vbox attach-x="3" attach-y="2">
+                <label param="perc_fm_decay"/>
+                <knob param="perc_fm_decay" />
+                <value param="perc_fm_decay"/>
+              </vbox>
+              <vbox attach-x="4" attach-y="2">
+                <label param="perc_vel2fm"/>
+                <knob param="perc_vel2fm" />
+                <value param="perc_vel2fm"/>
+              </vbox>
+            </table>
+            <vbox>
+              <hbox>
+                <align>
+                  <vbox>
+                    <label param="perc_stereo"/>
+                    <knob param="perc_stereo" expand="0" fill="0" type="3"/>
+                    <value param="perc_stereo"/>
+                  </vbox>
+                </align>
+                <align>
+                  <vbox>
+                    <label param="perc_trigger"/>
+                    <align>
+                      <combo param="perc_trigger"/>
+                    </align>
+                  </vbox>
+                </align>
+              </hbox>
+            </vbox>
+          </hbox>
+        </vbox>
+      </frame>
+      <frame label="Vibrato" >
         <hbox>
-          <vbox expand="0" fill="0">
+          <vbox >
             <label param="vib_rate"/>
-            <align>
-              <knob param="vib_rate" expand="0" fill="0"/>
-            </align>
+            <knob param="vib_rate" />
             <value param="vib_rate"/>
           </vbox>
-          <vbox expand="0" fill="0">
+          <vbox >
             <label param="vib_amt"/>
-            <align>
-              <knob param="vib_amt" expand="0" fill="0"/>
-            </align>
+            <knob param="vib_amt" />
             <value param="vib_amt"/>
           </vbox>
-          <vbox expand="0" fill="0">
+          <vbox >
             <label param="vib_wet"/>
-            <align>
-              <knob param="vib_wet" expand="0" fill="0"/>
-            </align>
+            <knob param="vib_wet" />
             <value param="vib_wet"/>
           </vbox>
-          <vbox expand="0" fill="0">
+          <vbox >
             <label param="vib_phase"/>
-            <align>
-              <knob param="vib_phase" expand="0" fill="0" type="3"/>
-            </align>
+            <knob param="vib_phase" type="3"/>
             <value param="vib_phase"/>
           </vbox>
-          <vbox expand="0" fill="0">
+          <vbox >
             <label param="vib_mode"/>
-            <align>
-              <combo param="vib_mode" expand="0" fill="0"/>
-            </align>
+            <combo param="vib_mode" />
+            <label />
           </vbox>
         </hbox>
       </frame>
-      <frame label="Additional settings">
+      <frame label="Additional settings" >
         <hbox>
           <vbox>
             <label param="transpose"/>
-            <align>
-              <knob param="transpose" type="1"/>
-            </align>
+            <knob param="transpose" type="1"/>
             <value param="transpose"/>
           </vbox>
           <vbox>
             <label param="detune"/>
-            <align>
-              <knob param="detune" type="1"/>
-            </align>
+            <knob param="detune" type="1"/>
             <value param="detune"/>
           </vbox>
           <vbox>
             <label param="foldnote"/>
-            <align>
-              <knob param="foldnote"/>
-            </align>
+            <knob param="foldnote"/>
             <value param="foldnote"/>
           </vbox>
         </hbox>
diff --git a/src/calf/metadata.h b/src/calf/metadata.h
index 2769a30..c4575b5 100644
--- a/src/calf/metadata.h
+++ b/src/calf/metadata.h
@@ -137,6 +137,7 @@ struct organ_enums
         par_lforate, par_lfoamt, par_lfowet, par_lfophase, par_lfomode,
         par_transpose, par_detune,
         par_polyphony,
+        par_quadenv,
         par_var_mapcurve,
         param_count
     };
diff --git a/src/calf/organ.h b/src/calf/organ.h
index a9a8d0e..6ee2ca5 100644
--- a/src/calf/organ.h
+++ b/src/calf/organ.h
@@ -83,6 +83,10 @@ struct organ_parameters {
     float global_transpose;
     float global_detune;
     
+    float polyphony;
+    
+    float quad_env;
+    
     float dummy_mapcurve;
     
     //////////////////////////////////////////////////////////////////////////
diff --git a/src/modules.cpp b/src/modules.cpp
index fa68e98..9cf0299 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -468,6 +468,8 @@ CALF_PORT_PROPS(organ) = {
 
     { 16,         1,   32,   32, PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB, NULL, "polyphony", "Polyphony" },
     
+    { 1,          0,    1,    0, PF_BOOL | PF_CTL_TOGGLE, NULL, "quad_env", "Quadratic AmpEnv" },
+
     { 0,          0,    0,    0, PF_STRING | PF_PROP_MSGCONTEXT, &organ_init_map_curve, "map_curve", "Key mapping curve" },
 };
 
diff --git a/src/organ.cpp b/src/organ.cpp
index ec63b78..338ba1d 100644
--- a/src/organ.cpp
+++ b/src/organ.cpp
@@ -629,14 +629,25 @@ void organ_voice::render_block() {
             }
         }
     }
+    
+    bool is_quad = parameters->quad_env >= 0.5f;
+    
     expression.set_inertia(parameters->cutoff);
     phase += dphase * BlockSize;
     float escl[EnvCount], eval[EnvCount];
     for (int i = 0; i < EnvCount; i++)
         escl[i] = (1.f + parameters->envs[i].velscale * (velocity - 1.f));
     
-    for (int i = 0; i < EnvCount; i++)
-        eval[i] = envs[i].value * escl[i];
+    if (is_quad)
+    {
+        for (int i = 0; i < EnvCount; i++)
+            eval[i] = envs[i].value * envs[i].value * escl[i];
+    }
+    else
+    {
+        for (int i = 0; i < EnvCount; i++)
+            eval[i] = envs[i].value * escl[i];
+    }
     for (int i = 0; i < FilterCount; i++)
     {
         float mod = parameters->filters[i].envmod[0] * eval[0] ;
@@ -666,7 +677,7 @@ void organ_voice::render_block() {
             any_running = true;
         if (mode == ampctl_none)
             continue;
-        float post = envs[i].value * escl[i];
+        float post = (is_quad ? envs[i].value : 1) * envs[i].value * escl[i];
         amp_pre[mode - 1] *= pre;
         amp_post[mode - 1] *= post;
     }

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list