-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix brake function, add softStart (accelerate from zero) #1085
Conversation
Should I remove the whole m_rampFactor from brake() function? |
..forget about that. |
Please don't merge yet, I'll extend this PR with further clean-up and softStart() function. |
removed calculation of current deck rate, this is done in brake/softStart function when no/default rate values are passed.
...and updated common-controller-scripts.js accordingly |
bump |
Noticed some small JavaScript nitpicks glancing at the code. I'll give this a try soon. |
Okay, thank you! updated softStart() is in general like brake() but has different rampTo[] value and turns on 'play'. Both brake() and softStart() can interrupt each other without glitches or crashes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this and compared it to current master. I confirm that it fixes the bug.
It would be nice if the deck was stopped when there is practically no audio coming through. I tried using script.brake() with really low factors (< .3). I held down the button for a long time after sound stopped coming through, but the deck did not actually stop; when I let go of the button, it started playing at its normal speed again. If you don't want to solve this (or don't want to do it right now), that's fine. I think this PR could be merged without that.
Yeah, that would be nice! So, there had to be a minimum rate, something like setting rampTo to 0.001 for brake(). I'll experiment with what sounds reasonable.
I hope you don't mind that, it was intended for original brake/spinback. I'm quite sure you noticed that you can map start and stop of brake() or softStart() to different buttons, and then sending just NoteOn (NoteOff respetively). Edit |
Yeah, they could be mapped that way. They could also be mapped to replace a normal play button. |
@Pegasus-RPG any thoughts on this? |
I tried to set the minimum rate via rampTo but that would make the unwanted effect even worse. |
I think this should be merged now. Improvements for handling very low factors can come in a future PR. |
Yup! As soon as this is merged, I'll complete the wiki, including a hint for the low factors. |
Thank your for the PR and the review! |
Especially since features like this are nuanced and carefully determined, PLEASE add tests to ensure that future changes don't adversely affect the behavior. |
Cool, thanks for merging! I'll add info to the wiki. |
There's no test because no one wrote one yet. There is a quick intro to writing tests on the wiki. |
Continuing to fix https://bugs.launchpad.net/mixxx/+bug/1571442
"Brake effect initial speed and factor"Initial speed was fixed in #1072.
This PR makes engine.brake() actually take the deceleration factor into account by initializing AlphaBetaFilter with custom beta (How was that done originally at the time the docuwiki was written?).
Additionally, one can now call script.brake(..., factor) in controller script.