fixes #6354: Sample and Hold for LFO Controller (#6850)

* fixes #6354: Sample and Hold for LFO Controller

LFO controller's "white noise" wave shape didn't respect the frequency knob at all, so
Sample-and-Hold was added to extend the functionality of the LFO Controller with this
random waveshape. The original functionallity can still be accessed by setting the
FREQ knob to minimum (0.01)

---------

Co-authored-by: Kevin Zander <veratil@gmail.com>
Co-authored-by: saker <sakertooth@gmail.com>
This commit is contained in:
consolegrl
2023-09-12 14:35:54 -04:00
committed by GitHub
parent 296d5736c8
commit b64912cd57
4 changed files with 50 additions and 4 deletions

View File

@@ -79,6 +79,7 @@ const std::vector<DataFile::UpgradeMethod> DataFile::UPGRADE_METHODS = {
&DataFile::upgrade_automationNodes , &DataFile::upgrade_extendedNoteRange,
&DataFile::upgrade_defaultTripleOscillatorHQ,
&DataFile::upgrade_mixerRename , &DataFile::upgrade_bbTcoRename,
&DataFile::upgrade_sampleAndHold ,
};
// Vector of all versions that have upgrade routines.
@@ -1762,6 +1763,23 @@ void DataFile::upgrade_bbTcoRename()
}
// Set LFO speed to 0.01 on projects made before sample-and-hold PR
void DataFile::upgrade_sampleAndHold()
{
QDomNodeList elements = elementsByTagName("lfocontroller");
for (int i = 0; i < elements.length(); ++i)
{
if (elements.item(i).isNull()) { continue; }
auto e = elements.item(i).toElement();
// Correct old random wave LFO speeds
if (e.attribute("wave").toInt() == 6)
{
e.setAttribute("speed",0.01f);
}
}
}
void DataFile::upgrade()
{
// Runs all necessary upgrade methods