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