/ helgobox Public

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.

# Add time variable to control transformation formulas#593

Closed
opened this issue Jun 8, 2022 · 14 comments
Closed

# Add time variable to control transformation formulas #593

opened this issue Jun 8, 2022 · 14 comments
Labels
enhancement New feature or request realearn Related to ReaLearn

### helgoboss commented Jun 8, 2022

 Could be used for time-controlled parameter modulation or transitions. Especially for the latter it would be good if the time starts from 0 on each invocation (e.g. button press). The text was updated successfully, but these errors were encountered:
added the enhancement New feature or request label Jun 8, 2022

### vonglan commented Jun 9, 2022

 reminds me of #355

### Arthur-McArthur commented Jun 9, 2022

 To respond to your forum post by adding to this FR and combining it with a few others: I think it would be powerful and intuitive if the value sequences could be expanded to cover curves and the time domain. In theory it could allow for comprehensive transformations without a need for a fancy GUI for the curves. I'm just spitballing syntax, but what if you used ( ) to define the section of the curve that the following values are in, and [ ] to define time variables until the next [ ]. So a value sequence of: (0-0.33), 1, 2, 3, (0.33-66), [0.3], 7-11, (0.66-1), [1], 6-4 Would go between values 1, 2, 3 within the first third of the curve as normal. The second third of the curve would go between 7 and 11, but take .3 seconds for the value to "catch up" to the position of the source. The final third of the curve would decrease the value from 6 to 4 with a full second of catch up time. Now I'm straying into deep water here, but what if you could synchronize the time parameter to the BPM? You could make a button that slowly raises a filter over 3.75 bars and then quickly drops it back down with: [BPM3.75], 2000, [BPM.25], 0 Or with some curves: [BPM3.75], (0-0.46875), 0-1500, (0.46875-0.9375), 1500-2000, [BPM.25], (0.9375-0.9675), 200, (0.9675-1), 0 For smoothing a track peak, maybe just a value sequence of [.2] would work, in that it takes .2 seconds to catch up to the current value from the last value. I have no idea if this is possible or if there are complications I'm not considering but if something like this would work I think it would cover all possible control transformations we could want.

### helgoboss commented Jun 9, 2022

 This sounds interesting but should go into a new FR. I'm actually working on this one already and it only covers providing a `rel_time` variable in transformation formulas. I think it's a quick win with a huge benefit already.

### Arthur-McArthur commented Jun 9, 2022

 Great! Excited to test it out. I'll make a new post for this idea then

### helgoboss commented Jun 9, 2022 • edited Loading

 A work-in-progress collection of practical formulas that I use for testing: Linear transition to control value: `y = abs(x - y) < 0.05 ? stop : x * min(rel_time / 500, 1)` (1 second transition time, works nicely with velocity-sensitive buttons) Temporary chaos: `y = rel_time < 2000 ? rand(1) : stop` (2 seconds) Smooth transition from current value to control value: `rel_time; y = abs(x - y) < 0.05 ? stop : y + 0.1 * (x - y)` Sinus LFO: `y = (sin(rel_time / 500) + 1) / 2`

### vonglan commented Jun 9, 2022

 ... and you could combine this with the "performance control" feature (y_last)

### helgoboss commented Jun 9, 2022 • edited Loading

 Note to self: Still need to add the following possibilities: Possibility to return a special `stop` value This stops repeated invocation of the formula until the mapping is triggered again. Good for building transitions with a defined end. Stopping the invocation at some point is also important if the same parameter shall be controlled by other mappings as well. If multiple mappings continuously change the target parameter, only the last one wins. Possibility to return a special `none` value Usually, each repeated invocation always results in a target invocation (unless the target is not retriggerable and already has the desired value). Sometimes this is not desired. In this case, one can return `none`, in which case the target will not be touched. Good for transitions that are not continuous, especially if other mappings want to control the parameter as well from time to time. Update: Added

### helgoboss commented Jun 9, 2022

 ... and you could combine this with the "performance control" feature (y_last) Any particular use case in mind?

### vonglan commented Jun 9, 2022

 Any particular use case in mind? Now that I think more about it, no. Just the general advantage of y_last over absolute values. Doesn't the "Smooth transition from current value to control value" example above require y_last?

### helgoboss commented Jun 9, 2022

 Doesn't the "Smooth transition from current value to control value" example above require y_last? No. The way it works is that it looks at the current target value `y` on each invocation and adds little increments/decrements until it gets close enough to the desired value `x`. A sort of relative-style smoothening.

