comparison audioio/ContinuousSynth.h @ 441:aa6fb3516e28 tonioni

Merge from cxx11 branch
author Chris Cannam
date Mon, 23 Mar 2015 11:26:28 +0000
parents 72c662fe7ea3
children
comparison
equal deleted inserted replaced
440:2185d52b4758 441:aa6fb3516e28
13 */ 13 */
14 14
15 #ifndef CONTINUOUS_SYNTH_H 15 #ifndef CONTINUOUS_SYNTH_H
16 #define CONTINUOUS_SYNTH_H 16 #define CONTINUOUS_SYNTH_H
17 17
18 #include "base/BaseTypes.h"
19
18 /** 20 /**
19 * Mix into a target buffer a signal synthesised so as to sound at a 21 * Mix into a target buffer a signal synthesised so as to sound at a
20 * specific frequency. The frequency may change with each processing 22 * specific frequency. The frequency may change with each processing
21 * block, or may be switched on or off. 23 * block, or may be switched on or off.
22 */ 24 */
23 25
24 class ContinuousSynth 26 class ContinuousSynth
25 { 27 {
26 public: 28 public:
27 ContinuousSynth(int channels, int sampleRate, int blockSize, int waveType); 29 ContinuousSynth(int channels, sv_samplerate_t sampleRate, sv_frame_t blockSize, int waveType);
28 ~ContinuousSynth(); 30 ~ContinuousSynth();
29 31
30 void setChannelCount(int channels); 32 void setChannelCount(int channels);
31 33
32 void reset(); 34 void reset();
43 * Supply f0 less than 0 for silence. You should continue to call 45 * Supply f0 less than 0 for silence. You should continue to call
44 * this even when the signal is silent if you want to ensure the 46 * this even when the signal is silent if you want to ensure the
45 * sound switches on and off cleanly. 47 * sound switches on and off cleanly.
46 */ 48 */
47 void mix(float **toBuffers, 49 void mix(float **toBuffers,
48 float gain, 50 float gain,
49 float pan, 51 float pan,
50 float f0); 52 float f0);
51 53
52 private: 54 private:
53 int m_channels; 55 int m_channels;
54 int m_sampleRate; 56 sv_samplerate_t m_sampleRate;
55 int m_blockSize; 57 sv_frame_t m_blockSize;
56 58
57 double m_prevF0; 59 double m_prevF0;
58 double m_phase; 60 double m_phase;
59 61
60 int m_wavetype; 62 int m_wavetype;