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

Bug #555547 reported by Sean M. Pappalardo on 2010-04-05
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Wishlist
Sean M. Pappalardo
1.9
Wishlist
Sean M. Pappalardo

Bug Description

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.

Related branches

Changed in mixxx:
assignee: nobody → Pegasus (pegasus-renegadetech)
importance: Undecided → Wishlist
milestone: none → 1.8.0
status: New → Confirmed
RJ Skerry-Ryan (rryan) wrote :

not gonna happen for 1.8.0

Changed in mixxx:
milestone: 1.8.0 → 1.8.1
Changed in mixxx:
milestone: 1.8.1 → none
status: Confirmed → Triaged
description: updated
Changed in mixxx:
milestone: none → 1.9.0
status: Triaged → Confirmed
RJ Skerry-Ryan (rryan) on 2010-10-22
Changed in mixxx:
milestone: 1.9.0 → none
description: updated

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

summary: - Add soft-takeover to MIDI script engine
+ Add soft-takeover for MIDI controllers (XML and script)
RJ Skerry-Ryan (rryan) wrote :

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)

On Fri, Nov 12, 2010 at 4:35 PM, RJ Ryan <email address hidden> 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.)

> 2) 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.

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

Changed in mixxx:
milestone: none → 1.9.0
status: Confirmed → In Progress
RJ Skerry-Ryan (rryan) on 2010-11-18
Changed in mixxx:
milestone: 1.9.0 → none
Changed in mixxx:
status: In Progress → Triaged
milestone: none → 1.10.0
Changed in mixxx:
status: Triaged → In Progress

features_softtakeover merged in r2777 of trunk.

Changed in mixxx:
status: In Progress → Fix Committed
Jens Nachtigall (nachtigall) wrote :

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?

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.

RJ Skerry-Ryan (rryan) on 2011-12-25
Changed in mixxx:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers