Support devices with reversed fader direction #62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I realise that you don't necessarily want to support every possible device, so I won't be offended if you don't want to merge this! However, I think this is quite general and clarifies some of the intention of the code, and it might make it easier to maintain forks that add functionality.
This separates the meaning of
flip
into its two components:flipOrder
- which fader is 1 and which is 16 etc.reverseMinMax
- which end of the fader is whichBy default, these are both the same, following the layout of the original 16n in which the fader is at its lowest voltage at the bottom.
However, in order to support the Sweet Sixteen or any other hypothetical build with reversed faders, we can define
REVERSED_FADERS
, and the normal (non-flipped) order will be with the highest voltage at the bottom. This is implemented by interpretingreverseMinMax
as the opposite offlip
.Or, in tabular form:
This also allows the Sweet Sixteen to be operated upside down, if desired.