Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uni- and Bi-polar LFO waveforms properly align #971

Merged
merged 1 commit into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/nightlychangelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 2.2.2

A small fix release after 2.2.1

- LFO Uni- and Bi-polar waveforms align properly.

## 2.2.1

### New Modules
Expand Down
10 changes: 9 additions & 1 deletion src/LFO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,11 @@ struct LFOWaveform : rack::Widget, style::StyleParticipant

float scaleComp = 0.9;
float scaleOff = (1.0 - scaleComp) * 0.5;

if (isuni)
{
// double the mapping range, so half the offset
scaleOff = scaleOff * 0.5;
}
for (int i = 0; i < totalSamples; i += averagingWindow)
{
float val = 0;
Expand Down Expand Up @@ -857,8 +861,12 @@ struct LFOWaveform : rack::Widget, style::StyleParticipant
auto sx = box.size.x / valScale, sy = box.size.y / valScale;
if (isuni)
sy = sy * 2;
bool drawingUp{true};
for (const auto &pt : {eupathV, edpathV})
{
if (isuni && !drawingUp)
continue;
drawingUp = false;
bool first{true};
nvgBeginPath(vg);
for (const auto &[x, y] : pt)
Expand Down
2 changes: 1 addition & 1 deletion src/Waveshaper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ struct WaveshaperPlotWidget : public rack::widget::TransparentWidget, style::Sty
auto wstype = (sst::waveshapers::WaveshaperType)std::round(
module->paramQuantities[Waveshaper::WSHP_TYPE]->getValue());
sst::waveshapers::QuadWaveshaperState wss;
float R[4];
float R[sst::waveshapers::n_waveshaper_registers];

auto ch = (int)module->displayPolyChannel;
if (ch >= module->polyChannelCount())
Expand Down