Skip to content

Commit

Permalink
plugins/LFUGens: generate symmetrical waveforms in LFPulse
Browse files Browse the repository at this point in the history
- fixes issue #1501 (of interest: the default case when duty is 0.5)
  • Loading branch information
totalgee committed May 27, 2015
1 parent ed6442f commit 694a31e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/plugins/LFUGens.cpp
Expand Up @@ -463,7 +463,7 @@ void LFPulse_next_a(LFPulse *unit, int inNumSamples)
phase -= 1.f;
duty = unit->mDuty = nextDuty;
// output at least one sample from the opposite polarity
z = duty < 0.5f ? 1.f : 0.f;
z = duty <= 0.5f ? 1.f : 0.f;
} else {
z = phase < duty ? 1.f : 0.f;
}
Expand All @@ -488,7 +488,7 @@ void LFPulse_next_k(LFPulse *unit, int inNumSamples)
phase -= 1.f;
duty = unit->mDuty = nextDuty;
// output at least one sample from the opposite polarity
z = duty < 0.5f ? 1.f : 0.f;
z = duty <= 0.5f ? 1.f : 0.f;
} else {
z = phase < duty ? 1.f : 0.f;
}
Expand Down

0 comments on commit 694a31e

Please sign in to comment.