Skip to content

Toggle feedback transformation not working #36

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

Closed
cjunekim opened this issue Sep 24, 2020 · 7 comments
Closed

Toggle feedback transformation not working #36

cjunekim opened this issue Sep 24, 2020 · 7 comments
Labels
bug Something isn't working realearn Related to ReaLearn
Milestone

Comments

@cjunekim
Copy link

cjunekim commented Sep 24, 2020

I am using realearn to change the preset of an FX with a midi button. What I want is I press the button and the FX goes to preset #20 and then press it again it goes to preset #0(factory reset).

It works with my midi button working as momentary. However, the feedback doesn't work properly. I guessed it was because the feedback was sent as value 20, not 127, which is expected from the midi controller.

So I decided to use the feedback transformation: x = (y>1) ?1 : 0

But the feedback doesn't work. Changing the value with the Value slider of Target on the Mapping window works properly with feedback though.

@cjunekim
Copy link
Author

cjunekim commented Sep 24, 2020

Update. I figured that this is not about feedback transformation. It's about Track FX preset.

When the target is a track mute button, the feedback works expectedly. But when the target is Track FX preset, it behaves strangely.

I have investigated inside via a virtual MIDI cable(BTW, it would be helpful if realearn provided this logging). When I press a midi button, the feedback comes out only when the preset become #20, not coming back to preset #0. However, with a track mute button as the target, the feedback comes out in both times. All the Mode Type is toggle.

@cjunekim
Copy link
Author

cjunekim commented Sep 24, 2020

Update2. I learned more about this issue.

There is also some issue with feedback transformation as well.

Pick a midi button(momentary) and make it as a source, and add reacomp and set its Lowpass to the target. The Mode could be Absolute for example. As you are holding down the button, the Lowpass will go to its maximum at 20000hz, and will go back to 0hz when the button is released. It works okay.

When Target's Min is at 0% and Max is at any number between 0% to 50%, and the feedback transformation string is set to y=1-x, the feedback value becomes very strange.

The feedback output is always 127, which I checked via a virtual MIDI cable. Always, whether you press or release the button. You could change the Target Max to 49%, 30%, 20% or anything and the feedback output stays the same at 127. However, when you set the transformation string to y=x, it works as expected.

@helgoboss
Copy link
Owner

I'll try this source/target combination. However, there's something wrong with your feedback transformation formulas:

x = (y>1) ?1 : 0

Neither x nor y should ever be greater than 1. It's supposed to be always between 0 and 1. So with your formula you will always end up with 0. Which means "Source Min" will be sent to your controller, no matter what's the actual target value.

y=1-x

This doesn't do anything. In feedback transformation formulas you need to assign a value to x, not y (because x represents the resulting normalized feedback value and y the current normalized target value). Best have a look in the user guide, it's explained there.

Concerning logging MIDI feedback, you don't have to deal with virtual MIDI cables. Just choose "FX output" as MIDI output and slap a Cockos ReaControlMIDI below it (which lets you show the log).

@cjunekim
Copy link
Author

cjunekim commented Sep 24, 2020

Yeah. At first, I misunderstood the range of x and y. But my second and third comments are written after that correction of understanding.

y=1-x was my typo when writing the comment. It actually was x=1-y.

When the target max was set at 50% or lower, the feedback behaves strangely(always 127). Try it with a midi controller fader mapped to a slider.

All I found was, to correct the misbehavior, I had to modify my formula. In order to acheive the feedback reversed(127 to 0), I had to do,

x=1-y-1+TM

instead of simply using x=1-y.

Here, TM stands for Target Max in the form of 0..1.

Here is a screencast:

Image of bug

@cjunekim
Copy link
Author

Any updates on this issue?

@helgoboss
Copy link
Owner

Looking into it right now. Understood the issue.

@helgoboss helgoboss added this to the 1.12.0 milestone Dec 20, 2020
@helgoboss helgoboss added the bug Something isn't working label Dec 20, 2020
helgoboss added a commit that referenced this issue Dec 20, 2020
- Old: reverse, target interval, transformation, source interval
- New: reverse, transformation, target interval, source interval

The new one is consistent with the control processing order (exactly the inverse).
The new one also makes more sense because it lets the transformation function
work on the complete unit interval.
@helgoboss
Copy link
Owner

This was indeed a bug. The processing order was inconsistent. The bug is fixed in upcoming v1.12.0-pre8.

The control processing order is:

  1. Apply source interval
  2. Apply transformation
  3. Apply target interval
  4. Apply reverse
  5. Apply rounding

The old feedback processing order was:

  1. Apply reverse
  2. Apply transformation
  3. Apply target interval
  4. Apply source interval

The new feedback processing order is:

  1. Apply reverse
  2. Apply target interval
  3. Apply transformation
  4. Apply source interval

Latter order is consistent with control processing order (exactly the reverse) and makes the transformation fomula work on the complete unit interval (0..1).

Please note that this will change the behavior of existing feedback transformation formulas if used in combination with source or target interval restrictions, so they might need some adjustment. Sorry for any inconvenience.

@cjunekim Good catch!

helgoboss added a commit that referenced this issue Dec 20, 2020
- Old: reverse, transformation, target interval, source interval
- New: reverse, target interval, transformation, source interval

The new one is consistent with the control processing order (exactly the inverse).
The new one also makes more sense because it lets the transformation function
work on the complete unit interval.
@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 realearn Related to ReaLearn
Projects
None yet
Development

No branches or pull requests

2 participants