Skip to content

Commit

Permalink
Reduce bipolar LFO range to -5v to 5v
Browse files Browse the repository at this point in the history
  • Loading branch information
qiemem committed Jul 21, 2020
1 parent 3d8a800 commit 5be8088
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Normal modes:

Loop modes:
1. Bright green: Unipolar LFO, 0v to 8v.
2. Dim green: Bipolar LFO, -8v to 8v.
2. Dim green: Bipolar LFO, -5v to 5v.
3. Bright orange: Unipolar step/S&H, 0v to 8v.
4. Dim orange: Bipolar step/S&H, -8v to 8v.
5. Bright red: Unipolar sustain, 0v to 8v.
Expand Down
5 changes: 3 additions & 2 deletions stages/segment_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,9 @@ void SegmentGenerator::ShapeLFO(
CONSTRAIN(triangle, -plateau, plateau);
triangle = triangle * normalization;
float sine = InterpolateWrap(lut_sine, phase + 0.75f, 1024.0f);
in_out->value = (bipolar ? 1.0f : 0.5f) * Crossfade(triangle, sine, sine_amount)
+ (bipolar ? 0.0f : 0.5f);
const float amplitude = bipolar ? (10.0f / 16.0f) : 0.5f;
const float offset = bipolar ? 0.0f : 0.5f;
in_out->value = amplitude * Crossfade(triangle, sine, sine_amount) + offset;
in_out->segment = phase < 0.5f ? 0 : 1;
++in_out;
}
Expand Down

0 comments on commit 5be8088

Please sign in to comment.