[SCM] calf/master: + Organ: Renamed Master to Volume + Monosynth: Added Volume knob (for controlling... well, volume, ie. master gain); might be not the best way to do it though. Includes anticlick.

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


The following commit has been merged in the master branch:
commit c94759028584cb258e0d1903094a26193ee4909a
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date:   Tue Jan 29 19:32:31 2008 +0000

    + Organ: Renamed Master to Volume
    + Monosynth: Added Volume knob (for controlling... well, volume, ie. master gain); might be not the best way to do it though. Includes anticlick.
    
    
    
    git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@117 78b06b96-2940-0410-b7fc-879d825d01d8

diff --git a/src/calf/modules_synths.h b/src/calf/modules_synths.h
index e3df678..c5cce96 100644
--- a/src/calf/modules_synths.h
+++ b/src/calf/modules_synths.h
@@ -39,7 +39,7 @@ class monosynth_audio_module: public null_audio_module
 public:
     enum { wave_saw, wave_sqr, wave_pulse, wave_sine, wave_triangle, wave_varistep, wave_skewsaw, wave_skewsqr, wave_test1, wave_test2, wave_test3, wave_test4, wave_test5, wave_test6, wave_test7, wave_test8, wave_count };
     enum { flt_lp12, flt_lp24, flt_2lp12, flt_hp12, flt_lpbr, flt_hpbr, flt_bp6, flt_2bp6 };
-    enum { par_wave1, par_wave2, par_detune, par_osc2xpose, par_oscmode, par_oscmix, par_filtertype, par_cutoff, par_resonance, par_cutoffsep, par_envmod, par_envtores, par_envtoamp, par_attack, par_decay, par_sustain, par_release, par_keyfollow, par_legato, par_portamento, par_vel2filter, par_vel2amp, param_count };
+    enum { par_wave1, par_wave2, par_detune, par_osc2xpose, par_oscmode, par_oscmix, par_filtertype, par_cutoff, par_resonance, par_cutoffsep, par_envmod, par_envtores, par_envtoamp, par_attack, par_decay, par_sustain, par_release, par_keyfollow, par_legato, par_portamento, par_vel2filter, par_vel2amp, par_master, param_count };
     enum { in_count = 0, out_count = 2, support_midi = true, rt_capable = true };
     enum { step_size = 64 };
     static const char *port_names[];
@@ -65,6 +65,7 @@ public:
     int legato;
     synth::adsr envelope;
     synth::keystack stack;
+    gain_smoothing master;
     
     static parameter_properties param_props[];
     static const char *get_gui_xml();
@@ -121,6 +122,7 @@ public:
         xpose = pow(2.0, *params[par_osc2xpose] / 12.0);
         xfade = *params[par_oscmix];
         legato = dsp::fastf2i_drm(*params[par_legato]);
+        master.set_inertia(*params[par_master]);
         set_frequency();
     }
     void activate();
@@ -163,12 +165,14 @@ public:
                 uint32_t ip = output_pos;
                 uint32_t len = std::min(step_size - output_pos, op_end - op);
                 if (is_stereo_filter())
-                    for(uint32_t i = 0 ; i < len; i++)
-                        outs[0][op + i] = buffer[ip + i],
-                        outs[1][op + i] = buffer2[ip + i];
+                    for(uint32_t i = 0 ; i < len; i++) {
+                        float vol = master.get();
+                        outs[0][op + i] = buffer[ip + i] * vol,
+                        outs[1][op + i] = buffer2[ip + i] * vol;
+                    }
                 else
                     for(uint32_t i = 0 ; i < len; i++)
-                        outs[0][op + i] = outs[1][op + i] = buffer[ip + i];
+                        outs[0][op + i] = outs[1][op + i] = buffer[ip + i] * master.get();
                 op += len;
                 output_pos += len;
                 if (output_pos == step_size)
diff --git a/src/monosynth.cpp b/src/monosynth.cpp
index c10e8d3..6f22eb8 100644
--- a/src/monosynth.cpp
+++ b/src/monosynth.cpp
@@ -166,6 +166,11 @@ static const char *monosynth_gui_xml =
                             "<label param=\"legato\"  expand=\"0\"/>"
                             "<combo param=\"legato\" expand=\"0\" fill=\"0\"/>"
                         "</vbox>"
+                        "<vbox>"
+                            "<label param=\"master\" />"
+                            "<align><knob param=\"master\" /></align>"
+                            "<value param=\"master\" />"
+                        "</vbox>"
                     "</hbox>"
                     "<hbox>"
                         "<vbox>"
@@ -212,6 +217,8 @@ parameter_properties monosynth_audio_module::param_props[] = {
     
     { 0.5,        0,    1,  0.1, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB, NULL, "vel2filter", "Vel->Filter" },
     { 0,          0,    1,  0.1, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB, NULL, "vel2amp", "Vel->Amp" },
+
+    { 0.5,         0,   1, 100, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB, NULL, "master", "Volume" },
 };
 
 float silence[4097];
diff --git a/src/organ.cpp b/src/organ.cpp
index 9e37cfc..b6f7da8 100644
--- a/src/organ.cpp
+++ b/src/organ.cpp
@@ -119,7 +119,7 @@ parameter_properties organ_audio_module::param_props[] = {
     { 1,         0,  2, 3, PF_ENUM | PF_CTL_COMBO, organ_percussion_mode_names, "perc_mode", "Perc. mode" },
     { 3,         2,  3, 1, PF_ENUM | PF_CTL_COMBO, organ_percussion_harmonic_names, "perc_hrm", "Perc. harmonic" },
 
-    { 0.1,         0,  1, 100, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB, NULL, "master", "Master" },
+    { 0.1,         0,  1, 100, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB, NULL, "master", "Volume" },
 };
 
 ////////////////////////////////////////////////////////////////////////////

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list