Filters.h File Reference

#include "CSL_Core.h"

Go to the source code of this file.

Namespaces

namespace  csl

Classes

class  csl::FrequencyAmount
class  csl::Filter
 The n-pole/m-zero filter class. More...
class  csl::Butter
class  csl::Formant
class  csl::Notch
 Notch Filter with poles at +-z and complex conjugate zeros at +-omega. More...
class  csl::Allpass
class  csl::Moog

Defines

#define FILTER_MAX_COEFFICIENTS   (16)
#define BW_LOW_PASS   0
#define BW_HIGH_PASS   1
#define BW_BAND_PASS   2
#define BW_BAND_STOP   3
#define CSL_FILTER_FREQUENCY   4
#define CSL_FILTER_AMOUNT   5
#define DECLARE_FILTER_CONTROLS
 Declare the pointer to freq/bw buffers (if used) and current scale/offset values.
#define LOAD_FILTER_CONTROLS
 Load the freq/bw-related values at the start.

Typedefs

typedef int csl::ButterworthType


Define Documentation

#define FILTER_MAX_COEFFICIENTS   (16)
 

Filters.h -- CSL filter classes.

The base Filter class can perform the generic filter equation based upon a set of feedback and feedforward coefficients. Subclasses of Filter implement the setupCoeffs method to build these coefficients according to different algorithms. The subclasses here mostly inherit from the FrequencyAmount controllable, which specifies a center frequency and an 'amount' which may variously be resonance, radius, bandwidth etc according to the algorithm.

The FrequencyAmount port class definition should be moved to the CSL_Core?

OK so for example Butter class has a CenterFrequency port and a Bandwidth port, but pull_controls must be calling Controllables to do the pullInput()

Or, a generic filter that can take a multichannel UGen for each of aCoeffs and bCoeffs (i.e. multichannel ports), and other filter classes that wrap this and have Frequency and Bandwidth ports etc. This reduces the calls to setupCoeffs, because they'd actually be part of the nextBuffer instead

The reason is that the Scalable type approach & macros can't be extended to filter otherwise.

ALSO, there are no similar macros for Effect; how should this work?

OK, the way he had it working here is filtering in place, i.e. no internal buffer, but if I inherit from Effect, I do have an internal buffer; this means the first thing to do is memcopy the input to the output, then pounce on that; or do the inplace stuff in the Effect port and finally copy to output, say with scale & offset performed there.

#define BW_LOW_PASS   0
 

#define BW_HIGH_PASS   1
 

#define BW_BAND_PASS   2
 

#define BW_BAND_STOP   3
 

#define CSL_FILTER_FREQUENCY   4
 

#define CSL_FILTER_AMOUNT   5
 

#define DECLARE_FILTER_CONTROLS
 

Value:

Port * freqPort = mInputs[CSL_FILTER_FREQUENCY];        \
    Port * bwPort = mInputs[CSL_FILTER_AMOUNT]
Declare the pointer to freq/bw buffers (if used) and current scale/offset values.

#define LOAD_FILTER_CONTROLS
 

Value:

Controllable :: pullInput(freqPort, numFrames);     \
    Controllable :: pullInput(bwPort, numFrames)
Load the freq/bw-related values at the start.


Generated on Fri Apr 6 20:18:14 2007 for CSL by  doxygen 1.4.5-20051010