diff --git a/docs/nightlychangelog.md b/docs/nightlychangelog.md index 66e4c14..f4f0fae 100644 --- a/docs/nightlychangelog.md +++ b/docs/nightlychangelog.md @@ -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 diff --git a/src/LFO.cpp b/src/LFO.cpp index d2ceb95..02d4e6c 100644 --- a/src/LFO.cpp +++ b/src/LFO.cpp @@ -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; @@ -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) diff --git a/src/Waveshaper.cpp b/src/Waveshaper.cpp index 8dfcf7a..5da0b91 100644 --- a/src/Waveshaper.cpp +++ b/src/Waveshaper.cpp @@ -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())