Keylock: Option how key is unlocked/reset#1222
Conversation
Thank you for adopting this. I think a preferences option is a good approach for testing this mode. Does th key knob turn if you unlock with the new mode? Will a key knob get into "softtakover out of sync" state after toggling in the new mode? How is the user able to reset to original key and rate after keylock was used? |
Who has a key knob (not rotary encoder)? Assuming you mean the tiny sliders in Shade, I will test all this now that Travis is happy.
Any user without a physical key reset button or unable/unwilling to use GUI controls or keyboard is well served with the existing options. Current behaviour should stay default, no discussion about that. What I propose is the possibility to play with pitch after keylock release, be it jog wheels, pitch fader or 'rate_temp_up/down' buttons, only without that sudden jump. I don't see another use for that. Let's say a user consciously enables the new option (and then disables keylock) he probably knows that i.e. pitch fader or jog wheels affect key and also knows how to deal with it. Furthermore it matters which combination of lock & unlock options is used: if I keep key on keylock release, then play with it (beat offset guaranteed), I could quickly move pitch fader somewhere near center, then "lock original" and fade back to desired tempo without a huge key jump. "Reset key on track load" saves any further trouble. That said, I can only see the mentioned use case as a reason to enable this non-default option: Puh, that got long. Hope I also answered your question ;) And I always use "lock original key" and -only rarely- match keys between decks. I imagine, someone how relies on matching keys for harmonic mixing probably matches and locks them on track load anyway. |
I mean the Deere key knob. The user can map for example the fixed scale deck gain knob to key. We should at least have a clue what will happen than. "Reset Key" should be the default and the leftmost radio button There is an issue with the key display. I had expected the following with the "Keep Key" mode
|
| // If "Reset (unlocked) Key" is enabled | ||
| if (m_keyunlockMode->get() == kResetUnlockedKey) { | ||
| // If 'current' aka 'not original' key was locked | ||
| if (m_keylockMode->get() == kLockCurrentKey) { |
There was a problem hiding this comment.
Regardless of my changes, I wonder what happens here if original key was locked but changed afterwards, manually or with "match key"
There was a problem hiding this comment.
In this case the Key knob is cranked, right? Original "Reset Key" reset to this cranked key at rate = 1. Is there a use case for this?
The user may use it like this:
- match key
- enable key-lock
- match beat
- Unlock key ... what will happen ?? The key jumps to rather random key now, by adding the offset introduced by the rate slider.
I think in the "Keep Key" case, the offset should be applied to the key knob by turning it.
|
It's not working. Yet. Also I learned that everything in DlgPrefControls::slotResetToDefaults() is only set when "Restore Defaults" button is clicked. I will either swap the two buttons or explicitly set it like it is done i.e. for "PositionDisplay". Same applies to Keylock mode. |
|
I'll add debug messages to keycontrol.cpp where the key lock/unlock is processed. And I found possibly related stuff in engine/enginebuffer.cpp. Will read through this and see if has to do with keycontrol. Not as easy as it appeared at first glance... |
|
The "Restore Defaults" works, but restores "Keep key" it should default to "Reset Key" |
| m_pitchRateInfo.pitchTweakRatio = 1.0; | ||
| // For not resetting to linear pitch: | ||
| // Adopt speedPitchRatio change as pitchTweakRatio | ||
| //pitchRateInfo.pitchTweakRatio *= (m_speedSliderPitchRatio / pitchRateInfo.tempoRatio); |
There was a problem hiding this comment.
I think you need to uncomment this code to make your feature work.
There was a problem hiding this comment.
Nice, I will try. Though I don't understand the related pitch stuff in enginebuffer, yet.
|
Okay, it's working as intended:
Only problem: when pitch slider is moved after unlocking and key is not reset manually with lock/unlock original key or just 'reset_key', key won't be "reset on track load" even tough Prefs are set so. I could a) include this reset here in basetrackplayer.cpp or b) just create something like slotResetPitchTweakRatio in keycontrol.cpp directly and connect it to EngineBuffer::trackLoaded like it's done for 'pitch_adjust'. Meanwhile I try to extend the keylock tests to also cover the new unlock mode. |
|
You can simply override the EngineControl::trackLoaded() function. Looking at the surrounding code, all the forth and back between the enginebuffer and base track player is looking odd. Normally it should be informed about the new track inside this But this is a topic of a separate PR. |
|
I think the key knob should jump if you unlock the key in keep mode. Currently it suffers this:
|
|
Okay, I will try to fix that. |
|
Key offset (pitch_adjust) is now adopted when unlocking. I tested with Deere: key jumps when unlocking, further key changes work correctly
It seems this issue is solved by last commit, as well. |
|
Jippie :-) It works now like a charm. Thank you. LGTM. |
In Bug #1653631 I described the -at least for me- unexpected behaviour when releasing keylock
while rate is not 0 (pitch slider is off center), and got to know the reasons for the
current situation:
1 a track is running, keylock is ON, pitch/tempo != original
2 release keylock
3 key is reset to original > That 'jumping' key on right now is odd!
How I would love it:
2 release keylock
3 key is kept but now unlocked
4 any further rate change changes key accordingly
Reason is, with unlocked key it's much fun gently nudging the jogwheels to temporarily
vary the key to simulate an old turntable, or a worn out cassette.
I added another row in Preferences > Interface called "Keyunlock mode" where users can choose
wether to adapt key to current tempo (default, current behaviour) or to keep previously locked key
until next rate change. This way, the unlock behaviour wouldn't change, unless users choose so.
I will test if this works out with my changes so far.
The wording is just a quick shot.
What do you think?