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

„Make relative“ for fader/knob Sources in Controller Mappings #468

Closed
vonglan opened this issue Nov 1, 2021 · 21 comments
Closed

„Make relative“ for fader/knob Sources in Controller Mappings #468

vonglan opened this issue Nov 1, 2021 · 21 comments
Labels
enhancement New feature or request high priority

Comments

@vonglan
Copy link

vonglan commented Nov 1, 2021

Like #203, but without the general switchability.

Examples:
source: 0%, target 50%.
source: 10% --> target 60%
source: 50% --> target 100%
source: 60% --> target 100% (extreme has been reached, further movement in that direction just reduces the delta)
source: 50% --> target 90%
source: 0% --> target 40%
source 100%: --> target 100% (again, extreme reached, but this time the offset is reset to 0)
source: 0% --> target 0%

The first control value received can not yet change the target value. It only serves for setting the initial offset value. (It might send a neutral target value to the target value, to avoid an "unmatched" event.)

I am not sure yet what the best name for this is.
"Make relative" is misleading, because technically the knob/fader movement will be forwarded as an absolute target value (if I understand correctly).
I think the behavior is identical to "takeover mode = parallel" (which I have not used yet, and which is not available for Controller mappings).

@helgoboss
Copy link
Owner

Yes, that's pretty much takeover mode "Parallel". I can add that.

I think "Make relative" would be consequent. Incoming absolute values will be converted to increments/decrements by diffing values, so "make relative" is actually an accurate description of what's going on. Yes, most targets take absolute values and therefore technically the target will be hit with an absolute value but that's just an implementation detail. That's true even for sources that natively emit increments/decrements (= relative messages) such as encoders.

@vonglan
Copy link
Author

vonglan commented Apr 5, 2022

Thanks for looking into this!

I checked out the "parallel takeover" mode that is available in Main Mapping.
It works 90% like I wished. What does not work as expected:

  • when I set Jump Max to 1%, and I turn the knob quickly, then turning the knob all the way does not cover the whole range (if I start with knob and VST value at 0), presumably because some bigger deltas are reduced to 1%. If I turn it slowly, or increase jump max to a higher value, it works
  • on the other hand, when I set Jump Max to 100%, and switch the VST to a different preset, there can be a sudden jump to the value that was dialled in for the previous preset. (This also happens when I move the value in the VST GUI, but I do not mind that so much.)

Could we get rid of Jump min/max for this new mode, and always get the behavior that I expect:

  • when I turn the knob a little, the VST value moves a little - no matter where it was before
  • when I cover the whole range with the knob, the VST value always moves to the corresponding extreme value - no matter with what speed I move the knob

By the way, my use case is with "medium-range" NRPNs, e.g. 0-255.

@helgoboss
Copy link
Owner

@vonglan In general, I got it to work already.

There's one behavior I'm not yet sure about. Let's assume the user restricts the target range, setting target min to 20% and max to 70%. I've programmed it in a way that one complete fader/knob swipe (from 0% to 100%) moves the target from 20% to 70% ... I think exactly what one would expect. However, if at the time of touching the fader/knob the target is at 0%, it jumps to 20%.

Mmh, thinking about it again, that jump is correct. At least it's in line with how relative control works at the moment. The same jump would happen with an encoder or incremental buttons. So, this comment is just for the protocol :)

@vonglan
Copy link
Author

vonglan commented Apr 6, 2022

I agree :-)

@helgoboss
Copy link
Owner

Ah nice. With this new feature, the control value data structure gets a perfect symmetry:

/// Value coming from a source (e.g. a MIDI source) which is supposed to control something.
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum ControlValue {
    AbsoluteContinuous(UnitValue),
    AbsoluteDiscrete(Fraction),
    /// THIS IS NEW
    RelativeContinuous(UnitIncrement),
    RelativeDiscrete(DiscreteIncrement),
}

@vonglan
Copy link
Author

vonglan commented Apr 6, 2022

I like that too! Need to get back to my own programming / IT work now after the lunch break ...

@helgoboss
Copy link
Owner

