Pd++  0.01
A pure C++ implementation of Pure Data objects
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Sawtooth.h
1 /*
2  Sawtooth.cpp
3  Pd++
4 
5  Created by Robert Esler on 9/17/14.
6  Copyright (c) 2014 Robert Esler. All rights reserved.
7  */
8 
9 #ifndef __Pd____Sawtooth__
10 #define __Pd____Sawtooth__
11 
12 #include <iostream>
13 #include "PdMaster.h"
14 
15 namespace rwe {
16 
17 /*! \brief A sawtooth wave generator.
18 
19  This is simple iteration of a sawtooth. Similar to phasor but uses
20 a much simpler routine.
21 
22 */
23 
24 class Sawtooth : public PdMaster {
25 
26 private:
27  double samplesPerCycle;
28  double frequency;
29  double volume = 1;
30  double iterator = 0;
31 
32 public:
33  Sawtooth();
34  ~Sawtooth();
35  double perform(double);
36  void setFrequency(double);
37  double getFrequency();
38  void setVolume(double);
39  double getVolume();
40 
41 };
42 
43 } // rwe namespace
44 
45 #endif /* defined(__Pd____Sawtooth__) */
A sawtooth wave generator.
Definition: Sawtooth.h:24
A super class inherited by all Pd++ objects.
Definition: PdMaster.h:62
Personal namespace. Use intials for your own classes.
Definition: CosineWave.cpp:18
void setVolume(double)
Definition: Sawtooth.cpp:50