helgoboss / helgobox

Helgobox: ReaLearn & Playtime
https://www.helgoboss.org/projects/helgobox
GNU General Public License v3.0
204 stars 20 forks source link

Feature request: freely editable CC transformation curves #49

Open ulibs66 opened 3 years ago

ulibs66 commented 3 years ago

I am an EWI player (electronic wind instrument) - for us it is very important to map CC#2 to parameters in synths (i. e. to a filter cutoff, to the wavetableposition of a generator, etc. in order to change the timbre of sound with volume). If a synth plugin does not support CC#2 or midi learn realearn is very helpful. It would be fantastic to have individual transformation curves for each mapping in realearn and it would be a killer feature if these could be shaped by mouse action (bezier cuves) like for eample in midiCurve by pizmidi (https://www.kvraudio.com/product/midicurve-by-insert-piz-hereurl). Any chance?

helgoboss commented 3 years ago

I can imagine making a bezier function available for usage in the existing control transformation formular field (in which you can already do everything you want, but you have to know some math). Not a fancy GUI yet for drawing those curves, but quick to implement. In a next step (but that would take longer), one could integrate a small editor that generates the formula.

ulibs66 commented 3 years ago

Helgo: that would be great! (being a chemist my math skills are limited ...) Do you mind, if I post this in the EWI community? (I mean that you are generally open towards my suggestion).

helgoboss commented 3 years ago