I decided to not support step size or speed settings for this new mode (which is usually available for relative control). It would kind of defeat the main goal of this new mode to be able to swipe through the whole range and be sure that the target also swipes through its whole range. As soon as user-defined step sizes come into play or atomic step counts of discrete targets are considered, this can't work anymore.

@vonglan
Copy link
Author

vonglan commented Apr 7, 2022

I agree regarding step size/speed.
THANK YOU!

@vonglan
Copy link
Author

vonglan commented Apr 14, 2022

Tried this out with 2.13.0-pre.3, works fine.

Discovered one glitch, hopefully this can be improved easily:
In my OB6 controller preset, I cloned "absolute" to "relative" mapping groups now, which can be switched via a physical button that controls a compartment parameter, which is used as modifier for the groups.

When I switch from relative to absolute (while controlling the same parameter), there are jumps, as expected.
However, when I switch back to relative, there are also jumps, unexpectedly.
I think, the "initial (neutral) absolute value" of a physical knob should be reset to "undefined", whenever a "make relative" mapping becomes active again (or when it becomes inactive).

Do you need more details?

helgoboss added a commit that referenced this issue Apr 15, 2022
by clearing previous absolute value when mapping gets deactivated
@helgoboss
Copy link
Owner

This should fix it (contained in upcoming pre.4)

@vonglan
Copy link
Author

vonglan commented May 15, 2022

Still seeing this in pre.4.

  • starting in "make relative" mode, turning the knob
  • changing to absolute, touching (slightly turning) the knob --> there is a jump, as expected
  • changing to make relative, touching the knob --> there is a jump, unexpected

Should I create an example project?
(not a big problem, and not urgent)

@helgoboss
Copy link
Owner

When you say "changing to absolute", do you mean change the dropdown to "Normal"? Or activating another normal mapping and deactivating the "Make relative" one?

Changing the dropdown is definitely not going to work. A setting change overwrites all "runtime state".

Activating/deactivating should work. If you have an example project, that would be awesome.

@vonglan
Copy link
Author

vonglan commented Jun 1, 2022 via email

@vonglan
Copy link
Author

vonglan commented Jun 1, 2022

Unfortunately, the error sometimes occurs, and sometimes not (about 50/50 chance)!

I tried two different setups in the example project (two MIDI items).
Some manual interaction in the VST GUI is required.


first recorded MIDI item

(physical knob is at 0)

load project

(ReaSynth tune is in middle position)

recorded: switch to relative mode (bar 2; Param 2 = 1)
recorded: turn knob --> no jumps, correct

recorded: switch to absolute mode (bar 5)
recorded: turn knob --> jump, correct

MANUALLY: change VST parameter "Tuning" (and/or in the other place, does not make a difference)

recorded: switch to relative mode (bar 12)

MANUALLY: change VST parameter "Tuning"

recorded: turn knob --> jumps SOMETIMES, NOT correct (at least not what I expected)


second recorded MIDI

(ReaSynth tune is in middle position, hardware knob as well)

recorded: switch to absolute mode
recorded: turn knob back and forth (bar 25)

MANUALLY: change VST parameter "Tuning" left by 25%

recorded: switch to relative mode (bar 30)

MANUALLY: change VST parameter "Tuning" left by another 25% (i.e. all the way to 0)

recorded: turn knob --> jumps SOMETIMES, NOT correct (at least not what I expected) (bar 32)
issue 468 - 2022 06 01.RPP.zip

@vonglan
Copy link
Author

vonglan commented Jun 1, 2022

I just managed to capture log messages of a jump. I was in relative mode, turned the (physical) knob VERY slowly, but the VST slider jumped from about 80% to about 20%.
You can see in the log, there is a virtual control input of -0.6.

