Skip to content

Commit

Permalink
lichen-community-systemsgh-46: Ensures all oscillators use flooredfmo…
Browse files Browse the repository at this point in the history
…f().
  • Loading branch information
colinbdclark committed Mar 21, 2023
1 parent c8b0be3 commit feb1b69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libsignaletic/src/libsignaletic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ void sig_dsp_Sine_generate(void* signal) {
float modulatedPhase = self->phaseAccumulator +
FLOAT_ARRAY(self->inputs.phaseOffset)[i];
float eoc = sig_dsp_Oscillator_eoc(modulatedPhase);
modulatedPhase = sig_dsp_Oscillator_wrapPhase(modulatedPhase);
modulatedPhase = sig_flooredfmodf(modulatedPhase, 1.0f);

float angularPhase = modulatedPhase * sig_TWOPI;
float sample = sinf(angularPhase);
Expand Down Expand Up @@ -1249,7 +1249,7 @@ void sig_dsp_LFTriangle_generate(void* signal) {
float modulatedPhase = self->phaseAccumulator +
FLOAT_ARRAY(self->inputs.phaseOffset)[i];
float eoc = sig_dsp_Oscillator_eoc(modulatedPhase);
modulatedPhase = sig_dsp_Oscillator_wrapPhase(modulatedPhase) *
modulatedPhase = sig_flooredfmodf(modulatedPhase, 1.0f) *
sig_TWOPI;

float val = -1.0f + (2.0f * (modulatedPhase * sig_RECIP_TWOPI));
Expand Down

0 comments on commit feb1b69

Please sign in to comment.