If you want, of course. Not sure though when I can start with this, there are some bugs and a big new feature that have higher priority at the moment. Would one bezier curve be enough? (something like this: https://cubic-bezier.com/#.27,.83,.49,.09)

ulibs66 commented 3 years ago

Ideally it would have more segments with individual curvatures. I will try to show what I mean: https://youtu.be/M2xRl6oz8pE. Doubleclick adds a point (or deletes an existing point), points can be moved by click hold & drag, curvature of line segments can be edited by click hold & drag. A typical scenario: steep increase to a moderate value for Breath CC in the low range (for example between 0 and 30. moderate slope for Breath CCs between 30 and 90 (second segment), steeper slope quickly reaching the max. level for high Breath CCs (90 to 127; third segment). Does this make sense?

helgoboss commented 3 years ago

I just looked into existing tools that can create curves with multiple points and ran into this: https://www.source-code.biz/snippets/typescript/functionCurveEditor/. It's a general function curve editor that could probably be adjusted a bit to display just one quadrant of the coordinate system. It would be possible to integrate it in the following way:

At the moment this browser-based solution is as best as it can get. ReaLearn's user interface framework is not so suited for graphical editing of this kind so it would take much effort to program an integrated solution, which I don't want to invest time in.

If you think this solution will satisfy your needs, I could give it a go. It's basically just 2 user interface interactions more compared to a fully integrated curve editor ("open, change, copy, close, paste" vs. "open, change, close"). Personally I would think it's a good start and already usable. Using a browser-based curve editor also has the advantage that there are more developers out there who could contribute in future to make the editor better. It might also be possible to avoid the 2 extra clicks in future by using an integrated web view.

patmaddox commented 3 years ago

I think this is really cool. My main interest in this is using a single knob to modulate multiple parameters with different curves, e.g. for transition effects. So for example I might have a map like this:

image

and the ReaLearn config would be something like:

Then I map the same source knob to a reverb mix target, using this map:

image

So by moving the knob from 0-127, I get an effect of high-pass filter moving up, back down, then way up, all while the reverb mix increases to 100%. I've programmed in my transition and all I have to do is move the knob to control the rate at which it happens.

And in an absolute dream world, I would be able to select sets of mod maps using a controller. So like with an APC, I might have one button that selects that mod set, and another button that selects a mod set which closes a low-pass filter and adds some bit-crushing. So the buttons allow me to select a specific transition effect, and then the knobs let me control the transition.

helgoboss commented 3 years ago

So by moving the knob from 0-127, I get an effect of high-pass filter moving up, back down, then way up, all while the reverb mix increases to 100%. I've programmed in my transition and all I have to do is move the knob to control the rate at which it happens.

Okay, this is the use case. This would for sure work once we have a curve editor. But the question now is what's the quickest way to get there: https://github.com/helgoboss/realearn/issues/49#issuecomment-754983718. If someone could find the perfect already existing browser/JavaScript-based open source GUI component, that would be great. This is one I found after some quick googling: https://www.source-code.biz/snippets/typescript/functionCurveEditor/ (would need some adjustments though).

And in an absolute dream world, I would be able to select sets of mod maps using a controller. So like with an APC, I might have one button that selects that mod set, and another button that selects a mod set which closes a low-pass filter and adds some bit-crushing. So the buttons allow me to select a specific transition effect, and then the knobs let me control the transition.

I think this you can do by using conditional activation once there's a curve editor.

patmaddox commented 3 years ago

One thing I wonder is if maybe it would be possible to use Reaper's automation curves to do this, and then extract them? That would actually be super cool for getting the exact curves. So I might do something like this:

image

and then I could extract those curves to ReaLearn mod maps. That would let me fine-tune the transition curve, and then once it's in ReaLearn I can control the rate at which it happens.

But the question now is what's the quickest way to get there: #49 (comment)

I am willing to research that some and propose options. It won't be a starting focus though - I am new to ReaLearn so still need to get a hang of the basics! But, this use case is something that's very interesting to me for live performance, so I am certainly willing to help out here.

helgoboss commented 3 years ago

One thing I wonder is if maybe it would be possible to use Reaper's automation curves to do this, and then extract them? That would actually be super cool for getting the exact curves. So I might do something like this:

Interesting thought! That's technically possible, yes. The workflow could be a bit intimidating maybe (having to leave ReaLearn, adding an envelope, adding a time selection, letting ReaLearn capture it, removing the envelope, ...)

patmaddox commented 3 years ago

Yeah it's definitely something that may be accessible for creating the curve the first time, but then how would you adjust it afterwards? Re-write it back to the automation lane, tweak, and re-import to ReaLearn? Just one idea of a curve editor that we are all familiar with :)

patmaddox commented 3 years ago

Just to follow up on this: I probably would not use this in ReaLearn anymore. I have started using Plugin Guru Unify for instruments, and it has a very nice curve editor built-in. So I am now using ReaLearn more as a high-level control layer - and of course it maps perfectly to Unify's built-in macros.

So anyway, I won't discourage inclusion of this into ReaLearn of course - but simply to share that I've found an effective way to accomplish what I want.

helgoboss commented 3 years ago

Ah okay. Definitely not discouraged including this into ReaLearn. Not a fan of multi-plugins - at all. They always feel like a big hack to me because DAW integration is lacking. Calls for trouble.

patmaddox commented 3 years ago

I get that. One of the things that appeals to me about Unify is that it has a unified patch browser for instruments I build in it. It makes up for a shortcoming in Reaper - not easily being able to cycle through different FX chains.

But, it's likely that that's just a gap in my reaper knowledge. Do you have any good suggestion for navigating through a folder of FX chains to try out different ones? All I know of is the right-click to show the menu, and that's slow and cumbersome compared to using arrow keys to navigate up and down a preset list.

Arthur-McArthur commented 3 years ago

A curve editor would be amazing, especially if you can draw in a custom curve/shape using points and tensions! The free VST midiCurve from Insert Piz Here is a decent example. In the meantime, could you share some EEL2 examples for control transformation curves?

ulibs66 commented 3 years ago

It would be fantastic to have the midiCurve functionality in realearn. Far more convenient as opposed to importing curves from an external editor. My use case is CC2 (Breath) mapping to a parameter in a synth (i. e. filter cutoff - sound gets brighter when you blow harder). A transformation curve would be very handy in order to fine tune how the CC2 level from my wind controller (EWI 4000s) affects the filter cutoff. While finding the right curve many fine adjustments would have to be tested quickly. So one would have constantly have to switch between an extrenal curve editor and realearn. The direct implementation of the cuve editor into realearn would be very advantageous. As far as I understand from helgo it is unfortunately not feasible due to restrictions or limitations that apply for the programming tools that are available in reaper or at least not within the tools that helgo used to build realearn. (I dont' have any programming skills - so please forgive me if my wording is a bit clumsy ...).