### helgoboss commented Jun 9, 2022

 A `rel_count` variable which always counts the number of invocations since last mapping control would probably also make sense. Good for stepped transitions, e.g. change things at every 10-th invocation with `rel_count % 10`. This is difficult with `rel_time` because it contains the amount of milliseconds since the time of last mapping control and we are not called once per millisecond, but rather arbitrarily.

added a commit that referenced this issue Jun 9, 2022
``` #593 Add time_rel variable to control transformation formulas, poll i… ```
``` 1d0fbf8 ```
`…f used`
added a commit that referenced this issue Jun 9, 2022
``` #593 Deactivate mode also if mapping persistently disabled ```
``` 5d5af9a ```
```- not just if mapping control disabled
- this was a mismatch between the two```
added a commit that referenced this issue Jun 9, 2022
``` #593 Clear source timer last fire data when deactivating mapping ```
``` 98d7ff1 ```
```This seems to be the last step to make enabling/disabling the whole mapping
have the same effect as enabling/disabling control only.```
added a commit that referenced this issue Jun 9, 2022
``` #593 Add special stop and none result variables in transformation… ```
``` 402dc68 ```
`… formulas`

### helgoboss commented Jun 9, 2022

 Okay, enough progress on this one for upcoming 2.13.0-pre.5. I'll leave it open though because it still might need some polishing or changes here and there.

added a commit that referenced this issue Jun 11, 2022
``` #593 Multiple changes ```
``` 24e3053 ```
```- Fix SWELL dialog generation on macOS and Linux
- Don't require building with "generate" feature anymore after
changing dialogs```
added a commit that referenced this issue Jun 11, 2022
``` #593 Improve scaling stuff ```
``` c21ff2e ```
added a commit that referenced this issue Jun 11, 2022
``` #593 Introduce scaling scopes ```
``` 0a8952e ```
added a commit that referenced this issue Jun 11, 2022
``` #593 Make scoped scaling work ```
``` b2c2823 ```
added a commit that referenced this issue Jun 11, 2022
``` #593 Don't check in rc and rc_mac_dlg files anymore ```
``` 6a3c65d ```
added a commit that referenced this issue Jun 11, 2022
``` #593 Avoid second incorrect labels on macOS ```
``` e9ad304 ```
`by omitting the accessibility-only groups on macOS`
added a commit that referenced this issue Jun 11, 2022
``` #593 Attempt to solve the second labels issue at runtime ```
``` 0e3706f ```
```but not very elegant because we need to make sure they are
hidden initially and never shown```
added a commit that referenced this issue Jun 11, 2022
``` #593 Solve second label issue by introducing conditional controls ```
``` 6e2b59e ```
added a commit that referenced this issue Jun 11, 2022
``` #593 Allow to configure different scalings per OS with just one bindi… ```
``` a4eed6d ```
`…ngs file`
added a commit that referenced this issue Jun 11, 2022
``` #593 Don't use SWELL scaling on macOS anymore, scale in RC only ```
``` 8a43346 ```
added a commit that referenced this issue Jun 11, 2022
``` #593 Make mapping panel a bit tighter vertically on macOS ```
``` a4c9cb8 ```
added a commit that referenced this issue Jun 11, 2022
``` #593 Remove margins from mapping/group header panel ```
``` f1d9b07 ```
added a commit that referenced this issue Jun 11, 2022
``` #593 Improve mapping/group header panel size/position a bit, looks ok… ```
``` 3ccac02 ```
`…ay on macOS`
added a commit that referenced this issue Jun 12, 2022
``` #593 Make checkbox heights always the same ```
``` 21b767b ```
added a commit that referenced this issue Jun 12, 2022
``` #593 Slightly increase groupbox sizes, fix unit button ```
``` 4af5e8f ```
added a commit that referenced this issue Jun 12, 2022
``` #593 Fix many widths to not cut off labels ```
``` 0e01e5b ```

### helgoboss commented Jun 12, 2022

 Oops, referenced the wrong issue with many of the upper commits. Belongs to #589.

This was referenced Jun 17, 2022
mentioned this issue Jul 28, 2022

### helgoboss commented Oct 11, 2022

 I think this has natured enough to be closed. The new control transformation editor even visualizes the transformation and some thought has been put into making rel_time better.

added the realearn Related to ReaLearn label Jul 25, 2024
to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request realearn Related to ReaLearn
Projects
None yet
Development

No branches or pull requests

3 participants