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

Jog wheel / playposition not aligning to beatgrid of another playing track #10155

Closed
mixxxbot opened this issue Aug 23, 2022 · 24 comments
Closed

Comments

@mixxxbot
Copy link
Collaborator

Reported by: fkbreitl
Date: 2020-10-06T10:32:06Z
Status: Fix Released
Importance: Undecided
Launchpad Issue: lp1898701
Attachments: [Video demonstrating the issue](https://bugs.launchpad.net/bugs/1898701/+attachment/5420865/+files/Video demonstrating the issue)


Since I haven't received an answer at https://mixxx.discourse.group/t/jog-wheel-not-snapping-to-beatgrid/20044 I am wondering if it could be a bug for all controllers in general.

Unfortunately I have no other controller to test this.
But for the Pioneer DDJ-200 the problem is the following:

When I use the jog wheel of the track does not snap to the beatgrid of the track on the other deck.
I have beat sync turned on and it works when I shift the track with the mouse or finger via touch screen.
I am using Mixxx 2.3 on Windows 10 v1909.

Or is there anything missing in that mapping?
I am using https://github.com/fkbreitl/mixxx-ddj-200-mapping

@mixxxbot
Copy link
Collaborator Author

Commented by: fkbreitl
Date: 2020-10-09T18:36:14Z


This wheel solution by Ronso at the forum

<control>
    <group>[Channel1]</group>
    <key>playposition</key>
    <description>wheel * hold</description>
    <status>0xB0</status>
    <midino>0x29</midino>
    <options>
        <rot64/>
    </options>
</control>

also works for the DDJ-200 without any Javascript function.
However, still the tracks don't align after the wheel is used.
This seems to me like another indication that playposition is not working as expected.

In addition I could find any documentation about the rot64 option.
Where can I find it?

@mixxxbot
Copy link
Collaborator Author

Commented by: fkbreitl
Date: 2020-10-11T12:48:02Z
Attachments: [Video demonstrating the issue](https://bugs.launchpad.net/mixxx/+bug/1898701/+attachment/5420865/+files/Video demonstrating the issue)


From other controller mappings it seems that jog wheels are supposed to use playposition. However playposition doesn't aligning tracks even if quantize is turned on.
I have attached a video demonstrating the issue.

I think there is a bug in playposition which also needs to do a beats_translate_match_alignment if quantize is on.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2020-10-11T13:40:18Z


This is the intended nudge feature. If you play the tracks in sync an you hear a double beat, you can use the jog wheel to nudge the track as if you touch the vinyl to adjust an persistent sync offset.

The jog wheel feature are required to be not quantize to avoid a "needle jump" effect.

Mapping the playposition and friends like playposition_down_small allow synced seeks if quantize is enabled. But I can imagine that this is hard to map to.

What is you use case musically?

Doing a beat jump?

@mixxxbot
Copy link
Collaborator Author

Commented by: fkbreitl
Date: 2020-10-11T15:19:34Z


I just want tracks aligned when I move them and don't like to press beat sync after using the jog wheel.
In Rekordbox there is no difference between shifting the track by mouse, screen or jog wheel.
So I think Mixxx shouldn't make it different either.

@mixxxbot
Copy link
Collaborator Author

Commented by: ronso0
Date: 2020-10-11T15:20:49Z


If it's about the 'playposition' connection it indeed seems broken for controllers.
The overview is also connected to this control and when jumping around in there it always aligns the beats.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2020-10-11T16:37:51Z


It is intended to keep the offset and I think we must not change it, because adjusting the phase is my main jogwheel use case during a transition.

I have not jet understand the need to stay in phase when turning the jog wheel. Please explain step by step.

@mixxxbot
Copy link
Collaborator Author

Commented by: ronso0
Date: 2020-10-11T16:55:54Z


This is not about nudge or scratch, it's about the [group],playposition control for 'browsing' the track and it should really behave the same when mapped to controllers.

IMO the only way it's relevant is to jump in the track. If the beats aren't aligned anymore beatjump would also not help to find the right place (phase, position in bar or phrase) but 'beats_translate_match_alignment' is needed after jumping.

@mixxxbot
Copy link
Collaborator Author

Commented by: fkbreitl
Date: 2020-10-11T17:59:08Z


@daniel Exactly as Ronso0 says, its not about nudging when you touch the wheel from the side.
Its about the playposition when you touch it from the top.
It is important for aligning tracks when beat sync is on.
If you want to nudge the phase just don't use beat sync or if you do adjust your beatgrid.

@ronso0 I also thought that something like beats_translate_match_alignment has to happen in addition. It already seem to happen when then track is moved with the mouse.
But seems like not the same code is used by the controllers.

@mixxxbot
Copy link
Collaborator Author

Commented by: fkbreitl
Date: 2020-10-11T18:07:42Z


@ronso0 Could you please confirm the bug and give it a certain importance, since it would be nice to have it fixed in Mixxx 2.3 final.

@mixxxbot
Copy link
Collaborator Author

Commented by: ronso0
Date: 2020-10-11T22:13:19Z


Just to make sure, as this wasn't mentioned yet:
you don't refer to scratching, right?
We talk about touch&turn the wheel (probably with some modifier) so that it quickly moves the playposition in the track, mostly half a turn to scroll through the track.

@mixxxbot
Copy link
Collaborator Author

Commented by: ronso0
Date: 2020-10-11T22:13:38Z


I can test this soon.

@mixxxbot
Copy link
Collaborator Author

Commented by: fkbreitl
Date: 2020-10-11T22:45:10Z


Yes, that's right.
Great!

@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2020-10-12T01:39:22Z


how is your controller set up? Is it designed to do a "playposition" seek when the wheel is touched, and a regular nudge when it's not being touched? If so, I suspect what's happening is that after you lift your finger off the wheel, the wheel is still moving. Because it's no longer being touched Mixxx is registering a nudge for a fraction of a second. In some controllers I have special code (https://github.com/mixxxdj/mixxx/blob/master/res/controllers/Vestax-VCI-400-scripts.js#L615) to add inertia to the wheel touch value to account for this. Perhaps we should standardize this somehow.

@mixxxbot
Copy link
Collaborator Author

Commented by: fkbreitl
Date: 2020-10-12T07:56:00Z


@owen Yes, this is my controller setup and I have just confirmed that it is the momentum and nudging what stops the aligning. If I do it very slowly the alignment happens as expected.

So yes, I think a general solution is needed to avoid this. Otherwise every controller mapping would need your workaround.

Thank you for explaining the cause of the problem.

@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2020-10-12T19:00:26Z


The solution in the scripts I've written is basically:

  • detect wheel touch disable
  • start a callback timer at 100ms
  • if a wheel tick has been received, keep waiting
  • if at any point the wheel is touched again, cancel the timer
  • if no wheel ticks have been received within the tick time, actually release the wheel touch.

This would probably have to be written in javascript. Unfortunately we're in a state where we have an old, barely-supported js library, and no replacement new one, so it's not really possible to add new js library functions right now.

@mixxxbot
Copy link
Collaborator Author

Commented by: fkbreitl
Date: 2020-10-12T20:19:55Z


The timer fix by @owen also workes for me.
However, it causes some delay of the alignment, because the end of the touch (from the top) gets delayed by the timer.
To avoid this I disabled the nudging (touch from the side) instead which resulted immediate alignment as desired.
So I would like to share this improved fix.
I do it by overwriting the jog (side touch) function and restoring it by the timer after 900 ms.

 DDJ200.jog = function () {};
 engine.scratchDisable(deckNumber);
 engine.beginTimer(900, "DDJ200.jog = DDJ200.jog_old;", true);

Maybe this is what Mixxx should do by default.
And the timer variable could be an option of the preferences.

@mixxxbot
Copy link
Collaborator Author

Commented by: fkbreitl
Date: 2020-10-12T20:34:05Z


... if control of this timer is really needed (for high momentum jog wheels?) and not everybody is happy with a reasonable value that suits all controllers and DJs (of a few seconds?).

@mixxxbot
Copy link
Collaborator Author

Commented by: fkbreitl
Date: 2020-10-12T20:48:55Z


@owen I just see now your comment #⁠15, now.
Thank you for the explanation of your solution.
It is more complicated than what I proposed, because you are waiting for wheel to stop spinning.
Instead I am just waiting for the DJ to take his hand of, which is simple.
Maybe for a first step we should take the easy way and only add more complexity if we realize that it is really needed.

@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2020-10-12T21:58:54Z


In my use case, I use wheel touch to set and unset the scratch2_enabled mode. (This is default behavior for jog wheels). With this mode, the DJ definitely wants to hear all of the momentum of the jog wheel.

For a fast jog mode (where playposition is being set) I do agree that jogging should stop when the button is released, and then all wheel updates are ignored until the wheel stops. It's complex, but I think it makes sense to do different things with the inertia period.

For now I don't think we should make a generic mixxx solution. There are enough different kinds of controllers and wheels that we're better off with one-off solutions for now.

@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2020-10-12T22:22:28Z


I implemented my new suggestion here: https://github.com/mixxxdj/mixxx/pull/3074/files#diff-845b0cd1bdf75c9c259ab036da160e11dac7ba8088693a20febdd1df59d2694e

It works really well!

@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2020-10-12T22:22:54Z


(look for "TraktorS3.Deck.prototype.jogButtonHandler" and the stuff below that)

@mixxxbot
Copy link
Collaborator Author

Commented by: fkbreitl
Date: 2020-10-13T08:47:43Z


And here an improved version using just a jog_disabled variable instead of a function.

 DDJ200.jog_disabled = true; // disable jog to not prevent alignment    
 engine.scratchDisable(deckNumber);
 engine.beginTimer(900, "DDJ200.jog_disabled = false;", true);

https://github.com/fkbreitl/mixxx-ddj-200-mapping/blob/master/Pioneer-DDJ-200-scripts.js

Could somebody please help us with

#2377

to get the DDJ-200 mapping into the Mixxx repository.
I think we have done everything from our side but it is still not merged.

@mixxxbot
Copy link
Collaborator Author

Commented by: fkbreitl
Date: 2021-03-23T17:56:40Z


In summary: the reason for synced tracks not getting aligned after the jog wheel was scratched is that because of its momentum it rotates further after it is released.
Then nudging takes place which ignores the alignment.
The solution is to disable nudging for a moment until the wheel comes to a stop.
An example is found in the Pioneer DDJ200 controller script which has been committed to version 2.2.

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant