[SCM] calf/master: Merge branch 'master' of ssh://repo.or.cz/srv/git/calf

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


+ AutoHell: allow disabling LADSPA and LV2 plugins via configure option
+ LV2: attempt at fixing compilation with no LV2
+ GUI: graph improvements (?)
+ Compressor: limit knee to 12dB, remove slope-limiting workaround
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: d6a3c1a63a147948535a50da009275278ad5e6a3
X-Git-Newrev: 34569260c452f0fa4c543155ebba174a42a343dc

The following commit has been merged in the master branch:
commit 0de4e5873328e8aa0da82f1955eae1710bf1432c
Merge: 7af5bf95accc5161e77339d10029b722d4124733 6ae439406e42a5e9c72c782ac3d10e9cc4beddd6
Author: Thor Harald Johansen <thj at thj.no>
Date:   Mon Nov 24 23:47:35 2008 +0100

    Merge branch 'master' of ssh://repo.or.cz/srv/git/calf
    
    Conflicts:
    
    	src/modules.cpp

diff --combined src/calf/modules.h
index 088ac7b,3e7f3cb..c27f288
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@@ -61,18 -61,6 +61,6 @@@ public
  };
  #endif
  
- template<class Fx>
- bool get_graph(Fx &fx, int subindex, float *data, int points)
- {
-     for (int i = 0; i < points; i++)
-     {
-         typedef std::complex<double> cfloat;
-         double freq = 20.0 * pow (20000.0 / 20.0, i * 1.0 / points);
-         data[i] = log(fx.freq_gain(subindex, freq, fx.srate)) / log(1024.0) + 0.5;
-     }
-     return true;
- }
- 
  class flanger_audio_module: public audio_module<flanger_metadata>, public line_graph_iface
  {
  public:
@@@ -698,7 -686,7 +686,7 @@@ public
  
  class compressor_audio_module: public audio_module<compressor_metadata>, public line_graph_iface {
  private:
 -    float linslope, clip, peak, detected;
 +    float linslope, clip, peak, detected, kneeSqrt, kneeStart, kneeStop, threshold, ratio, knee, makeup;
      bool aweighting;
      aweighter awL, awR;
  public:
@@@ -716,18 -704,14 +704,18 @@@
          bool rms = *params[param_detection] == 0;
          bool average = *params[param_stereo_link] == 0;
          aweighting = *params[param_aweighting] > 0.5f;
 -        float threshold = *params[param_threshold];
 -        float ratio = *params[param_ratio];
 +        threshold = *params[param_threshold];
 +        ratio = *params[param_ratio];
          float attack = *params[param_attack];
          float attack_coeff = std::min(1.f, 1.f / (attack * srate / 4000.f));
          float release = *params[param_release];
          float release_coeff = std::min(1.f, 1.f / (release * srate / 4000.f));
 -        float makeup = *params[param_makeup];
 -        float knee = *params[param_knee];
 +        makeup = *params[param_makeup];
 +        knee = *params[param_knee];
 +        
 +        kneeSqrt = sqrt(knee);
 +        kneeStart = threshold / kneeSqrt;
 +        kneeStop = threshold * kneeSqrt;
  
          numsamples += offset;
          
@@@ -751,10 -735,9 +739,10 @@@
              return inputs_mask;
          }
  
 -        float gain = 1.f;
 -        
 +        float compression = 1.f;
 +
          while(offset < numsamples) {
 +            float gain = 1.f;
              float left = ins[0][offset];
              float right = ins[1][offset];
              if(aweighting) {
@@@ -767,18 -750,26 +755,18 @@@
              float slope = rms ? sqrt(linslope) : linslope;
              detected = slope;
  
 -            if(slope > 0.f && (slope > threshold || knee < 1.f)) {
 -                if(IS_FAKE_INFINITY(ratio)) {
 -                    gain = threshold;
 -                } else {
 -                    gain = (slope - threshold) / ratio + threshold;
 -                }
 -                
 -                if(knee < 1.f) {
 -                    float t = std::min(1.f, std::max(0.f, slope / threshold - knee) / (1.f - knee));
 -                    gain = (gain - slope) * t + slope;
 -                }
 -                
 +            if(slope > 0.f) {
 +                gain = output_gain(slope);
                  gain /= slope;
              }
 -        
 -            
 -            float outL = ins[0][offset] * gain * makeup;
 +
 +            compression = gain;
 +            gain *= makeup;
 +
 +            float outL = ins[0][offset] * gain;
              outs[0][offset] = outL;
  
 -            float outR = ins[1][offset] * gain * makeup;
 +            float outR = ins[1][offset] * gain;
              outs[1][offset] = outR;
  
              ++offset;
@@@ -797,7 -788,7 +785,7 @@@
          }
          
          if(params[param_compression] != NULL) {
 -            *params[param_compression] = gain;
 +            *params[param_compression] = compression;
          }
  
          if(params[param_clip] != NULL) {
@@@ -811,12 -802,19 +799,12 @@@
          return inputs_mask;
      }
  
 -    void set_sample_rate(uint32_t sr);
 -    inline float output_level(float slope)
 -    {
 -        float threshold = *params[param_threshold];
 -        float ratio = *params[param_ratio];
 -        float makeup = *params[param_makeup];
 -        float knee = *params[param_knee];
 -        
 -        float kneeSqrt = sqrt(knee);
 -        float kneeStart = threshold / kneeSqrt;
 -        float kneeStop = threshold * kneeSqrt;
 -
 -        if(slope > 0.f && slope > kneeStart) {
 +    inline float output_level(float slope) {
 +        return output_gain(slope) * makeup;
 +    }
 +    
 +    inline float output_gain(float slope) {
 +         if(slope > kneeStart) {
              float gain = 0.f;
              float delta = 0.f;
              if(IS_FAKE_INFINITY(ratio)) {
@@@ -828,17 -826,12 +816,17 @@@
              }
              
              if(knee > 1.f && slope < kneeStop) {
 -                gain = hermite_interpolation(slope, kneeStart, kneeStop, kneeStart, (threshold * kneeSqrt - threshold) / ratio + threshold, 1.f, delta);
 +                gain = hermite_interpolation(slope, kneeStart, kneeStop, kneeStart, (kneeStop - threshold) / ratio + threshold, 1.f, delta);
              }
 -            return gain * makeup;
 +            
 +            return gain;
          }
 -        return slope * makeup;
 +
 +        return slope;
      }
 +
 +    void set_sample_rate(uint32_t sr);
 +    
      virtual bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context);
      virtual bool get_dot(int index, int subindex, float &x, float &y, int &size, cairo_iface *context);
      virtual bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context);

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list