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

Suggestion : ease target over time #635

Closed
gthibert opened this issue Jul 28, 2022 · 4 comments
Closed

Suggestion : ease target over time #635

gthibert opened this issue Jul 28, 2022 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@gthibert
Copy link

Hi,

First ReaLearn is incredible, and realy powerful! A huge thanks for your work!

Here's my suggestion : it would be awesome if ReaLearn could "ease" a target value over a period of time.

One simple usage of this would be that, on the press on a button, a fade-in or fade-out could be automated. The target value (track volume from x dB to y dB) could be reached in x milliseconds.

I managed to do something similar by activating a mapping that uses the "Reaper: timer" source (at 100 ms) with "Incremental button" mode. One of the downside of this is that there's no easy way to deactivate the mapping once the target value as been reached, and the timer will keep send the max value.

In BrainModular Usine, this is called a Data smoother (transforms abrupt value transition into more progressive transition).

licecap

@helgoboss
Copy link
Owner

Hi! It's a little bit hidden but this is already possible to some degree: #593 (comment)

@gthibert
Copy link
Author

gthibert commented Aug 2, 2022

Ok thanks!

I'm trying to simply delay a trigger, and I did this :

y = rel_time > 2000 ? x: none;

But is there a way to return "stop", after returning "x"? I did this, but does'nt seem optimal :

y = rel_time > 2000 ? (rel_time>2100 ? stop : 0.5): none;

Also, it seems like x is always 1, no matter what the max target is setted to, But with this simple code, x returns the correct max target value :

y = x

@helgoboss
Copy link
Owner

x always corresponds to the incoming control value (e.g. fader position or whether button is pressed/released).

Mmh, I see the problem and what you would like to do. Unfortunately, the code in the transformation formula doesn't have any concept of a "sequence" ... like do "stop" after returning "x". It simply gets executed repeatedly and has access to the variables, no higher magic there. As you already found out ("doesn't seem optimal"): If you want to fire just once and then stop, it's unreliable to use the rel_time variable, see also my statement here: #593 (comment).

I think even with the rel_count variable mentioned in the statement, your case wouldn't quite work. You would have something like y = rel_count < 60 ? none : (rel_count == 60 ? 0.5 : stop). It would fire once and then stop, guaranteed. But you would rely on the fact that the invocation happens approximately each 30ms - and that's not good because it could change anytime, also depending on the machine. So it could be that the delay duration varies quite much, depending on machine and REAPER settings and ReaLearn version.

In your particular case, the following formula might do the trick: y = rel_time > 2000 ? (y != 0.5 ? 0.5 : stop) ... so you just check if the target already has the desired value and then stop.

For other more complicated cases, it might be cool to be able to do this: y = rel_time < 2000 ? none : 0.5 + stop. Maybe I could make it work that way.

@helgoboss helgoboss added enhancement New feature or request question Further information is requested labels Aug 28, 2022
helgoboss added a commit that referenced this issue Sep 12, 2022
@helgoboss
Copy link
Owner

This is now possible! y = rel_time < 2000 ? none : stop(0.5)

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

No branches or pull requests

2 participants