YSE sound engine  1.0
cross platform sound engine
 All Classes Namespaces Functions Pages
delay.hpp
1 /*
2  ==============================================================================
3 
4  delay.hpp
5  Created: 31 Jan 2014 2:52:41pm
6  Author: yvan
7 
8  ==============================================================================
9 */
10 
11 #ifndef DELAY_H_INCLUDED
12 #define DELAY_H_INCLUDED
13 
14 #include <vector>
15 #include "../headers/defines.hpp"
16 #include "../headers/types.hpp"
17 #include "sample.hpp"
18 
19 namespace YSE {
20 
21  namespace DSP {
25  class API delay {
26  public:
32  delay& setSize(UInt size);
33 
38  delay& process(AUDIOBUFFER & buffer);
39 
49  delay& read(sample& result, UInt delayTime);
50 
59  delay& read(sample& result, AUDIOBUFFER & delayTime); // read from delay at variable point
60 
67  delay(Int size);
68  delay(const delay &);
69 
70  private:
71  UInt bufferlength;
72  std::vector<Flt> buffer;
73  Int phase;
74 
75  UInt currentLength; // the sample length for this loop
76  aUInt size;
77  };
78 
79  void readInterpolated(AUDIOBUFFER & ctrl, sample& out, AUDIOBUFFER & buffer, UInt &pos);
80 
81  }
82 }
83 
84 
85 
86 #endif // DELAY_H_INCLUDED
Delay keeps an internal delay line of variable length.
Definition: delay.hpp:25