Skip to content

Commit 3d17dbd

Browse files
committed
Implement LFO Phase
1 parent 79fce11 commit 3d17dbd

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Plateau2/dsp/Dattorro.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ Dattorro1997Tank::Dattorro1997Tank()
1414
lfo3.setFrequency(lfo3Freq);
1515
lfo4.setFrequency(lfo4Freq);
1616

17-
lfo2.phase = 0.25;
18-
lfo3.phase = 0.5;
19-
lfo4.phase = 0.75;
17+
lfo2.setPhase(0.25);
18+
lfo3.setPhase(0.5);
19+
lfo4.setPhase(0.75);
2020

2121
lfo1.setRevPoint(0.5);
2222
lfo2.setRevPoint(0.5);

Plateau2/dsp/LFO.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ class LFO {
7070
class TriSawLFO {
7171
public:
7272
TriSawLFO(double sampleRate = 44100.0, double frequency = 1.0) {
73-
phase = 0.0;
7473
_output = 0.0;
7574
_sampleRate = sampleRate;
7675
_step = 0.0;
@@ -137,7 +136,9 @@ class TriSawLFO {
137136
return _output;
138137
}
139138

140-
double phase;
139+
void setPhase(double phase) {
140+
_step = phase;
141+
}
141142

142143
private:
143144
double _output;

0 commit comments

Comments
 (0)