Recording logarithmic automation hotfix (#7621)

When you record an automation clip with a logarithmic knob (for example, a freq knob in the equalizer) the recorded values in the automation editor are correct.....

....But, for whatever reason, lmms tries to scale the recorded values back to linear when playing the automation, which causes the recorded frequency to be much lower.

This pr does not fix the underlying issue, but instead just scales the recorded values so that everything works.
This commit is contained in:
regulus79
2025-07-04 11:52:04 -04:00
committed by GitHub
parent bbdfeff5e1
commit 00d5abc930

View File

@@ -396,7 +396,14 @@ void Song::processAutomations(const TrackList &tracklist, TimePos timeStart, fpp
if (p->isRecording() && relTime >= 0 && relTime < p->length())
{
const AutomatableModel* recordedModel = p->firstObject();
p->recordValue(relTime, recordedModel->value<float>());
// The automation system really needs to be reworked.
// For whatever reason, the values in an automation clip are stored in un-un-scaled format, so if you
// are automating a log knob, when you draw an curve, the values being stored are not the actual values the
// knob will take, but instead the unscaled version of the unscaled numbers. The tooltip shows the number you expect, but if you double-click,
// you can see that the true values are stored by their inverse scaled value....which is wrong, since they weren't scaled in the first place...?
// Anyhow, in the meantime before we redo the automation system, when recording automations, we have to get the inverseScaledValue
// and store that so that when playing it back, it scales the value correctly.
p->recordValue(relTime, recordedModel->inverseScaledValue(recordedModel->value<float>()));
recordedModels << recordedModel;
}