CSL  6.0
DelayLine.h
Go to the documentation of this file.
1 //
2 // DelayLine.h -- an Interpolating Delay Line
3 // See the copyright notice and acknowledgment of authors in the file COPYRIGHT
4 //
5 // This is a typical circular buffer with one writer and multiple readers (tap instances)
6 
7 #ifndef CSL_DelayLine_H
8 #define CSL_DelayLine_H
9 
10 #include "CSL_Core.h"
11 #include "RingBuffer.h"
12 
13 namespace csl {
14 
15 // The delay line takes its input and write a delayed output
16 class DelayLine : public UnitGenerator, public Effect {
17 public:
18  DelayLine(unsigned maxDelayInSamples);
19 
20  float delayTime();
21  unsigned delayLength();
22 
23  float setDelayTime(float delayInMiliseconds);
24  unsigned setDelayLength(unsigned delayInSamples);
25 // void setInterpolationKind();
26 
27  void nextBuffer(Buffer &output) throw(CException);
28 
29 protected:
33 
34 };
35 
36 }
37 
38 #endif
39 
40 //typedef enum {
41 // kTruncate,
42 // kLinear,
43 // kAllPass
44 //} InterpType;
45 //
46 //class DLine : public FrameStream, public Processor {
47 //
48 //private:
49 // Buffer ring_buffer;
50 //
51 // float max_delay_time;
52 // float delay_time;
53 // float target_delay_time;
54 // unsigned max_delay_in_frames;
55 // InterpType interp_type;
56 // unsigned start_frame;
57 //// unsigned end_frame;
58 // unsigned write_frame;
59 //
60 //public:
61 // DLine( FrameStream &input, float max_delay );
62 // ~DLine();
63 //
64 // bool set_target_delay_time( float tdt );
65 // bool init_delay_time( float dt );
66 // bool set_interp_type( InterpType );
67 //// update_write_frame( unsigned how_many_frames);
68 //
69 // status mono_next_buffer(Buffer & inputBuffer, Buffer & outputBuffer, unsigned inBufNum, unsigned outBufNum);
70 // status next_buffer(Buffer & inputBuffer, Buffer & outputBuffer);
71 //
72 //};
RingBuffer is the storage + a default reader.
Definition: RingBuffer.h:56
RingBuffer mRingBuffer
Definition: DelayLine.h:30
AdditiveInstrument.h – Sum-of-sines synthesis instrument class.
Definition: Accessor.h:17
Effect – mix-in for classes that have unit generators as inputs (like filters).
Definition: CSL_Core.h:466
unsigned mTotalDelayInSamples
Definition: DelayLine.h:32
float delayTime()
DelayLine(unsigned maxDelayInSamples)
Definition: DelayLine.cpp:12
unsigned delayLength()
Definition: DelayLine.cpp:20
unsigned mMaxDelayInSamples
Definition: DelayLine.h:31
unsigned setDelayLength(unsigned delayInSamples)
Definition: DelayLine.cpp:28
Buffer – the multi-channel sample buffer class (passed around between generators and IO guys)...
Definition: CSL_Core.h:106
void nextBuffer(Buffer &output)
get a buffer of Frames – this is the core CSL "pull" function; the given buffer can be written into...
Definition: DelayLine.cpp:51
forward declaration
Definition: CSL_Core.h:241
float setDelayTime(float delayInMiliseconds)
Definition: DelayLine.cpp:39
Base class of CSL exceptions (written upper-case). Has a string message.