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

How can I use "When target value met" to express "When target value active/inactive"? #692

Closed
AtmanActive opened this issue Sep 28, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@AtmanActive
Copy link

How can I use "When target value met" to express "When target value active/inactive"?

I have two mappings with identical source (MIDI encoder) and two different targets: one adjusts an insert FX parameter, the other one conditionally-inserts-said-FX via a Reascript. The Reascript is clever enough to check if FX is already there and not to insert the FX again.
Now, when there is no said FX on the track, the mapping number one is grayed out (it is set to Selected track, FX by name), as it should be. Mapping number two is alive and it inserts the said FX when encoder is touched, as expected. From that moment on, both mappings are active and even though my Reascript is smart and it is not adding duplicate FXs, it is still being executed on every encoder click.

Hence, I would now like to be able to deactivate the second mapping as soon as the first mapping becomes active. In other words, I would like to execute my Reascript only when there is no said FX the selected track. That's the goal.

Reading the manual up and down again and again, I noticed the new conditional activation mode called "When target value met". So I tried entering all possible permutations of y > 0, or y === 0 or !y or whatever, but I can't make it work the desired way. Yes, it does react properly to lead mapping's target value, once lead mapping is active (once said FX is inserted on the track), but it doesn't seem to follow the same logic when lead mapping's target is inactive (when there is no said FX on the track).

Hence, my question: is there a way to conditionally enable a mapping when it's lead mapping's target is inactive?

The goal of this excercise is to achieve analog-mixer-style accessiblity for Reaper. On an analog mixer, the EQ is, for example, always present and all one needs to do is to start pushing gain knob and the sound is immediately changed. In today's digital approach, one needs to click something or execute something to first insert an EQ on a track before one can use it. Yes, one could prepare the tracks with EQ inserts but that's just cumbersome and waste of CPU resources. Better approach is to have most of the tracks in plain vanilla state (no EQ insert FX) and just add said FX when needed, but also, not to waste one more click or brain cycle to remember to actually add that FX on the track, but to have it done automatically.

Thanks!

(ReaLearn v2.13.1 rev bf74f7 from 2022-07-09 14:46:06 UTC)

@helgoboss
Copy link
Owner

Cool seeing someone make use of "When target value met". When I designed this mode of conditional activation, I didn't think about inactive/active targets. I'll see how I can add that somehow.

@helgoboss helgoboss added the enhancement New feature or request label Sep 29, 2022
@helgoboss
Copy link
Owner

Further inspection: At the moment, ReaLearn doesn't listen to activation or deactivation of the referred mapping/target and as a consequence, the condition (e.g. y > 0) doesn't get re-evaluated. Also, we will need a way to distinguish between mapping/target "not active" and "active" in the condition. I think I will make it work this way: y == none means the referred mapping/target is inactive. Otherwise, it's active.

@AtmanActive
Copy link
Author

Looking forward.
Thanks!

@helgoboss
Copy link
Owner

Note to self: Check if it's even relevant whether the referenced mapping is active or not. Could be that this shouldn't play a role. In that case, just look at target active or not.

@helgoboss
Copy link
Owner

Right, I designed it in a way that it doesn't matter if the referenced mapping is active or not. Rationale: The mapping just "borrows" the target of the referenced mapping, it's not about the referenced mapping itself. So I just need to make sure that y == none if the target is inactive and re-evaluate the condition whenever the target turns active or inactive.

@AtmanActive
Copy link
Author

This will be a huge step IMHO.
This will enable ReaLearn's secondary mapping(s) to react on Reaper's state on the primary mapping.
Absolutely brilliant.
The full circle.

helgoboss added a commit that referenced this issue Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants