-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDelayL.cpp
More file actions
58 lines (45 loc) · 928 Bytes
/
DelayL.cpp
File metadata and controls
58 lines (45 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* DelayL.cpp
*
* Created on: Jan 6, 2018
* Author: borgert
*/
#include "DelayL.h"
DelayL :: DelayL( float delay, float * delayMemory, uint16_t delayMemSz )
{
if ( delay < 0.0 ) {
return;
}
if ( delay > (float) delayMemSz ) {
return;
}
this->delayMem = delayMemory;
this->delayMemSize = delayMemSz;
inPoint_ = 0;
delay_ = delay;
doNextOut_ = true;
alpha_ = 0;
omAlpha_ = 0;
outPoint_ = 0;
inPoint_ = 0;
nextOutput_ = 0;
gain_ = 1;
this->setDelay( delay );
}
DelayL :: ~DelayL()
{
}
float DelayL :: tapOut( unsigned long tapDelay )
{
long tap = inPoint_ - tapDelay - 1;
while ( tap < 0 ) // Check for wraparound.
tap += delayMemSize;
return delayMem[tap];
}
void DelayL :: tapIn( float value, unsigned long tapDelay )
{
long tap = inPoint_ - tapDelay - 1;
while ( tap < 0 ) // Check for wraparound.
tap += delayMemSize;
delayMem[tap] = value;
}