1654114759.562 | ReaLearn 3iQdYHhu | Real control input | [B0, 63, 00] = [176, 99, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(99), control_value: U7(0) } at Instant { t: 286717665515 } (consumed)
1654114759.563 | ReaLearn 3iQdYHhu | Real control input | [B0, 62, 06] = [176, 98, 6] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(98), control_value: U7(6) } at Instant { t: 286717665515 } (consumed)
1654114759.564 | ReaLearn 3iQdYHhu | Real control input | [B0, 06, 00] = [176, 6, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(6), control_value: U7(0) } at Instant { t: 286717665515 } (consumed)
1654114759.565 | ReaLearn 3iQdYHhu | Real control input | [B0, 26, 02] = [176, 38, 2] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(38), control_value: U7(2) } at Instant { t: 286717665515 } (consumed)
1654114759.566 | ReaLearn 3iQdYHhu | Virtual control input | Multi SY/Osc2PitchFine with value -0.6299212598425197 at Instant { t: 286717665515 } (matched)
1654114759.567 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"number":6,"value":2,"is_registered":false,"is_14_bit":true,"data_type":"DataEntry"} at Instant { t: 286717665515 } (matched)
1654114759.568 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"msb_controller_number":6,"value":2} at Instant { t: 286717665515 } (unmatched)
1654114759.569 | ReaLearn 3iQdYHhu | Real control input | [B0, 63, 00] = [176, 99, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(99), control_value: U7(0) } at Instant { t: 286718369516 } (consumed)
1654114759.570 | ReaLearn 3iQdYHhu | Real control input | [B0, 62, 06] = [176, 98, 6] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(98), control_value: U7(6) } at Instant { t: 286718369516 } (consumed)
1654114759.571 | ReaLearn 3iQdYHhu | Real control input | [B0, 06, 00] = [176, 6, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(6), control_value: U7(0) } at Instant { t: 286718369516 } (consumed)
1654114759.572 | ReaLearn 3iQdYHhu | Real control input | [B0, 26, 03] = [176, 38, 3] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(38), control_value: U7(3) } at Instant { t: 286718369516 } (consumed)
1654114759.573 | ReaLearn 3iQdYHhu | Virtual control input | Multi SY/Osc2PitchFine with value +0.003937007874015748 at Instant { t: 286718369516 } (matched)
1654114759.573 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"number":6,"value":3,"is_registered":false,"is_14_bit":true,"data_type":"DataEntry"} at Instant { t: 286718369516 } (matched)
1654114759.574 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"msb_controller_number":6,"value":3} at Instant { t: 286718369516 } (unmatched)
1654114759.622 | ReaLearn 3iQdYHhu | Real control input | [B0, 63, 00] = [176, 99, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(99), control_value: U7(0) } at Instant { t: 286719521518 } (consumed)
1654114759.624 | ReaLearn 3iQdYHhu | Real control input | [B0, 62, 06] = [176, 98, 6] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(98), control_value: U7(6) } at Instant { t: 286719521518 } (consumed)
1654114759.626 | ReaLearn 3iQdYHhu | Real control input | [B0, 06, 00] = [176, 6, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(6), control_value: U7(0) } at Instant { t: 286719521518 } (consumed)
1654114759.628 | ReaLearn 3iQdYHhu | Real control input | [B0, 26, 04] = [176, 38, 4] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(38), control_value: U7(4) } at Instant { t: 286719521518 } (consumed)
1654114759.629 | ReaLearn 3iQdYHhu | Virtual control input | Multi SY/Osc2PitchFine with value +0.003937007874015748 at Instant { t: 286719521518 } (matched)
1654114759.630 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"number":6,"value":4,"is_registered":false,"is_14_bit":true,"data_type":"DataEntry"} at Instant { t: 286719521518 } (matched)
1654114759.631 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"msb_controller_number":6,"value":4} at Instant { t: 286719521518 } (unmatched)
1654114759.802 | ReaLearn 3iQdYHhu | Real control input | [B0, 63, 00] = [176, 99, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(99), control_value: U7(0) } at Instant { t: 286723682907 } (consumed)
1654114759.806 | ReaLearn 3iQdYHhu | Real control input | [B0, 62, 06] = [176, 98, 6] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(98), control_value: U7(6) } at Instant { t: 286723682907 } (consumed)
1654114759.809 | ReaLearn 3iQdYHhu | Real control input | [B0, 06, 00] = [176, 6, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(6), control_value: U7(0) } at Instant { t: 286723682907 } (consumed)
1654114759.812 | ReaLearn 3iQdYHhu | Real control input | [B0, 26, 05] = [176, 38, 5] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(38), control_value: U7(5) } at Instant { t: 286723682907 } (consumed)
1654114759.813 | ReaLearn 3iQdYHhu | Virtual control input | Multi SY/Osc2PitchFine with value +0.003937007874015748 at Instant { t: 286723682907 } (matched)
1654114759.815 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"number":6,"value":5,"is_registered":false,"is_14_bit":true,"data_type":"DataEntry"} at Instant { t: 286723682907 } (matched)
1654114759.816 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"msb_controller_number":6,"value":5} at Instant { t: 286723682907 } (unmatched)

