Skip to content

Metaknob soft takeover#1111

Merged
rryan merged 2 commits intomixxxdj:masterfrom
Be-ing:metaknob_soft_takeover
Jan 13, 2017
Merged

Metaknob soft takeover#1111
rryan merged 2 commits intomixxxdj:masterfrom
Be-ing:metaknob_soft_takeover

Conversation

@Be-ing
Copy link
Copy Markdown
Contributor

@Be-ing Be-ing commented Jan 7, 2017

Follow-up from discussion on #1062:

  • When an effect is on, do not make parameters audibly jump when metaknob changes. If the superknob is turned, do not make metaknobs jump for effects that are on.
  • When an effect is off, do not do any automatic soft takeover. Snap parameters to position of metaknob when the metaknob turns (either directly or by the superknob). With Effect enable switches changes #1103, this does not interfere with loading initial states of knobs from controllers when Mixxx starts. It also makes it easier to experiment with different metaknob linkings.

@rryan rryan mentioned this pull request Jan 7, 2017
@daschuer
Copy link
Copy Markdown
Member

daschuer commented Jan 8, 2017

This works as advertised, and seams to be nice. I there are only some remaining worries, if the conditional disabled oversoft will leads to confusion because it may kick in or out when not expected.
A third voice would be nice.
@timrae: Could you have a look?

@daschuer
Copy link
Copy Markdown
Member

daschuer commented Jan 8, 2017

I wonder why we see commits here that are currently in master.
Did you debase the previous branch? Than this need to be rebase on master as well.

@timrae
Copy link
Copy Markdown
Contributor

timrae commented Jan 8, 2017

@timrae: Could you have a look?

Sure

@Be-ing Be-ing closed this Jan 9, 2017
@Be-ing Be-ing force-pushed the metaknob_soft_takeover branch from 0701908 to 836db6a Compare January 9, 2017 01:14
@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Jan 9, 2017

Yikes I tried to rebase and it lost the new commit >.<

@Be-ing Be-ing reopened this Jan 9, 2017
@Be-ing Be-ing force-pushed the metaknob_soft_takeover branch from 6c672de to 0701908 Compare January 9, 2017 01:26
@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Jan 9, 2017

Alright, looks good now. I think that happened because I branched off my per_effect_metaknobs branch, added a commit to this branch, then added another commit to per_effect_metaknobs before that was merged.

connect(m_pControlMetaParameter, SIGNAL(valueChanged(double)),
this, SLOT(slotEffectMetaParameter(double)));

m_pSoftTakeover = new SoftTakeover();
Copy link
Copy Markdown
Contributor

@timrae timrae Jan 9, 2017

Choose a reason for hiding this comment

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

Does this need a delete or it owned by the object tree? (If the former, consider using unique_ptr as per the discussion in #953)

@timrae
Copy link
Copy Markdown
Contributor

timrae commented Jan 9, 2017

I'm testing it now... With the current master branch, metaknob itself has soft takeover already (I only checked flanger which only has one parameters assigned to meta, it may be different for other effects). However, the super knob and the meta knob do not have any soft takeover in terms of the interaction between them. Is that the objective of this PR?

The sync between the two is still not perfect, as demonstrated by the following steps:

  1. Enable flanger effect
  2. Turn metaknob all the way down to zero on your controller
  3. Turn super knob all the way up to max in the GUI
  4. Turn metaknob on your controller

--> Audible jump

@timrae
Copy link
Copy Markdown
Contributor

timrae commented Jan 9, 2017

the conditional disabled oversoft will leads to confusion because it may kick in or out when not expected

Do you mean people will be confused that the soft takeover doesn't occur when the effect is disabled? The only situation where I think it might be confusing is if the user maps both super knob and meta knobs on their controller. We should tell them not to do this.

Otherwise, in general I feel that soft takeover being disabled is more intuitive than being enabled, so only enabling soft takeover when the effect itself is enabled (with the priority of preventing audible jumps) makes sense to me.

@daschuer
Copy link
Copy Markdown
Member

daschuer commented Jan 9, 2017

@timrae Thank, you. This means we are on the right track. :-)

@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Jan 9, 2017

The sync between the two is still not perfect, as demonstrated by the following steps:
Enable flanger effect
Turn metaknob all the way down to zero on your controller
Turn super knob all the way up to max in the GUI
Turn metaknob on your controller
--> Audible jump

I cannot reproduce that with this branch. Are you sure you tested the correct branch?

@timrae
Copy link
Copy Markdown
Contributor

timrae commented Jan 9, 2017 via email

@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Jan 10, 2017

Could you try checking out this branch and building it?

@timrae
Copy link
Copy Markdown
Contributor

timrae commented Jan 10, 2017

The way I was checking it is more indicative of the effect of merging this PR, so I prefer you rebase this into master and check that. Plus I might not have time today

