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

Feedback for Out-Of-Range=Min (bank select buttons) not working anymore in 2.10.0 pre-2 #396

Closed
vonglan opened this issue Jul 5, 2021 · 18 comments
Labels
bug Something isn't working high priority realearn Related to ReaLearn

Comments

@vonglan
Copy link

vonglan commented Jul 5, 2021

If I revert to 2.9.1., it is working again.
Do you need more info/details?

@helgoboss
Copy link
Owner

If you could offer a test project with recorded MIDI that is routed to ReaLearn, it would be immensely helpful. Very low on time at the moment, so any preliminary work on bug author side much appreciated. Thanks!

@helgoboss helgoboss added need more info Further information is requested bug Something isn't working labels Jul 15, 2021
@helgoboss
Copy link
Owner

Tried a bit. Can't reproduce. Definitely going to need some test project.

@helgoboss helgoboss removed the bug Something isn't working label Jul 16, 2021
@vonglan
Copy link
Author

vonglan commented Jul 17, 2021

Hi Benjamin, I will try to create a test project, also for the other issue. Not sure when I have time.

@vonglan
Copy link
Author

vonglan commented Jul 17, 2021

Test project attached. Tested with 2.10.0. pre-3.
When playing back the recorded MIDI, it works as expected! But not in "live" use.
I tried "send feedback after control", but that did not make a difference.
issue396 feedback out-of-range.RPP.zip

And with 2.9.1., it works correctly.

@vonglan
Copy link
Author

vonglan commented Aug 1, 2021

I guess I could have a look at this with the new "log MIDI messages" option?

@vonglan
Copy link
Author

vonglan commented Aug 3, 2021

I checked again. With 2.9.1., it still works fine (both with just the main mapping, as in the example project, or with my SY mapping combination controller+main).

With 2.10.pre-6, It did not work in the example project (which has just a main mapping) at first.
When I changed the tuning mode in the example project to "Toggle Buttons" instead of "Normal Mode", this fixed the problem!
I suspect because in this case, the 127-feedback is sent twice to the device (as I could see from the log)!

In my SY mappings (separated between Controller and Main Mappings), I use "Normal Mode" in Tuning, and the feedback is unreliable in 2.10-pre6. When I look at the Output Log, ReaLearn sends the correct messages, but X-Touch Mini does not light the LED.
It does not help if I change to "Toggle" Mode in Tuning. (And I see in the log that the 127-feedback is only sent once, in either case.)

Any idea, why this problem did not occur in 2.9.1., and any workaround that I could use to make the SY mapping work correctly with feedback again in 2.10.pre?

@helgoboss
Copy link
Owner

Does "Send feedback after control" help? I remember this was necessary e.g. with Behringer X-Touch Compact when using "Toggle buttons" because this device overwrites the last feedback it gets when releasing the button (stupid behavior).

In any case, let's better not get down the road to find out why it worked in 2.9.1 and not anymore in 2.10 prereleases ... knowing that 2.10 sends the correct messages. It was probably a "fortunate bug" in 2.9.1 that made it work. Would be better to find out why exactly the X-Touch Mini needs 2 messages. But I strongly suspect above mentioned "feedback overwriting" to be the reason.

@vonglan
Copy link
Author

vonglan commented Aug 6, 2021

"Send Feedback after control" did not make a difference

With my "SY mappings" I noticed, that feedback never worked, when I pressed the X-Touch button longer (like 1 second between note-on and note-off). It did work sometimes when I pressed very quickly.
I had the impression that turning "send feedback after control" helped so it worked more often (when pressed quickly).

By the way, the feedback always works for the buttons that are not mapped with the "bank switching" method (Target min=max, and out-of-range behavior = min), but just have an ordinary VST parameter as target.