@vonglan
Copy link
Author

vonglan commented Jun 1, 2022

Another log output, this time WITH the preceding events.
The jump occurs at 1654114991.746

1654114976.517 | ReaLearn 3iQdYHhu | Virtual control input | Multi SY/Osc2PitchFine with value 0.8700787401574803 at Instant { t: 291922730508 } (matched)
1654114976.519 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"number":6,"value":221,"is_registered":false,"is_14_bit":true,"data_type":"DataEntry"} at Instant { t: 291922730508 } (matched)
1654114976.522 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"msb_controller_number":6,"value":221} at Instant { t: 291922730508 } (unmatched)
1654114976.547 | ReaLearn 3iQdYHhu | Real control input | [B0, 63, 00] = [176, 99, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(99), control_value: U7(0) } at Instant { t: 291925738651 } (consumed)
1654114976.551 | ReaLearn 3iQdYHhu | Real control input | [B0, 62, 06] = [176, 98, 6] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(98), control_value: U7(6) } at Instant { t: 291925738651 } (consumed)
1654114976.554 | ReaLearn 3iQdYHhu | Real control input | [B0, 06, 01] = [176, 6, 1] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(6), control_value: U7(1) } at Instant { t: 291925738651 } (consumed)
1654114976.557 | ReaLearn 3iQdYHhu | Real control input | [B0, 26, 5C] = [176, 38, 92] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(38), control_value: U7(92) } at Instant { t: 291925738651 } (consumed)
1654114976.560 | ReaLearn 3iQdYHhu | Virtual control input | Multi SY/Osc2PitchFine with value 0.8661417322834646 at Instant { t: 291925738651 } (matched)
1654114976.563 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"number":6,"value":220,"is_registered":false,"is_14_bit":true,"data_type":"DataEntry"} at Instant { t: 291925738651 } (matched)
1654114976.566 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"msb_controller_number":6,"value":220} at Instant { t: 291925738651 } (unmatched)
1654114976.569 | ReaLearn 3iQdYHhu | Real control input | [B0, 63, 00] = [176, 99, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(99), control_value: U7(0) } at Instant { t: 291926314583 } (consumed)
1654114976.571 | ReaLearn 3iQdYHhu | Real control input | [B0, 62, 06] = [176, 98, 6] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(98), control_value: U7(6) } at Instant { t: 291926314583 } (consumed)
1654114976.574 | ReaLearn 3iQdYHhu | Real control input | [B0, 06, 01] = [176, 6, 1] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(6), control_value: U7(1) } at Instant { t: 291926314583 } (consumed)
1654114976.577 | ReaLearn 3iQdYHhu | Real control input | [B0, 26, 5B] = [176, 38, 91] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(38), control_value: U7(91) } at Instant { t: 291926314583 } (consumed)
1654114976.579 | ReaLearn 3iQdYHhu | Virtual control input | Multi SY/Osc2PitchFine with value 0.8622047244094488 at Instant { t: 291926314583 } (matched)
1654114976.582 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"number":6,"value":219,"is_registered":false,"is_14_bit":true,"data_type":"DataEntry"} at Instant { t: 291926314583 } (matched)
1654114976.584 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"msb_controller_number":6,"value":219} at Instant { t: 291926314583 } (unmatched)
1654114983.387 | ReaLearn 3iQdYHhu | Real control input | [B0, 63, 00] = [176, 99, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(99), control_value: U7(0) } at Instant { t: 292090031045 } (consumed)
1654114983.397 | ReaLearn 3iQdYHhu | Real control input | [B0, 62, 61] = [176, 98, 97] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(98), control_value: U7(97) } at Instant { t: 292090031045 } (consumed)
1654114983.401 | ReaLearn 3iQdYHhu | Real control input | [B0, 06, 00] = [176, 6, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(6), control_value: U7(0) } at Instant { t: 292090031045 } (consumed)
1654114983.405 | ReaLearn 3iQdYHhu | Real control input | [B0, 26, 01] = [176, 38, 1] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(38), control_value: U7(1) } at Instant { t: 292090031045 } (consumed)
1654114983.408 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"number":97,"value":1,"is_registered":false,"is_14_bit":true,"data_type":"DataEntry"} at Instant { t: 292090031045 } (matched)
1654114983.411 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"msb_controller_number":6,"value":1} at Instant { t: 292090031045 } (unmatched)
1654114991.727 | ReaLearn 3iQdYHhu | Real control input | [B0, 63, 00] = [176, 99, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(99), control_value: U7(0) } at Instant { t: 292290227950 } (consumed)
1654114991.736 | ReaLearn 3iQdYHhu | Real control input | [B0, 62, 06] = [176, 98, 6] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(98), control_value: U7(6) } at Instant { t: 292290227950 } (consumed)
1654114991.739 | ReaLearn 3iQdYHhu | Real control input | [B0, 06, 01] = [176, 6, 1] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(6), control_value: U7(1) } at Instant { t: 292290227950 } (consumed)
1654114991.743 | ReaLearn 3iQdYHhu | Real control input | [B0, 26, 58] = [176, 38, 88] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(38), control_value: U7(88) } at Instant { t: 292290227950 } (consumed)
1654114991.746 | ReaLearn 3iQdYHhu | Virtual control input | Multi SY/Osc2PitchFine with value +0.8307086614173229 at Instant { t: 292290227950 } (matched)
1654114991.750 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"number":6,"value":216,"is_registered":false,"is_14_bit":true,"data_type":"DataEntry"} at Instant { t: 292290227950 } (matched)
1654114991.753 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"msb_controller_number":6,"value":216} at Instant { t: 292290227950 } (unmatched)
1654114991.757 | ReaLearn 3iQdYHhu | Real control input | [B0, 63, 00] = [176, 99, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(99), control_value: U7(0) } at Instant { t: 292290676454 } (consumed)
1654114991.761 | ReaLearn 3iQdYHhu | Real control input | [B0, 62, 06] = [176, 98, 6] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(98), control_value: U7(6) } at Instant { t: 292290676454 } (consumed)
1654114991.764 | ReaLearn 3iQdYHhu | Real control input | [B0, 06, 01] = [176, 6, 1] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(6), control_value: U7(1) } at Instant { t: 292290676454 } (consumed)
1654114991.768 | ReaLearn 3iQdYHhu | Real control input | [B0, 26, 57] = [176, 38, 87] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(38), control_value: U7(87) } at Instant { t: 292290676454 } (consumed)
1654114991.771 | ReaLearn 3iQdYHhu | Virtual control input | Multi SY/Osc2PitchFine with value -0.003937007874015741 at Instant { t: 292290676454 } (matched)
1654114991.774 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"number":6,"value":215,"is_registered":false,"is_14_bit":true,"data_type":"DataEntry"} at Instant { t: 292290676454 } (matched)
1654114991.777 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"msb_controller_number":6,"value":215} at Instant { t: 292290676454 } (unmatched)
1654114991.817 | ReaLearn 3iQdYHhu | Real control input | [B0, 63, 00] = [176, 99, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(99), control_value: U7(0) } at Instant { t: 292292084071 } (consumed)
1654114991.821 | ReaLearn 3iQdYHhu | Real control input | [B0, 62, 06] = [176, 98, 6] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(98), control_value: U7(6) } at Instant { t: 292292084071 } (consumed)
1654114991.824 | ReaLearn 3iQdYHhu | Real control input | [B0, 06, 01] = [176, 6, 1] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(6), control_value: U7(1) } at Instant { t: 292292084071 } (consumed)
1654114991.828 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"number":6,"value":1,"is_registered":false,"is_14_bit":false,"data_type":"DataEntry"} at Instant { t: 292292147859 } (unmatched)
1654114991.831 | ReaLearn 3iQdYHhu | Real control input | [B0, 26, 56] = [176, 38, 86] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(38), control_value: U7(86) } at Instant { t: 292292148029 } (consumed)
1654114991.835 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"msb_controller_number":6,"value":214} at Instant { t: 292292148029 } (unmatched)
1654114991.847 | ReaLearn 3iQdYHhu | Real control input | [B0, 63, 00] = [176, 99, 0] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(99), control_value: U7(0) } at Instant { t: 292292979989 } (consumed)
1654114991.850 | ReaLearn 3iQdYHhu | Real control input | [B0, 62, 06] = [176, 98, 6] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(98), control_value: U7(6) } at Instant { t: 292292979989 } (consumed)
1654114991.853 | ReaLearn 3iQdYHhu | Real control input | [B0, 06, 01] = [176, 6, 1] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(6), control_value: U7(1) } at Instant { t: 292292979989 } (consumed)
1654114991.856 | ReaLearn 3iQdYHhu | Real control input | [B0, 26, 55] = [176, 38, 85] = ControlChange { channel: Channel(0), controller_number: ControllerNumber(38), control_value: U7(85) } at Instant { t: 292292979989 } (consumed)
1654114991.860 | ReaLearn 3iQdYHhu | Virtual control input | Multi SY/Osc2PitchFine with value -0.007874015748031593 at Instant { t: 292292979989 } (matched)
1654114991.863 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"number":6,"value":213,"is_registered":false,"is_14_bit":true,"data_type":"DataEntry"} at Instant { t: 292292979989 } (matched)
1654114991.866 | ReaLearn 3iQdYHhu | Real control input | {"channel":0,"msb_controller_number":6,"value":213} at Instant { t: 292292979989 } (unmatched)

