From df146e2d9ee8d1471447829d502753388511da79 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Sun, 1 May 2022 01:23:11 +0200 Subject: [PATCH 001/388] KeyControl: simplify updatePitch() & updatePitchAdjust(), more const --- src/engine/controls/keycontrol.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/engine/controls/keycontrol.cpp b/src/engine/controls/keycontrol.cpp index 1d2236573c3..bba99180cc4 100644 --- a/src/engine/controls/keycontrol.cpp +++ b/src/engine/controls/keycontrol.cpp @@ -353,7 +353,7 @@ void KeyControl::slotPitchChanged(double pitch) { } void KeyControl::updatePitch() { - double pitch = m_pPitch->get(); + const double pitch = m_pPitch->get(); if constexpr (kEnableDebugOutput) { qDebug() << " ."; @@ -364,17 +364,17 @@ void KeyControl::updatePitch() { qDebug() << " | m_pPitchAdjust " << m_pPitchAdjust->get(); } - double speedSliderPitchRatio = - m_pitchRateInfo.pitchRatio / m_pitchRateInfo.pitchTweakRatio; // speedSliderPitchRatio must be unchanged - double pitchKnobRatio = KeyUtils::semitoneChangeToPowerOf2(pitch); - m_pitchRateInfo.pitchRatio = pitchKnobRatio; - m_pitchRateInfo.pitchTweakRatio = pitchKnobRatio / speedSliderPitchRatio; + const double speedSliderPitchRatio = + m_pitchRateInfo.pitchRatio / m_pitchRateInfo.pitchTweakRatio; + m_pitchRateInfo.pitchRatio = KeyUtils::semitoneChangeToPowerOf2(pitch); + m_pitchRateInfo.pitchTweakRatio = + m_pitchRateInfo.pitchRatio / speedSliderPitchRatio; - double dFileKey = m_pFileKey->get(); + const double dFileKey = m_pFileKey->get(); m_pPitchAdjust->set( KeyUtils::powerOf2ToSemitoneChange(m_pitchRateInfo.pitchTweakRatio)); - updateKeyCOs(dFileKey, KeyUtils::powerOf2ToOctaveChange(pitchKnobRatio)); + updateKeyCOs(dFileKey, KeyUtils::powerOf2ToOctaveChange(m_pitchRateInfo.pitchRatio)); if constexpr (kEnableDebugOutput) { qDebug() << " --after KeyControl::updatePitch"; @@ -392,7 +392,7 @@ void KeyControl::slotPitchAdjustChanged(double pitchAdjust) { } void KeyControl::updatePitchAdjust() { - double pitchAdjust = m_pPitchAdjust->get(); + const double pitchAdjust = m_pPitchAdjust->get(); if constexpr (kEnableDebugOutput) { qDebug() << " ."; @@ -403,16 +403,16 @@ void KeyControl::updatePitchAdjust() { qDebug() << " | m_pPitch " << m_pPitch->get(); } - double speedSliderPitchRatio = m_pitchRateInfo.pitchRatio / m_pitchRateInfo.pitchTweakRatio; // speedSliderPitchRatio must be unchanged - double pitchAdjustKnobRatio = KeyUtils::semitoneChangeToPowerOf2(pitchAdjust); + const double speedSliderPitchRatio = + m_pitchRateInfo.pitchRatio / m_pitchRateInfo.pitchTweakRatio; + m_pitchRateInfo.pitchTweakRatio = KeyUtils::semitoneChangeToPowerOf2(pitchAdjust); // pitch_adjust is an offset to the pitch set by the speed controls // calc absolute pitch - m_pitchRateInfo.pitchTweakRatio = pitchAdjustKnobRatio; - m_pitchRateInfo.pitchRatio = pitchAdjustKnobRatio * speedSliderPitchRatio; + m_pitchRateInfo.pitchRatio = m_pitchRateInfo.pitchTweakRatio * speedSliderPitchRatio; - double dFileKey = m_pFileKey->get(); + const double dFileKey = m_pFileKey->get(); updateKeyCOs(dFileKey, KeyUtils::powerOf2ToOctaveChange(m_pitchRateInfo.pitchRatio)); if constexpr (kEnableDebugOutput) { From 958e2f54754b4d5a6287b74e24898e29aa0e353c Mon Sep 17 00:00:00 2001 From: ronso0 Date: Fri, 6 May 2022 23:47:17 +0200 Subject: [PATCH 002/388] KeyControl: (fix) make "Lock original key" also reset pitch_adjust This prevents the continuous key shift when un/locking repeatedly with "Lock original key" and "Unlock, keep current key". --- src/engine/controls/keycontrol.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/engine/controls/keycontrol.cpp b/src/engine/controls/keycontrol.cpp index bba99180cc4..c4ce95d7289 100644 --- a/src/engine/controls/keycontrol.cpp +++ b/src/engine/controls/keycontrol.cpp @@ -189,11 +189,14 @@ void KeyControl::updateRate() { << speedSliderPitchRatio; qDebug() << " |"; } - } else { // Lock at original track pitch + } else { // Lock at original track pitch, reset pitch_adjust speedSliderPitchRatio = 1.0; + m_pitchRateInfo.pitchTweakRatio = 1.0; + m_pPitchAdjust->set(0); if constexpr (kEnableDebugOutput) { - qDebug() << " LOCK original key"; - qDebug() << " | speedSliderPitchRatio = 1.0"; + qDebug() << " LOCK original key, reset pitch_adjust"; + qDebug() << " | speedSliderPitchRatio =" << speedSliderPitchRatio; + qDebug() << " | pitchTweakRatio =" << m_pitchRateInfo.pitchTweakRatio; qDebug() << " |"; } } @@ -221,7 +224,7 @@ void KeyControl::updateRate() { qDebug() << " | / pitchTweakRatio" << m_pitchRateInfo.pitchTweakRatio; qDebug() << " | =" << qSetRealNumberPrecision(18) << speedSliderPitchRatio; qDebug() << " |"; - qDebug() << " : pitchTweakRatio *="; + qDebug() << " | pitchTweakRatio *="; qDebug() << " | speedSliderPitchRatio" << speedSliderPitchRatio; qDebug() << " | / tempoRatio " << m_pitchRateInfo.tempoRatio; qDebug() << " | =" << qSetRealNumberPrecision(18) @@ -265,7 +268,7 @@ void KeyControl::updateRate() { m_pitchRateInfo.pitchRatio = m_pitchRateInfo.pitchTweakRatio * speedSliderPitchRatio; if constexpr (kEnableDebugOutput) { - qDebug() << " : pitchRatio ="; + qDebug() << " | pitchRatio ="; qDebug() << " | pitchTweakRatio " << m_pitchRateInfo.pitchTweakRatio; qDebug() << " | * speedSliderPitchRatio" << speedSliderPitchRatio; qDebug() << " | =" << qSetRealNumberPrecision(18) << m_pitchRateInfo.pitchRatio; From 28a8a49828af4019503fe493af4117ef2874f1d6 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Sat, 7 May 2022 00:03:27 +0200 Subject: [PATCH 003/388] KeyControl: (fix) apply pitch_adjust on "Unlock, reset to linear pitch" --- src/engine/controls/keycontrol.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/engine/controls/keycontrol.cpp b/src/engine/controls/keycontrol.cpp index c4ce95d7289..b26f9ac61ec 100644 --- a/src/engine/controls/keycontrol.cpp +++ b/src/engine/controls/keycontrol.cpp @@ -237,15 +237,8 @@ void KeyControl::updateRate() { m_pPitchAdjust->set( KeyUtils::powerOf2ToSemitoneChange(m_pitchRateInfo.pitchTweakRatio)); } else { // Unlock and reset to linear pitch (orig. key + pitch fader offset) - // If 'current' aka 'not original' key was locked - // TODO(ronso0) Why does it depend on keylock mode? - if (m_keylockMode->get() == kLockCurrentKey) { - // reset to linear pitch - m_pitchRateInfo.pitchTweakRatio = 1.0; - // was missing? - // m_pPitchAdjust->set( - // KeyUtils::powerOf2ToSemitoneChange(m_pitchRateInfo.pitchTweakRatio)); - } + m_pitchRateInfo.pitchTweakRatio = 1.0; + m_pPitchAdjust->set(0); if constexpr (kEnableDebugOutput) { qDebug() << " UNLOCKING reset to linear pitch"; qDebug() << " : pitchTweakRatio = 1.0"; From f36934cf64e26fb7eb1c86c8176f2b5978586062 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Tue, 20 Jun 2023 00:43:04 +0200 Subject: [PATCH 004/388] DisableKeylockResetsPitch test: use KeyunlockMode::ResetLockedKey explicitly --- src/test/enginebuffertest.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/enginebuffertest.cpp b/src/test/enginebuffertest.cpp index 1c006dd7b56..db6e1629b0c 100644 --- a/src/test/enginebuffertest.cpp +++ b/src/test/enginebuffertest.cpp @@ -22,10 +22,12 @@ class EngineBufferTest : public MockedEngineBackendTest {}; class EngineBufferE2ETest : public SignalPathTest {}; TEST_F(EngineBufferTest, DisableKeylockResetsPitch) { - // To prevent one-slider users from getting stuck on a key, unsetting - // keylock resets the musical pitch. + // To prevent one-slider users from getting stuck on a key, + // KeyunlockMode::ResetLockedKey resets the musical pitch. ControlObject::set(ConfigKey(m_sGroup1, "keylockMode"), - 1.0); // kLockCurrentKey; + 1.0); // KeylockMode::LockCurrentKey + ControlObject::set(ConfigKey(m_sGroup1, "keyunlockMode"), + 0.0); // KeyunlockMode::ResetLockedKey ControlObject::set(ConfigKey(m_sGroup1, "file_bpm"), 128.0); ControlObject::set(ConfigKey(m_sGroup1, "keylock"), 1.0); ControlObject::set(ConfigKey(m_sGroup1, "pitch"), 0.5); From c13fc9eae50f4f93f17215e4caf6f522dfec85af Mon Sep 17 00:00:00 2001 From: ronso0 Date: Tue, 20 Jun 2023 00:45:24 +0200 Subject: [PATCH 005/388] PitchRoundtrip test: (fix) use KeyunlockMode::ResetLockedKey explicitly --- src/test/enginebuffertest.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/enginebuffertest.cpp b/src/test/enginebuffertest.cpp index db6e1629b0c..b40da975695 100644 --- a/src/test/enginebuffertest.cpp +++ b/src/test/enginebuffertest.cpp @@ -55,7 +55,9 @@ TEST_F(EngineBufferTest, TrackLoadResetsPitch) { TEST_F(EngineBufferTest, PitchRoundtrip) { ControlObject::set(ConfigKey(m_sGroup1, "keylock"), 0.0); ControlObject::set(ConfigKey(m_sGroup1, "keylockMode"), - 0.0); // kLockOriginalKey; + 0.0); // KeylockMode::LockOriginalKey + ControlObject::set(ConfigKey(m_sGroup1, "keyunlockMode"), + 0.0); // KeyunlockMode::ResetLockedKey ProcessBuffer(); // we are in kPakmOffsetScaleReseting mode ControlObject::set(ConfigKey(m_sGroup1, "rate"), 0.5); @@ -77,7 +79,7 @@ TEST_F(EngineBufferTest, PitchRoundtrip) { ASSERT_DOUBLE_EQ(0.5, ControlObject::get(ConfigKey(m_sGroup1, "rate"))); ControlObject::set(ConfigKey(m_sGroup1, "keylockMode"), - 1.0); // kLockCurrentKey; + 1.0); // KeylockMode::LockCurrentKey ProcessBuffer(); // rate must not change ASSERT_DOUBLE_EQ(0.5, ControlObject::get(ConfigKey(m_sGroup1, "rate"))); @@ -85,7 +87,7 @@ TEST_F(EngineBufferTest, PitchRoundtrip) { ASSERT_NEAR(0.5, ControlObject::get(ConfigKey(m_sGroup1, "pitch")), 1e-10); ControlObject::set(ConfigKey(m_sGroup1, "keylockMode"), - 0.0); // kLockOriginalKey; + 0.0); // KeylockMode::LockOriginalKey ProcessBuffer(); // rate must not change ASSERT_NEAR(0.5, ControlObject::get(ConfigKey(m_sGroup1, "pitch")), 1e-10); From a479828fcafabcc85e425cba330b65104f772d47 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Tue, 20 Jun 2023 01:15:28 +0200 Subject: [PATCH 006/388] PitchRoundtrip test: adjust to new pitch_adjust reset with key un/lock modes --- src/test/enginebuffertest.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/test/enginebuffertest.cpp b/src/test/enginebuffertest.cpp index b40da975695..76efc121e66 100644 --- a/src/test/enginebuffertest.cpp +++ b/src/test/enginebuffertest.cpp @@ -62,7 +62,7 @@ TEST_F(EngineBufferTest, PitchRoundtrip) { // we are in kPakmOffsetScaleReseting mode ControlObject::set(ConfigKey(m_sGroup1, "rate"), 0.5); ProcessBuffer(); - // pitch must not change + // pitch_adjust must not change ASSERT_DOUBLE_EQ(0.0, ControlObject::get(ConfigKey(m_sGroup1, "pitch_adjust"))); @@ -73,10 +73,11 @@ TEST_F(EngineBufferTest, PitchRoundtrip) { ControlObject::set(ConfigKey(m_sGroup1, "keylock"), 1.0); ProcessBuffer(); - // pitch and speed must not change - ASSERT_DOUBLE_EQ(0.5, - ControlObject::get(ConfigKey(m_sGroup1, "pitch_adjust"))); + // pitch is reset, as well as pitch_adjust + // speed must not change, pitch and pitch_adjust must be 0 ASSERT_DOUBLE_EQ(0.5, ControlObject::get(ConfigKey(m_sGroup1, "rate"))); + ASSERT_DOUBLE_EQ(0.0, ControlObject::get(ConfigKey(m_sGroup1, "pitch"))); + ASSERT_DOUBLE_EQ(0.0, ControlObject::get(ConfigKey(m_sGroup1, "pitch_adjust"))); ControlObject::set(ConfigKey(m_sGroup1, "keylockMode"), 1.0); // KeylockMode::LockCurrentKey @@ -84,15 +85,15 @@ TEST_F(EngineBufferTest, PitchRoundtrip) { // rate must not change ASSERT_DOUBLE_EQ(0.5, ControlObject::get(ConfigKey(m_sGroup1, "rate"))); // pitch must reflect the absolute pitch - ASSERT_NEAR(0.5, ControlObject::get(ConfigKey(m_sGroup1, "pitch")), 1e-10); + ASSERT_DOUBLE_EQ(0.0, ControlObject::get(ConfigKey(m_sGroup1, "pitch"))); ControlObject::set(ConfigKey(m_sGroup1, "keylockMode"), 0.0); // KeylockMode::LockOriginalKey ProcessBuffer(); // rate must not change - ASSERT_NEAR(0.5, ControlObject::get(ConfigKey(m_sGroup1, "pitch")), 1e-10); - // pitch must reflect the pitch shift only ASSERT_DOUBLE_EQ(0.5, ControlObject::get(ConfigKey(m_sGroup1, "rate"))); + // pitch must be 0 + ASSERT_NEAR(0.0, ControlObject::get(ConfigKey(m_sGroup1, "pitch")), 1e-10); } TEST_F(EngineBufferTest, SlowRubberBand) { From f888df729e9437e0a49bec942707f9b18ec59956 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Tue, 25 Apr 2023 10:04:33 +0200 Subject: [PATCH 007/388] Pref Mixer, ui: set xfader button group in ui file --- src/preferences/dialog/dlgprefmixer.cpp | 9 ++++----- src/preferences/dialog/dlgprefmixerdlg.ui | 9 +++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/preferences/dialog/dlgprefmixer.cpp b/src/preferences/dialog/dlgprefmixer.cpp index 4d745e66a6e..15d8f9a923d 100644 --- a/src/preferences/dialog/dlgprefmixer.cpp +++ b/src/preferences/dialog/dlgprefmixer.cpp @@ -72,10 +72,6 @@ DlgPrefMixer::DlgPrefMixer( m_bGainAutoReset(false) { setupUi(this); - QButtonGroup crossfaderModes; - crossfaderModes.addButton(radioButtonAdditive); - crossfaderModes.addButton(radioButtonConstantPower); - loadSettings(); connect(SliderXFader, @@ -148,7 +144,10 @@ DlgPrefMixer::DlgPrefMixer( setUpMainEQ(); - setScrollSafeGuardForAllInputWidgets(this); + setScrollSafeGuard(SliderXFader); + setScrollSafeGuard(SliderHiEQ); + setScrollSafeGuard(SliderLoEQ); + setScrollSafeGuard(comboBoxMainEq); slotUpdate(); slotApply(); diff --git a/src/preferences/dialog/dlgprefmixerdlg.ui b/src/preferences/dialog/dlgprefmixerdlg.ui index 878892ef87f..84b47a1a444 100644 --- a/src/preferences/dialog/dlgprefmixerdlg.ui +++ b/src/preferences/dialog/dlgprefmixerdlg.ui @@ -38,6 +38,9 @@ Slow fade/Fast cut (additive) + + buttonGroupCrossfaderModes + @@ -45,6 +48,9 @@ Constant power + + buttonGroupCrossfaderModes + @@ -658,5 +664,8 @@ Dynamically add Main EQ sliders --> + + + From c40030637c0f3cbef89454c9c7b16ebdfc7412d3 Mon Sep 17 00:00:00 2001 From: ronso0 Date: Tue, 25 Apr 2023 11:35:56 +0200 Subject: [PATCH 008/388] Pref Mixer, ui: fix widget tab focus order --- src/preferences/dialog/dlgprefmixerdlg.ui | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/preferences/dialog/dlgprefmixerdlg.ui b/src/preferences/dialog/dlgprefmixerdlg.ui index 84b47a1a444..3a1f98269cf 100644 --- a/src/preferences/dialog/dlgprefmixerdlg.ui +++ b/src/preferences/dialog/dlgprefmixerdlg.ui @@ -653,11 +653,11 @@ CheckBoxSingleEqEffect - SliderHiEQ - SliderLoEQ + CheckBoxBypass CheckBoxEqAutoReset CheckBoxGainAutoReset - CheckBoxBypass + SliderHiEQ + SliderLoEQ comboBoxMainEq pbResetMainEq + diff --git a/res/skins/LateNight/decks/rate_controls.xml b/res/skins/LateNight/decks/rate_controls.xml index 5312212b48f..33258d8a2e8 100644 --- a/res/skins/LateNight/decks/rate_controls.xml +++ b/res/skins/LateNight/decks/rate_controls.xml @@ -17,15 +17,16 @@ RateContainer vertical - min,me + max,me BpmRateTapContainer - vertical + horizontal min,me ,46 + 0me,0min BpmTapContainer stacked @@ -74,6 +75,7 @@ horizontal min,min + 0me,0min sync_enabled SyncDeck @@ -110,6 +112,90 @@ min,min + + + RateSliderBox + stacked + max,me + + + + 34f,121f + + + + RateSlider + 20f,119f + 5,2 + pitch_adjust + skin://sliders/knob_pitch_deck.svg + skin://sliders/slider_pitch_deck.svg + false + + + + true + 10.0 + false + + ,pitch_adjust + + + + + + + + + + RateSliderBox + stacked + max,me + + + + 34f,121f + + + + RateSlider + 20f,119f + 5,2 + pitch_adjust + skin://sliders/knob_pitch_deck.svg + skin://sliders/slider_pitch_deck.svg + false + + + + true + 10.0 + false + + ,pitch + + + + + + + RateSliderBox stacked diff --git a/res/skins/LateNight/decks/row_5_transportLoopJump.xml b/res/skins/LateNight/decks/row_5_transportLoopJump.xml index 3ef81e60f83..f7ded27c21a 100644 --- a/res/skins/LateNight/decks/row_5_transportLoopJump.xml +++ b/res/skins/LateNight/decks/row_5_transportLoopJump.xml @@ -222,73 +222,64 @@ - 2f,0min - i,min80, + me,min - + + LoopControls vertical min,min - 78,52 - 86,52 - + AlignLeftTop horizontal min,max -