Skip to content

fix(mixer): reverse trim when input is reversed - #7943

Draft
pfeerick wants to merge 2 commits into
mainfrom
pfeerick/fix-input-trim-reverse
Draft

pfeerick wants to merge 2 commits into
mainfrom
pfeerick/fix-input-trim-reverse

Conversation

@pfeerick

@pfeerick pfeerick commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Fixes #2322

Summary

An input line can reverse its stick, either with a negative weight or with a custom curve. However, the trim was still applied in the original direction at the mix stage, so the stick and trim worked against each other: e.g. moving the stick right moved the channel negative, while trimming right moved it positive.

The trim value is added in the mix stage, after the input weight and curve have already been applied, and nothing recorded that the input was reversed. With this change, the trim's direction matches the physical stick: trimming right has the same effect as nudging the stick right. The trim's size is unchanged, so it still doesn't scale with input weight or expo.

An input is treated as reversed when exactly one of these is true:

  • its (evaluated) weight is negative, so a GV weight works too
  • it uses a custom curve whose output at full positive stick is lower than at full negative stick. This covers both an inverted curve reference (!CVn) and a curve with decreasing points.

A negative weight together with a reversing curve cancel out. Symmetric (V or U shaped) curves have no single direction, so the trim is left as before for them. Expo, diff and function curves never reverse the stick.

Changes:

  • applyExpos() records per input whether the active input line reverses it.
  • getSourceTrimValue() negates the trim for such inputs. It also negates the stick value passed for the throttle idle-trim scaling, so idle-only trim still applies at the correct end of the stick travel. The existing inverted mix source handling still applies on top.
  • getValueForLogicalSwitch() applies the same reversal, so logical switches on an input match the mix output.
  • instantTrim() negates the measured offset for reversed inputs. Otherwise it would double the offset instead of cancelling it.

moveTrimsToOffsets() works on the final mixer output, so it needed no change. Reversals after the Inputs stage (negative mix weight, !Input mix source, mix curves, output reverse) already applied to stick and trim alike.

⚠️ Behaviour change

Models that reverse a stick in Inputs (with a negative weight, !CVn, or a decreasing custom curve) and had their trims set with the old behaviour will see those trims act in the opposite direction after updating. Those trims would need to be re-centred or re-set.

Testing

  • New gtests:
    • TrimsTest.ReversedInputTrim
    • TrimsTest.ReversedInputCurveTrim
    • TrimsTest.InstantTrimReversedInput
    • an extra case in getSwitch.inputWithTrim
  • tools/commit-tests.sh passes for tx16s, x9dp2019, mt12 (surface), and pl18 and h17 (stick dead zone).
  • Not yet tested on hardware.

🤖 Generated with Claude Code

@pfeerick pfeerick added this to the 3.0 milestone Oct 25, 2026
@pfeerick pfeerick added bug 🪲 Something isn't working rn: warning Warning needed in release notes labels Oct 25, 2026
pfeerick and others added 2 commits October 25, 2026 12:59
When an input line has a negative weight the stick is reversed, but its
trim was still applied in the original direction at the mix stage, so
stick and trim worked against each other.

Record whether the active input line reverses the input, and flip the
trim accordingly for mixes, logical switches and instant trim.

Fixes #2322

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An input can also be reversed by its custom curve, either with an
inverted curve reference (!CVn) or with a curve whose points decrease.
Treat a custom curve whose output at full positive stick is lower than
at full negative stick as reversing, combined with the weight sign so
that both together cancel out.

Symmetric curves (e.g. V or U shaped) have no single direction, so the
trim is left unchanged for them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pfeerick
pfeerick force-pushed the pfeerick/fix-input-trim-reverse branch from 2249327 to 62028d6 Compare October 25, 2026 02:59
@pfeerick pfeerick changed the title fix(mixer): reverse trim when input has negative weight fix(mixer): reverse trim when input is reversed Oct 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🪲 Something isn't working rn: warning Warning needed in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trim travel wrong direction

1 participant