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

Add soft-takeover for MIDI controllers (XML and script) #5373

Closed
mixxxbot opened this issue Aug 22, 2022 · 9 comments
Closed

Add soft-takeover for MIDI controllers (XML and script) #5373

mixxxbot opened this issue Aug 22, 2022 · 9 comments
Labels
Milestone

Comments

@mixxxbot
Copy link
Collaborator

Reported by: Pegasus-RPG
Date: 2010-04-05T06:38:52Z
Status: Fix Released
Importance: Wishlist
Launchpad Issue: lp555547


It would be useful in many cases for MIDI scripts to perform "soft-takeover" which prevents changing the MixxxControl value until the physical control matches (or comes within close range of) the MixxxControl value, avoiding sudden drastic control value changes. Adding this check as part of the MidiScriptEngine::setValue() function (using an extra boolean flag) is easy to do and can be used as needed for individual MixxxControls, but the downside is that it must be done on each setValue call as opposed to just setting a flag in the MixxxControl once and it being automatically handled. (Doing it in setValue() does allow for maximum flexibility however, and script writers need only do a search & replace to use it.)

An alternative, possibly better, idea is to add a new MidiScriptEngine::setSoftTakeover(group,key,bool) function that a script can call at will. This would avoid having to do it on every setValue() call making it easy to add this functionality to existing scripts. (The new function would add/delete the specified MixxxControl to/from a QHash<ConfigKey,float prevValue> m_softTakeover which setValue() would check, update, and act on appropriately.)

Also see about adding it as an <option> for XML-mapped controls.
@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2010-06-17T20:13:25Z


not gonna happen for 1.8.0

@mixxxbot
Copy link
Collaborator Author

Commented by: Pegasus-RPG
Date: 2010-11-10T14:29:59Z


XML mapping support added in r2545 of trunk. Algorithm needs tuning though.

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2010-11-12T15:35:41Z


Couple problems with the current implementation:

  1. Threshold for takeover is fixed at 10. How does this interact with non-linear knobs like log-potmeters?

  2. Multiple MIDI options not possible with the XML. The soft-takeover option 'takes over' the midi option. (sorry I had to)

@mixxxbot
Copy link
Collaborator Author

Commented by: Pegasus-RPG
Date: 2010-11-13T11:21:18Z


On Fri, Nov 12, 2010 at 4:35 PM, RJ Ryan wrote:

  1. Threshold for takeover is fixed at 10. How does this interact with
    non-linear knobs like log-potmeters?

I have to figure out a better way to do this. I think taking time into
account will work. (E.g. if there's a new hardware value within 50ms
or something, just jump to the newly-supplied value. If longer than
that, then ignore it unless the previous hardware value was equal to
the software one.)

  1. Multiple MIDI options not possible with the XML. The soft-takeover
    option 'takes over' the midi option. (sorry I had to)

Indeed it does. Fixing that was outside of the scope of what I was
trying to do, but I can take care of that as well.

@mixxxbot
Copy link
Collaborator Author

Commented by: Pegasus-RPG
Date: 2010-11-17T00:49:28Z


r2558 of the features_softtakeover branch includes segfault fixes and adds soft-takeover to MIDI scripting.

@mixxxbot
Copy link
Collaborator Author

Commented by: Pegasus-RPG
Date: 2011-04-28T21:56:39Z


features_softtakeover merged in r2777 of trunk.

@mixxxbot
Copy link
Collaborator Author

Commented by: jenszo
Date: 2011-09-20T20:24:06Z


I cannot see any file in res/midi/*.js which already uses http://www.mixxx.org/wiki/doku.php/midi_scripting#soft-takeover
If mixxx 1.10 would be released like this, this feature could only be enabled by manually editing the .js file.

For me, I have now added at least the soft-takeover for the pitch of the RMX (very useful after one has pressed the "sync" button):
engine.softTakeover("[Channel1]","rate",true);
engine.softTakeover("[Channel2]","rate",true);
but why isn't the softTakeover enabled for all other knobs? I could send a patch, if you would welcome one for 'mixxx/res/midi/Hercules-DJ-Console-RMX-scripts.js' Or is somebody else doing so already?

@mixxxbot
Copy link
Collaborator Author

Commented by: Pegasus-RPG
Date: 2011-09-20T20:48:14Z


I didn't write the RMX script, but sure, we'll take a patch for that. Just make sure that any shifted functions still work correctly, with or without soft-takeover as appropriate.

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

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

No branches or pull requests

1 participant