@helgoboss helgoboss reopened this Jun 8, 2022
@helgoboss
Copy link
Owner

When you say "changing to absolute", do you mean change the dropdown to "Normal"? Or activating another normal mapping and deactivating the "Make relative" one?

Still need an answer to that question.

I just discovered that the previous value was not reset when disabling the mapping via checkbox on the left and "ReaLearn: Enabled/disable mappings" target. Did you use that one?

@vonglan
Copy link
Author

vonglan commented Jun 9, 2022

No, I didn't do anything in the GUI. Just activating/deactivating indirectly via mapping groups.
I did not use the Enable/Disable mappings" target yet.

@helgoboss
Copy link
Owner

Sorry, should have looked into your test project a bit sooner. It was great for reproducing the error, thanks. After fiddling with it for a while and reducing it to the relevant mappings, I found the issue. You stumbled upon this bug - as always ;) - because you seem to use the possibilities of mappings with virtual targets more than anyone else.

When using MIDI, the MIDI events arrive in the real-time thread and the mappings with virtual targets are processed completely (including the "Make relative" stuff") within that real-time thread in order to avoid unnecessary communication between threads. But the "reset make-relative reference value on mapping deactivation" logic so far is only triggered in the main thread processing logic. I added the same logic to the real-time processing and the issue disappears.

helgoboss added a commit that referenced this issue Jun 13, 2022
…cases

if target is virtual and input is MIDI
@helgoboss
Copy link
Owner

This will be in pre.7 (which will still take a while to publish).

@vonglan
Copy link
Author

vonglan commented Jun 13, 2022

After fiddling with it for a while and reducing it to the relevant mappings, I found the issue.

That's great! I was already a bit pessimistic, because it was not reliably reproducible ("Wackelkontakt").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority
Projects
None yet
Development

No branches or pull requests

2 participants