YSE sound engine  1.0
cross platform sound engine
 All Classes Namespaces Functions Pages
sineWave.hpp
1 /*
2  ==============================================================================
3 
4  sineWave.h
5  Created: 31 Jan 2014 2:56:47pm
6  Author: yvan
7 
8  ==============================================================================
9 */
10 
11 #ifndef SINEWAVE_H_INCLUDED
12 #define SINEWAVE_H_INCLUDED
13 
14 #include "../dspObject.hpp"
15 #include "../oscillators.hpp"
16 
17 namespace YSE {
18  namespace DSP {
19 
20  class API sineWave : public dspSourceObject {
21  public:
22  // object is thread safe
23  sineWave();
24 
25  // change the frequency instantly, or wait for the next note on status
26  void frequency(Flt value);
27  Flt frequency();
28 
29  virtual void process(SOUND_STATUS & intent, Int & latency); // use only during DSP
30 
31  private:
32  sine sineGen;
33  sample volumeCurve;
34 
35  sample frequencyCurve;
36  aFlt parmFrequency;
37  Flt currentFrequency;
38  };
39 
40  }
41 }
42 
43 
44 
45 
46 #endif // SINEWAVE_H_INCLUDED