Pd++  0.01
A pure C++ implementation of Pure Data objects
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
SineWave.h
1 /*
2  SineWave.cpp
3 
4  Created by Robert Esler on 5/10/14.
5  Copyright (c) 2014 Robert Esler. All rights reserved.
6  */
7 
8 #ifndef __aggregate___SineWave__
9 #define __aggregate___SineWave__
10 
11 #include "PdMaster.h"
12 #include "Phasor.h"
13 
14 namespace rwe {
15 
16 /*! \brief A sine wave generator.
17 
18  This generator uses the Pd++ class phasor to generate its
19  ramp.
20 
21 */
22 
23 class SineWave : public PdMaster {
24 
25 private:
26  double factor = 0;
27  int iterator = 0;
28  double volume = 1;
29  double multiplier = 0;
30  double frequency = 0;
31  double samplesPerCycle;
32  double phase = 0;
33  void setPhase(double );
34  pd::Phasor phasor;
35 
36 public:
37  SineWave();
38  SineWave(double, double);
39  ~SineWave();
40  double perform(double );
41 
42  void setFrequency(double);
43  double getFrequency() {return frequency;};
44  void setVolume(double);
45  double getVolume() {return volume;};
46 
47 
48 
49 };
50 
51 } //rwe namespace
52 
53 #endif /* defined(__aggregate___SineWave__) */
A super class inherited by all Pd++ objects.
Definition: PdMaster.h:62
A sawtooth generator.
Definition: Phasor.h:27
A sine wave generator.
Definition: SineWave.h:23
Personal namespace. Use intials for your own classes.
Definition: CosineWave.cpp:18
void setVolume(double)
Definition: SineWave.cpp:51