Pd++  0.01
A pure C++ implementation of Pure Data objects
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
LowPass.h
1 /*
2  LowPass.cpp
3  Pd++
4 
5  Created by Esler,Robert Wadhams on 9/19/14.
6  Copyright (c) 2014 Robert Esler. All rights reserved.
7 
8  Some of the code in Pd++ is Copyright (c) 1997-1999 Miller Puckette.
9  For information on usage and redistribution, and for a DISCLAIMER OF ALL
10  WARRANTIES, see the file, "LICENSE.txt," in this distribution.
11  */
12 
13 #ifndef __Pd____LowPass__
14 #define __Pd____LowPass__
15 
16 #include "PdMaster.h"
17 #include <string>
18 
19 namespace pd {
20 
21 /*! \brief A one-pole low pass filter
22 
23  Use the setCutoff() function to adjust the cutoff frequency.
24 
25 */
26 
27 
28 
29 class LowPass : public PdMaster {
30 
31 public:
32  LowPass();
33  ~LowPass();
34  double perform(double input);
35  void setCutoff(double cutoff);
36  double getCutoff();
37  void clear();
38 
39 private:
40 
41  struct lopctl
42  {
43  double c_x;
44  double c_coef;
45  };
46 
47  lopctl x_cspace;
48  lopctl *x_ctrl;
49 
50  void ft1(double f_arg);
51 
52  double c_x;
53  double c_coef;
54 
55  double x_sr; //sample rate
56  double x_hz = 100; //cut off frequency
57 
58  double x_f;
59 
60  const std::string pdName = "lop~";
61 
62 };
63 
64 } // pd namespace
65 
66 #endif /* defined(__Pd____LowPass__) */
The Pd++ namespace.
Definition: BandPass.cpp:14
A super class inherited by all Pd++ objects.
Definition: PdMaster.h:62
A one-pole low pass filter.
Definition: LowPass.h:29