rateRange change is changing pitch of currently playing song even with softTakeover enabled

Bug #1337505 reported by Vladimir Malis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Medium
Kevin Wern

Bug Description

rateRange change is changing pitch of currently playing song even with softTakeover enabled.

how to reproduce the "bug":
load a song -> change it's pitch to any value besides 0% -> change pitch slider range with engine.setValue(group, "rateRange", newrange)
now the pitch of the song changes which is wrong,
desired would be that the pitch of the song remains the same, just position of the pitch slider in GUI changes to match the current pitch
To reenable hw pitch slider on your midi controller you need to "meet" the current pitch with your pitch slider.

current example from my midi mapping that produces unwanted pitch changes when changing rateRange:

G2V.init = function (channel, control, value, status, group) {
    G2V.defaultRateRange = engine.getValue("[Channel1]", "rateRange");

    if (G2V.defaultRateRange <= 0.1) {G2V.secondRateRange = 0.2; G2V.thirdRateRange = 1;}
    if (G2V.defaultRateRange > 0.1 && G2V.defaultRateRange <= 0.3) {G2V.secondRateRange = 1; G2V.thirdRateRange = 0.08;}
    if (G2V.defaultRateRange > 0.3) {G2V.secondRateRange = 1; G2V.thirdRateRange = 0.12;}
    engine.softTakeover("[Channel1]","rate", true);
    engine.softTakeover("[Channel2]","rate", true);
}

G2V.onRange = function (channel, control, value, status, group) {
    if (value == 0x7f) {
      if (engine.getValue(group, "rateRange")==G2V.defaultRateRange) engine.setValue(group, "rateRange", G2V.secondRateRange);
      else if (engine.getValue(group, "rateRange")==G2V.secondRateRange) engine.setValue(group, "rateRange", G2V.thirdRateRange);
      else if (engine.getValue(group, "rateRange")==G2V.thirdRateRange) engine.setValue(group, "rateRange", G2V.defaultRateRange);
    }
};

Tags: easy
Changed in mixxx:
status: New → Confirmed
importance: Undecided → Medium
tags: added: easy
removed: raterange softtakeover
Revision history for this message
Daniel Schürmann (daschuer) wrote :

Hi Vladimir,

thank you for the bug report.

A fix should be quite easy around this line:
https://github.com/mixxxdj/mixxx/blob/4c9cda48faa28512408a90cfb51cb487787f7c49/src/engine/bpmcontrol.cpp#L636

Currently the rate calculation is done in a common slot. The issue can be fixed by connecting

    m_pRateRange = new ControlObjectSlave(_group, "rateRange", this);
    m_pRateRange->connectValueChanged(SLOT(slotAdjustRateSlider()), Qt::DirectConnection);

to a own slot (slotRateRangeChanged()) and move the GUI rate slider to compensate the shift. Softtakover is required on the controller.

Are you able to adopt this Bug yourselves? It is very welcome.
Please read:
http://www.mixxx.org/wiki/doku.php/bugfix_workflow
and ask, if you get stucked.

Thank you very much!

Revision history for this message
Vladimir Malis (2malisv) wrote :

Hi.

i'm not skilled enough to implement fix for this issue.

Sorry.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

What a pity. I hope one else picks this up.

Owen Williams (ywwg)
Changed in mixxx:
milestone: none → 1.12.0
assignee: nobody → Owen Williams (ywwg)
Revision history for this message
Dennis Rohner (midzer) wrote :

Hi.
First post :)
According to daschuer's suggestion, i connected m_pRateRange to a new slot in constructor.

m_pRateRange = new ControlObjectSlave(_group, "rateRange", this);
m_pRateRange->connectValueChanged(SLOT(slotRateRangeChanged()), Qt::DirectConnection);

and introduced

void BpmControl::slotRateRangeChanged() {
 double dRateSlider = (m_pEngineBpm->get() / m_pFileBpm->get() - 1.0) /
                          (m_pRateDir->get() * m_pRateRange->get());
        m_pRateSlider->set(dRateSlider);
}

to set the RateSlider.

I don't know how to check in this function whether a controller's softtakeover is enabled.
Or am i going in the wrong direction for fixing the bug?

Revision history for this message
Owen Williams (ywwg) wrote :

i'm not actually working on this

Changed in mixxx:
assignee: Owen Williams (ywwg) → nobody
Changed in mixxx:
assignee: nobody → Sameer Deshmukh (sameer-deshmukh93)
Revision history for this message
Vladimir Malis (2malisv) wrote :

Hi. I have one idea how to make this future feature even better:
Above I described that after changing rateRange, your pitch slider position on MIDI controller will not match actual pitch slider in GUI. Then to enable your HW pitch slider you will have to meet the current pitch with your pitch slider.

Improvement: please add visual representation of your HW pitch slider position into GUI
see attached example.

description: updated
Changed in mixxx:
assignee: Sameer Deshmukh (sameer-deshmukh93) → Kevin Wern (kevin-m-wern)
Revision history for this message
Kevin Wern (kevin-m-wern) wrote :

See:

https://github.com/mixxxdj/mixxx/pull/887

Tested the fix using my controller, seems to work great.

Revision history for this message
-MK- (mk42) wrote :

I think that is fixed for controllers? (Can't test because no midi controller avail.)

But on changes of rateRange in the settings the rate of all decks is reset to zero. Is that intended? If so, I think that issue can be closed. Otherwise I would try to fix it.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

This is fully fixed now.

Changed in mixxx:
milestone: 2.0.0 → none
status: Confirmed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/7527

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.