Skip to content
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

Spinback fix #4708

Merged
merged 9 commits into from
Apr 6, 2022
Prev Previous commit
Next Next commit
Brake, spinback, softStart: add debug output
ronso0 committed Mar 29, 2022
commit 87c23c210004d531f8c425bd27de59248f2e8af6
14 changes: 13 additions & 1 deletion src/controllers/controllerengine.cpp
Original file line number Diff line number Diff line change
@@ -1349,15 +1349,19 @@ void ControllerEngine::scratchProcess(int timerId) {

// If we're ramping to end scratching and the wheel hasn't been turned very
// recently (spinback after lift-off,) feed fixed data
qDebug() << ".";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Her is a leftover

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, fixed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn, not fixed, didn't git add it proeprly :|
I pushed the fix to 2.3
045ce55

if (m_ramp[deck] && !m_softStartActive[deck] &&
((mixxx::Time::elapsed() - m_lastMovement[deck]) >= mixxx::Duration::fromMillis(1))) {
qDebug() << " ramp && !softStart";
filter->observation(m_rampTo[deck] * m_rampFactor[deck]);
// Once this code path is run, latch so it always runs until reset
//m_lastMovement[deck] += mixxx::Duration::fromSeconds(1);
} else if (m_softStartActive[deck]) {
qDebug() << " softStart";
// pretend we have moved by (desired rate*default distance)
filter->observation(m_rampTo[deck]*kAlphaBetaDt);
filter->observation(m_rampTo[deck] * kAlphaBetaDt);
} else {
qDebug() << " else";
// This will (and should) be 0 if no net ticks have been accumulated
// (i.e. the wheel is stopped)
filter->observation(m_dx[deck] * m_intervalAccumulator[deck]);
@@ -1375,6 +1379,10 @@ void ControllerEngine::scratchProcess(int timerId) {
// Reset accumulator
m_intervalAccumulator[deck] = 0;

qDebug() << " old " << oldRate;
qDebug() << " new " << newRate;
qDebug() << " fabs" << fabs(trunc((m_rampTo[deck] - newRate) * 100000) / 100000);
qDebug() << ".";
// End scratching if we're ramping and the current rate is really close to the rampTo value
if ((m_ramp[deck] && fabs(m_rampTo[deck] - newRate) <= 0.00001) ||
// or if we brake or softStart and have crossed over the desired value,
@@ -1410,6 +1418,8 @@ void ControllerEngine::scratchProcess(int timerId) {
m_dx[deck] = 0.0;
m_brakeActive[deck] = false;
m_softStartActive[deck] = false;
qDebug() << " DONE scratching";
qDebug() << ".";
}
}

@@ -1514,6 +1524,7 @@ void ControllerEngine::spinback(int deck, bool activate, double factor, double r
Output: -
-------- ------------------------------------------------------ */
void ControllerEngine::brake(int deck, bool activate, double factor, double rate) {
qDebug() << " init brake";
// PlayerManager::groupForDeck is 0-indexed.
QString group = PlayerManager::groupForDeck(deck - 1);

@@ -1582,6 +1593,7 @@ void ControllerEngine::brake(int deck, bool activate, double factor, double rate
Output: -
-------- ------------------------------------------------------ */
void ControllerEngine::softStart(int deck, bool activate, double factor) {
qDebug() << " init softStart";
// PlayerManager::groupForDeck is 0-indexed.
QString group = PlayerManager::groupForDeck(deck - 1);