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

Bug #555547 reported by Sean M. Pappalardo
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Wishlist
Sean M. Pappalardo
1.9
Won't Fix
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
Revision history for this message
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)
Changed in mixxx:
milestone: 1.9.0 → none
description: updated
Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

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)
Revision history for this message
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)

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote : Re: [Bug 555547] Re: Add soft-takeover for MIDI controllers (XML and script)

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.

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

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)
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
Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

features_softtakeover merged in r2777 of trunk.

Changed in mixxx:
status: In Progress → Fix Committed
Revision history for this message
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?

Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

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)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5373

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.