/[svn]/linuxsampler/trunk/src/engines/gig/Filter.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/Filter.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 685 by persson, Tue Jul 5 19:30:37 2005 UTC revision 791 by persson, Sun Oct 16 14:50:20 2005 UTC
# Line 96  namespace LinuxSampler { namespace gig { Line 96  namespace LinuxSampler { namespace gig {
96                  BasicBPFilter.SetParameters(cutoff, 0.7, fs);                  BasicBPFilter.SetParameters(cutoff, 0.7, fs);
97                  switch (Type) {                  switch (Type) {
98                      case ::gig::vcf_type_highpass:                      case ::gig::vcf_type_highpass:
99                          HPFilter.SetParameters(cutoff, 1.0 - resonance * LSF_BW, fs);                          HPFilter.SetParameters(cutoff, 1.87 - resonance * 1.7526, fs);
100                          break;                          break;
101                      case ::gig::vcf_type_bandpass:                      case ::gig::vcf_type_bandpass:
102                          BPFilter.SetParameters(cutoff, 1.0 - resonance * LSF_BW, fs);                          BPFilter.SetParameters(cutoff, 1.87 - resonance * 1.7526, fs);
103                          break;                          break;
104                      case ::gig::vcf_type_lowpass:                      case ::gig::vcf_type_lowpass:
105                          LPFilter.SetParameters(cutoff, 1.0 - resonance * LSF_BW, fs);                          LPFilter.SetParameters(cutoff, 1.87 - resonance * 1.7526, fs);
106                          break;                          break;
107                  }                  }
108                  this->scale     = 1.0f - resonance * 0.7f;                  this->scale     = resonance < 0.4 ? 1.0f : 1.4f - resonance * 1.016f;
109                  this->resonance = resonance;                  this->resonance = resonance;
110                  this->cutoff    = cutoff;                  this->cutoff    = cutoff;
111              }              }
# Line 114  namespace LinuxSampler { namespace gig { Line 114  namespace LinuxSampler { namespace gig {
114                  BasicBPFilter.SetParameters(base, cutoff, 0.7, fs);                  BasicBPFilter.SetParameters(base, cutoff, 0.7, fs);
115                  switch (Type) {                  switch (Type) {
116                      case ::gig::vcf_type_highpass:                      case ::gig::vcf_type_highpass:
117                          HPFilter.SetParameters(main, cutoff, 1.0 - resonance * LSF_BW, fs);                          HPFilter.SetParameters(main, cutoff, 1.87 - resonance * 1.7526, fs);
118                          break;                          break;
119                      case ::gig::vcf_type_bandpass:                      case ::gig::vcf_type_bandpass:
120                          BPFilter.SetParameters(main, cutoff, 1.0 - resonance * LSF_BW, fs);                          BPFilter.SetParameters(main, cutoff, 1.87 - resonance * 1.7526, fs);
121                          break;                          break;
122                      case ::gig::vcf_type_lowpass:                      case ::gig::vcf_type_lowpass:
123                          LPFilter.SetParameters(main, cutoff, 1.0 - resonance * LSF_BW, fs);                          LPFilter.SetParameters(main, cutoff, 1.87 - resonance * 1.7526, fs);
124                          break;                          break;
125                  }                  }
126                  this->scale     = 1.0f - resonance * 0.7f;                  this->scale     = resonance < 0.4 ? 1.0f : 1.4f - resonance * 1.016f;
127                  this->resonance = resonance;                  this->resonance = resonance;
128                  this->cutoff    = cutoff;                  this->cutoff    = cutoff;
129              }              }
# Line 136  namespace LinuxSampler { namespace gig { Line 136  namespace LinuxSampler { namespace gig {
136              }              }
137    
138              inline bq_t Apply(const bq_t in) {              inline bq_t Apply(const bq_t in) {
139                  return pFilter->Apply(in) * this->scale +                  return pFilter->Apply(in) * this->scale;
140                          BasicBPFilter.ApplyFB(in, this->resonance * LSF_FB) * this->resonance;                  // + BasicBPFilter.ApplyFB(in, this->resonance * LSF_FB) * this->resonance;
141              }              }
142    
143              inline bq_t Apply(biquad_param_t* base, biquad_param_t* main, const bq_t in) {              inline bq_t Apply(biquad_param_t* base, biquad_param_t* main, const bq_t in) {
144                  return pFilter->Apply(main, in) * this->scale +                  return pFilter->Apply(main, in) * this->scale;
145                          BasicBPFilter.ApplyFB(base, in, this->resonance * LSF_FB) * this->resonance;                  // + BasicBPFilter.ApplyFB(base, in, this->resonance * LSF_FB) * this->resonance;
146              }              }
147    
148  #if CONFIG_ASM && ARCH_X86  #if CONFIG_ASM && ARCH_X86

Legend:
Removed from v.685  
changed lines
  Added in v.791

  ViewVC Help
Powered by ViewVC