-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add "Continuous" FloatModels (stepsize = 0) #7623
base: master
Are you sure you want to change the base?
Add "Continuous" FloatModels (stepsize = 0) #7623
Conversation
I think this would be a benefit to a lot of our knobs and sliders too? We could probably generalize the benefit to more than just TripleOscillator. |
Good idea. I have come up with a solution where if the step size of a model is |
Wait, it seems like we already have fine control for our knobs? Just hold shift and drag the knob and the changes are more precise. The only problem is that this doesn't apply for our sliders, which could be useful in places like the mixer channel maybe. |
Even when holding shift, the adjustments are still locked to the stepsize. I cannot get more than 0.1% precision when turning a track volume knob, no matter if I hold shift or not.
That's a good point, maybe I can try to look into that (although it's not directly related to this pr). |
There were efforts in #6770 that tried to address this. I just want to make sure we aren't trampling over already finished work. |
The changes in #6770 do make it so that mouse modifier keys do provide finer control when scrolling on knobs, but they do not change the model by less than one step. It appears that this was an intentional decision, as the code checks if the scroll amount is less than a step, and if so, rounds up to 1 step. lmms/src/gui/widgets/FloatModelEditorBase.cpp Lines 333 to 338 in 248b6b9
|
I'm somewhat confused. Maybe @michaelgregorius could pitch in here, but wouldn't the simple solution be then to stop rounding up to 1 step, and use |
I only preserved the previous behavior in #6770. If you look at the diff then you will find that the code previously looked as follows:
As you can see the check for |
As far as I know, this PR is ready to merge (some further testing would be good though). I can make another PR to change all the Edit: actually wait no, I still want to get more comments on the code. Right now some of the stuff in there is a bit arbitrary, like returning 10 digits for continuous models in |
Description
Originally, this PR gave a finer stepsize to TripleOscillator's volume knobs. However, this pr has changed and expanded to instead provide functionality for continuous knobs/models (no step size).
To make a mondel continuous, simply set it's stepsize to
0.0f
. Normally this would result in division by zero, but this PR adds some new if statements to check if the stepsize is 0, and if so, not to round.Changes
AutomatableModel.h
,AutomatableModel::addValue(float amount)
. This is an alternative toAutomatableModel::incValue(int steps)
, which does not work when the stepsize is 0.FloatModel::getRoundedValue()
,FloatModel::getDigitCount()
,FloatModelEditorBase::wheelEvent()
,FloatModelEditorBase::setPosition()
. For getDigitCount(), I have it always return 10 digits, but this is arbitrary.TripleOscillator
's oscillator volume models stepsizes were set to0.0f
. So far, this is the only model which has been changed to be continuous.numberOfStepsForFullSweep
when scrolling on a knob and holding alt was changed from 2000 to 10000 to provide finer control.Might address #5626
Old PR description
This changes the step size for the volume models in TripleOscillator to be 0.001f instead of 1.0f. This makes FM more usable, as previously only setting the lower osc to 1%, 2%, and maybe 3% volume would give useful tonal results, but now many more values which can be chosen.