Pd++  0.01
A pure C++ implementation of Pure Data objects
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Delay.h
1 /*
2  Delay.cpp
3  Pd++
4 
5  Created by Robert Esler on 10/18/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____Delay__
14 #define __Pd____Delay__
15 
16 #include <string>
17 #include <vector>
18 #include "PdMaster.h"
19 
20 namespace pd {
21 
22 /*! \brief A basic delay line.
23 
24  This class will delay the input signal based on the delay time. It acts like the
25  [delwrite~] and the [delread~] object but in the same class.
26 
27  If you want to use a signal to control the delay time use VariableDelay.
28 */
29 
30 class Delay : public PdMaster {
31 
32 private:
33  std::vector<double> inputArray;
34  long delayTime = 0;
35  unsigned int sampleCounter = 0;
36 
37 public:
38  Delay();
39  ~Delay();
40  double perform(double input);
41  void setDelayTime(double time);
42  void reset();
43 
44 
45 };
46 
47 } // pd namespace
48 #endif /* defined(__Pd____Delay__) */
The Pd++ namespace.
Definition: BandPass.cpp:14
A super class inherited by all Pd++ objects.
Definition: PdMaster.h:62
A basic delay line.
Definition: Delay.h:30