@Be-ing Be-ing force-pushed the metaknob_soft_takeover branch from 0701908 to 42d3262 Compare January 10, 2017 23:56
@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Jan 10, 2017

Okay, rebased it onto master.

@timrae
Copy link
Copy Markdown
Contributor

timrae commented Jan 11, 2017 via email

@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Jan 11, 2017

Yes. I cannot reproduce the issue. It's working as intended as far as I can tell.

@timrae
Copy link
Copy Markdown
Contributor

timrae commented Jan 11, 2017 via email

@timrae
Copy link
Copy Markdown
Contributor

timrae commented Jan 11, 2017

It's still happening...

@timrae
Copy link
Copy Markdown
Contributor

timrae commented Jan 11, 2017

See around 25s
recording.zip

@timrae
Copy link
Copy Markdown
Contributor

timrae commented Jan 11, 2017

This is with 42d3262 and gcc 6.2 on Ubuntu x64, Qt version 4.8.7

@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Jan 11, 2017

Oh, I was testing with my controller which had soft takeover enabled by its script. >.<

@daschuer
Copy link
Copy Markdown
Member

I have watched the recording, and I actually think this behavior is correct if you do not have softtakover enabled on your controller. you most likely see an out of sync situation between GUI meta knob and controller meta knob.

  • You turn the meta knob fully left.
  • Than you turn the super knob fully right.
    -> the hidden GUI Metaknob follows the super knob, the controller knob is unchanged
  • now you touch the Metaknob on the controller, the GUI knob jumps back.
    This is IMHO correct for no controller softtakover.

The issue targeted here is just the other way round.

  • Turn the super knob
    -> meta follows
  • Turn the meta knob
  • Turn the super knob again
    Without this PR meta jumps to super without the chance to fix this in the controller mapping
    Now we get a out of sync and snap in behavior.

Does this work for you?
An alternative would be to let meta not follow super. But then we loose the nice GUI feedback.

@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Jan 12, 2017

The issue targeted here is just the other way round.

Yes, this PR fixes the issue you outlined. Together with soft takeover activated by the controller mapping it solves the issue @timrae reported.

An alternative would be to let meta not follow super.

That would be overcomplicated. I don't think we need to introduce any more ControlObjects for the new effects interface.

Comment thread src/effects/effectslot.h
QList<EffectParameterSlotPointer> m_parameters;
QList<EffectButtonParameterSlotPointer> m_buttonParameters;

SoftTakeover* m_pSoftTakeover;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Does this need to be deleted in the destructor?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, though you can make it a member variable so you don't have to allocate it at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in rebased and force pushed commit.

@timrae
Copy link
Copy Markdown
Contributor

timrae commented Jan 12, 2017 via email

@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Jan 12, 2017

The other issue this PR solves is:

  1. Turn the metaknob
  2. Adjust a parameter knob linked to the metaknob
  3. Turn the metaknob

If the effect is enabled, the manually adjusted parameter should not jump.

If an effect is on, avoid making parameters audibly jump. If effect is
off, do not do soft takeover, just snap parameters to position of
metaknob. Controller mappings still must enable soft takeover for
the super/metaknobs as appropriate.
@Be-ing Be-ing force-pushed the metaknob_soft_takeover branch from 42d3262 to 8c06c3e Compare January 12, 2017 01:06
@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Jan 12, 2017

Ready for merge?

@rryan
Copy link
Copy Markdown
Member

rryan commented Jan 12, 2017

Looks good to me. SuperLinkTest.Softtakeover is failing because the test does not enable the effect. Could you split SuperLinkTest.SoftTakeover into SuperLinkTest.SoftTakeover_EffectEnabled and SuperLinkTest.SoftTakeover_EffectDisabled to cover both cases?

�[0;32m[ RUN      ] �[mSuperLinkTest.Softtakeover
Loading resources from  "/home/travis/build/mixxxdj/mixxx/res/" 
src/test/super_link_test.cpp:120: Failure
Value of: m_pControlValue->get()
  Actual: 0.25
Expected: 1.0
Which is: 1
src/test/super_link_test.cpp:128: Failure
Value of: m_pControlValue->get()
  Actual: 0.55
Expected: 0.1
�[0;31m[  FAILED  ] �[mSuperLinkTest.Softtakeover (9 ms)

Test for new metaknob -> parameter and superknob -> metaknob behavior both when effect is enabled and disabled.
@rryan
Copy link
Copy Markdown
Member

rryan commented Jan 13, 2017

Nice, thanks for the extra tests!

@Be-ing
Copy link
Copy Markdown
Contributor Author

Be-ing commented Jan 13, 2017

Is there a such thing as extra tests? :P

Unit test ALL the things!

@rryan rryan merged commit 220be8a into mixxxdj:master Jan 13, 2017
@Be-ing Be-ing deleted the metaknob_soft_takeover branch February 1, 2017 01:15
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

Successfully merging this pull request may close these issues.

4 participants