I thought "send feedback after control" would send the whole feedback round for the virtual target again, once the note-off is received. (I think this would solve the X-Touch's problem.) But this is not the case.

I made a very simple example project, attached.

Strangely, when I record two button switches, the feedback does not work.
When I play it back, it works.
The log output is the same both times!

During Recording:
Feedback not working
1628279718.632 | ReaLearn _buCMwLe | Control input    | [9A, 08, 7F] = [154, 8, 127] = NoteOn { channel: Channel(10), key_number: KeyNumber(8), velocity: U7(127) } (matched)
1628279718.662 | ReaLearn _buCMwLe | Feedback output  | [9A, 08, 7F] = [154, 8, 127] = NoteOn { channel: Channel(10), key_number: KeyNumber(8), velocity: U7(127) }
1628279718.663 | ReaLearn _buCMwLe | Feedback output  | [9A, 09, 00] = [154, 9, 0] = NoteOn { channel: Channel(10), key_number: KeyNumber(9), velocity: U7(0) }
1628279718.752 | ReaLearn _buCMwLe | Control input    | [8A, 08, 00] = [138, 8, 0] = NoteOff { channel: Channel(10), key_number: KeyNumber(8), velocity: U7(0) } (matched)
1628279719.562 | ReaLearn _buCMwLe | Control input    | [9A, 09, 7F] = [154, 9, 127] = NoteOn { channel: Channel(10), key_number: KeyNumber(9), velocity: U7(127) } (matched)
1628279719.592 | ReaLearn _buCMwLe | Feedback output  | [9A, 08, 00] = [154, 8, 0] = NoteOn { channel: Channel(10), key_number: KeyNumber(8), velocity: U7(0) }
1628279719.594 | ReaLearn _buCMwLe | Feedback output  | [9A, 09, 7F] = [154, 9, 127] = NoteOn { channel: Channel(10), key_number: KeyNumber(9), velocity: U7(127) }
1628279719.712 | ReaLearn _buCMwLe | Control input    | [8A, 09, 00] = [138, 9, 0] = NoteOff { channel: Channel(10), key_number: KeyNumber(9), velocity: U7(0) } (matched)

Playback
Feedback working
1628279779.891 | ReaLearn _buCMwLe | Control input    | [9A, 08, 7F] = [154, 8, 127] = NoteOn { channel: Channel(10), key_number: KeyNumber(8), velocity: U7(127) } (matched)
1628279779.921 | ReaLearn _buCMwLe | Feedback output  | [9A, 08, 7F] = [154, 8, 127] = NoteOn { channel: Channel(10), key_number: KeyNumber(8), velocity: U7(127) }
1628279779.922 | ReaLearn _buCMwLe | Feedback output  | [9A, 09, 00] = [154, 9, 0] = NoteOn { channel: Channel(10), key_number: KeyNumber(9), velocity: U7(0) }
1628279780.011 | ReaLearn _buCMwLe | Control input    | [8A, 08, 00] = [138, 8, 0] = NoteOff { channel: Channel(10), key_number: KeyNumber(8), velocity: U7(0) } (matched)
1628279780.821 | ReaLearn _buCMwLe | Control input    | [9A, 09, 7F] = [154, 9, 127] = NoteOn { channel: Channel(10), key_number: KeyNumber(9), velocity: U7(127) } (matched)
1628279780.853 | ReaLearn _buCMwLe | Feedback output  | [9A, 08, 00] = [154, 8, 0] = NoteOn { channel: Channel(10), key_number: KeyNumber(8), velocity: U7(0) }
1628279780.855 | ReaLearn _buCMwLe | Feedback output  | [9A, 09, 7F] = [154, 9, 127] = NoteOn { channel: Channel(10), key_number: KeyNumber(9), velocity: U7(127) }
1628279780.941 | ReaLearn _buCMwLe | Control input    | [8A, 09, 00] = [138, 9, 0] = NoteOff { channel: Channel(10), key_number: KeyNumber(9), velocity: U7(0) } (matched)

issue396 v3 feedback problem.RPP.zip

@vonglan
Copy link
Author

vonglan commented Aug 7, 2021

I guess it would help if ReaLearn would send the feedback for "light on" again, after it receives the note-off.
For a while, I thought I could achieve this by changing to character "toggle-only button". But of course, this is not available for type "note velocity", only for CC/NRPN.

@helgoboss
Copy link
Owner

Mmh, I would expect ReaLearn to send feedback again after it receives a "note off" for a "Note velocity" source if "Send feedback after control" is checked. That's the whole point of that option. I will look into it, maybe something doesn't work correctly.

@helgoboss
Copy link
Owner

Checked it in v2.10.0-pre.6. "Send feedback after control" works as expected, so it sends feedback even when receiving a "note off" that would otherwise not affect the target value (e.g. in "Toggle buttons" mode).

One minor detail: For incoming messages, ReaLearn treats "NOTE OFF" and "NOTE ON with value zero" the same way. As outgoing message for 0% feedback, it always sends "NOTE ON with value zero", never "NOTE OFF". Not sure if this could be a reason why it doesn't work in your case? But don't think so because in general it seems to work, no?

@vonglan
Copy link
Author

vonglan commented Aug 11, 2021

I checked it with the example project again (v3 above). I am afraid it does not work there, there is no feedback sent after the note-off (no matter whether "controller" manually or with the recording in the project). See the log output below.

1628712619.219 | ReaLearn paW4LZtt | Control input    | [9A, 08, 7F] = [154, 8, 127] = NoteOn { channel: Channel(10), key_number: KeyNumber(8), velocity: U7(127) } (matched)
1628712619.254 | ReaLearn paW4LZtt | Feedback output  | [9A, 08, 7F] = [154, 8, 127] = NoteOn { channel: Channel(10), key_number: KeyNumber(8), velocity: U7(127) }
1628712619.254 | ReaLearn paW4LZtt | Feedback output  | [9A, 09, 00] = [154, 9, 0] = NoteOn { channel: Channel(10), key_number: KeyNumber(9), velocity: U7(0) }
1628712619.427 | ReaLearn paW4LZtt | Control input    | [8A, 08, 00] = [138, 8, 0] = NoteOff { channel: Channel(10), key_number: KeyNumber(8), velocity: U7(0) } (matched)
1628712647.837 | ReaLearn paW4LZtt | Control input    | [9A, 09, 7F] = [154, 9, 127] = NoteOn { channel: Channel(10), key_number: KeyNumber(9), velocity: U7(127) } (matched)
1628712647.867 | ReaLearn paW4LZtt | Feedback output  | [9A, 08, 00] = [154, 8, 0] = NoteOn { channel: Channel(10), key_number: KeyNumber(8), velocity: U7(0) }
1628712647.870 | ReaLearn paW4LZtt | Feedback output  | [9A, 09, 7F] = [154, 9, 127] = NoteOn { channel: Channel(10), key_number: KeyNumber(9), velocity: U7(127) }
1628712648.017 | ReaLearn paW4LZtt | Control input    | [8A, 09, 00] = [138, 9, 0] = NoteOff { channel: Channel(10), key_number: KeyNumber(9), velocity: U7(0) } (matched)

@vonglan
Copy link
Author

vonglan commented Aug 12, 2021

I was wondering above

Strangely, when I record two button switches, the feedback does not work.
When I play it back, it works.
The log output is the same both times!

This is clear to me now. When the recording is played back, the controller is not controlling its own lights, so in this case the additional feedback after control is not required.

@helgoboss
Copy link
Owner

Checked it. "Send feedback after control" works as expected for "Toggle buttons" mode. You use "Normal" mode and it doesn't work expected. Interestingly, when using "Press only", it sends feedback on releases. I'll have a look what's going wrong there.

@helgoboss helgoboss added bug Something isn't working high priority and removed need more info Further information is requested labels Aug 12, 2021
@helgoboss
Copy link
Owner

In any case: "Send feedback after control" is the correct option for your problem. I know another Behringer controller that doesn't behave in this annoying way when switching it to Mackie Control mode instead of custom mode. Maybe worth a try.

helgoboss added a commit that referenced this issue Aug 17, 2021
- Option will now often send more feedback than necessary but at least not skip important
  feedback.
- Add a bunch of integration test cases.
@helgoboss
Copy link
Owner

Okay, so the actual reason why it didn't send the feedback in your case was the combination of a rounding error and FX parameter polling (which is by default enabled since 2.10.0-pre.1 to make sure that automatic feedback is sent even in exotic corner cases, see #350). ReaLearn tries to omit sending feedback after control if it knows the automatic feedback will be sent anyway a moment after. However, the polling mechanism prevents automatic feedback to be sent if there's no significant value change (to not overload the controller with feedback messages) - so the automatic feedback was not sent at all.

Instead of removing the polling or the overload prevention, I adjusted the "Send feedback after control" behavior to send feedback in any case, even at the cost of having a few more messages sent out than necessary. This can be improved in future.

I also found another case where this should help to get reliable feedback when "Send feedback after control" is enabled: Retriggerable targets.

In upcoming pre7 it should work again.

helgoboss added a commit that referenced this issue Aug 17, 2021
helgoboss added a commit that referenced this issue Aug 17, 2021
@vonglan
Copy link
Author

vonglan commented Aug 17, 2021

Wow, quite a combination leading to the bug.
Thanks a lot for investigating and fixing this!

@vonglan
Copy link
Author

vonglan commented Aug 22, 2021

is fixed

@helgoboss helgoboss added the realearn Related to ReaLearn label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority realearn Related to ReaLearn
Projects
None yet
Development

No branches or pull requests

2 participants