ssj71 / rkrlv2

Rakarrack Effects Ported to LV2 Plugins
GNU General Public License v2.0
53 stars 10 forks source link

rkr Flanger/Chorus Wet/Dry knob behaviour #18

Closed NY-tram closed 7 years ago

NY-tram commented 8 years ago

Hi, thanx for these excellent lv2 plugins! When using the Flanger/Chorus I was expecting the dry/wet knob to mix the flanged/chorused signal with the input signal.. so that a zero value would give me a non flanged sound ( essentially a bypass )and a 127 value a full flanged sound. However, I don't get it to work like that.. is there any way to do this?

Regards, Ny_tram

ssj71 commented 7 years ago

I made these to be true to rakarrack, so even though I think its weird the wet/dry function works this way: when all wet you actually have 50% dry signal + 100% wet signal. When at 12 o'clock you get 50% wet and 50% dry. All dry actually is 100% dry signal + 50% wet signal.

If you are code savvy I can point to where to go to change this behavior and you can make it work more normally. The function that controls it for all the plugins is here: https://github.com/ssj71/rkrlv2/blob/master/lv2/rkrlv2.C#L167 You can tweak that as you want and rebuild easily, but many of the effects use that function so it will change it for all of them (though personally I don't think that would be bad).

At some point I plan to make a 2nd generation of these effects that has meaningful ranges and units on each control (and wet dry will just be a linear blend like you'd expect).

NY-tram commented 7 years ago

Glad to hear I'm not the only one who thinks the wet/dry function is weird.. Thanx for the pointers.. I've been trying to understand that part of the code before and tried adjusting the values, however I seem to be non code savvy, no luck yet :-(

Version 2 sounds great, hopefully also a mono version of the mutron? Meanwhile I'll keep enjoying the plugins as they are!

ssj71 commented 7 years ago

ya I plan to do a bunch of mono versions in V2 also see #4

if you want to just copy and paste this over the current function (untested but should work):

void
wetdry_mix (RKRLV2* plug, float mix, uint32_t period)
{
    unsigned int i;
    float v1, v2;

    v1 = 1.0-mix;
    v2 = mix;

    for (i = 0; i < period; i++)
    {
        plug->output_l_p[i] = plug->input_l_p[i] * v2 + plug->output_l_p[i] * v1;
        plug->output_r_p[i] = plug->input_r_p[i] * v2 + plug->output_r_p[i] * v1;
    };

}

p.s. I told you wrong. It should be that at 0 you get entirely wet signal and at 127 you get entirely dry, its just weird because it doesn't have unity gain through the whole travel. Is this just backwards from what you expect? can just switch v1 and v2 in lines 190 and 191 if thats the issue.

When I get a chance I'll dig into it and try it myself and see if there's something weird going on. Thanks for using these! let me know if you run into anything else.

NY-tram commented 7 years ago

Just build the plugins again and unfortunately that doesn't seem to work, I still don't get a dry signal..

ssj71 commented 7 years ago

Ok thanks. Sounds like this is a genuine bug. I'll look into it as soon as I can.

On Aug 1, 2016 5:56 PM, "NY-tram" notifications@github.com wrote:

Just build the plugins again and unfortunately that doesn't seem to work, I still don't get a dry signal..

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ssj71/rkrlv2/issues/18#issuecomment-236746777, or mute the thread https://github.com/notifications/unsubscribe-auth/ADVVTHDUbESyeCvLdOwtnF_8MtgueYCcks5qboergaJpZM4JY3Rj .

NY-tram commented 7 years ago

Thanx, just let me know if I can help in someway..

ssj71 commented 7 years ago

@NY-tram what host are you using these plugins in? Ardour uses the same buffer for the input and output so in the end we're mixing something with its self. Sounds like some other hosts do too. I'll have to think a bit about how to fix this. If you'd like to try with another host you might find different results. I'll try to get a fix soon that you can try

ssj71 commented 7 years ago

alright, I went ahead and threw in a fix for just the chorus/flanger in the dev branch. If you check that one out build and install, I didn't test more than making sure it didn't segfault or something. If you could test it out I'll apply that same change to everything else with a wet dry, so that they work properly.

NY-tram commented 7 years ago

I use them in Carla & Guitarix, but Carla has her own plugin dry/wet option so this would mostly be used in Guitarix.

I'll clone the dev branche and go for a test, I'll let you know..

NY-tram commented 7 years ago

In Carla the dry/wet function in the Flanger/Chorus plugin works as expected! But when I add the Flanger/Chorus plugin in Guitarix there is a segmentation fault/ core dump... The other plugins work normally in Guitarix.

You must be getting close!

ssj71 commented 7 years ago

Oh.. :( I think guitarix doesn't support the lv2 extension necessary to make this work. I should have updated the plugin to say this extension is required, but once it is, it will no longer work in guitarix. :'(

I'll have to think some more.

NY-tram commented 7 years ago

Don't know if it is of any use but the TAP Stereo Echo plugin has a kind of similar function ( a Dry level ) which works perfectly in Guitarix : https://github.com/moddevices/tap-lv2/tree/master/echo

ssj71 commented 7 years ago

well, the issue is whether I should do additional changes to the effect source code of rakarrack which will further complicate a merge should anyone ever decide to try to combine the two projects again. But since its been nearly a year, and nobody is stepping up to maintain rakarrack, perhaps I should just go ahead and do it the right way in the source.

brummer10 commented 7 years ago

@NY-tram

I use them in Carla & Guitarix, but Carla has her own plugin dry/wet option so this would mostly be used in Guitarix

Just for the record, guitarix has as well it's own wet/dry box for LV2/ladspa plugins, just, you need to add it explicit in the plugin loader under "show details" -> "use dry/wet box"

NY-tram commented 7 years ago

@brummer10 thanx for the tip, I didnt know about that option! @ssj71 Sorry for spending your time like this when all the options were already available through the different hosts.. I'm gonna feel dumb now and change some presets...

Thank you for the assistance & tips, problem solved and knowledge gained!

ssj71 commented 7 years ago

Well, this is still a real issue that I hadn't thought about, so I'm glad you pointed it out. Now I know and I can make sure to fix that in the next generation.

NY-tram commented 7 years ago

In that case: you're welcome! :-D I'll close this issue as it is not a real issue anymore for now. Good luck with version2 from a happy rkrlv2v1 user, i'll be using them for sure!