ssj71 / rkrlv2

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

rkr Harmonizer automation oddity and clicking #40

Closed cyrusadkisson closed 4 years ago

cyrusadkisson commented 4 years ago

I must be crazy, because I'm trying to use rkr Hamonizer to simulate the two guitar parts of The Allman Brothers' Jessica. This requires lots (AND LOTS) of "interval" automation.

But there are two issues:

  1. The automation "type" is wrong. It creates slopes when it should create only steps.
  2. When it automates between points, there are very audible clicks/pops. Maybe this is due to the faulty automation type?

Do you think these are solvable?

brummer10 commented 4 years ago

@cyrusadkisson You are one of those who think that plugs have to solve automation issues in a DAW. Also, a DAW, don't have to solve issues with a plug in automation. Unlikely you settle exactly between. This issue could be solved inside the plug (at the cost of some CPU circles) or, inside the host (again on the cost of some PU circles). The question remains is, who do spend those circles. Given that most use-case of the Harmonizer didn't involve automation, I've the impression it's unlikely that it get resolved here. I believe it's in the response of the user to calculate the automation curve so that it suits your needs. It's easy to blame a developer for "automation didn't work like I expect", but, may involve a bit of understanding the underlying analogue technical requirements to see, that, what you try to do, you can't do even with analogue equipment.

cyrusadkisson commented 4 years ago

@brummer10 I'm not sure why you've taken personal offense to this observation (and I guess other observations I've made about Guitarix and GxPlugins.lv2?). Anytime I mention a shortcoming of a plugin or any open source product, it's never an attack on the developer; merely pointing out what was confusing, didn't work (objectively) correctly, or could be improved.

In each case,

  1. someone wrote the code for the plugin
  2. someone wrote automation capabilities into it
  3. you could assume that whoever did these things (or whoever the maintainers are now) would want them to work optimally and common-sensibly
  4. the default assumption, then, is that said creators/maintainers would want to hear feedback about what could be better and I am always (sincerely) gracious and polite when I make such observations as I know open source maintainers are not obliged to do anything at all.

To point out that this automation should have stairstep automation (like enable/disable or changing tonestacks in Guitarix) is non-debatably a better way for this automation to work. Nobody needs a gradual slope from A to A#. The plugin itself doesn't offer frequencies between.

If the creator/maintainers don't want to make these changes, that's their prerogative. My options are then to try and make the changes myself in the codebase (which I've done in some cases), build my own plugin or contract with someone else to build what I want (which I've also done). Nothing personal about any of it.

brummer10 commented 4 years ago

Sorry @cyrusadkisson, I was a bit over. I didn't mean it personal. You are right, and I'll take your requests into account (at least for the guitarix plugs).

cyrusadkisson commented 4 years ago

@ssj71 Wondering if you have any thoughts on the plugin automation and popping?

ssj71 commented 4 years ago

Issue 1 is absolutely due to the the host. I can't really control how they are drawing automation curves. What host are you using?

Issue 2 sounds like a bug in the harmonizer. I'm not sure when I'll have a chance to look at it, but I'll put it on my todo list. Thanks for the report.

p.s. Jessica is a great tune :)

x42 commented 4 years ago

Wondering if you have any thoughts on the plugin automation and popping?

Keep in mind that you don't need automation, just turning a knob manually is equivalent.

cyrusadkisson commented 4 years ago

I'm no LV2 expert, but don't the LV2 ttl files specify their own automation types?

For instance on guitarix's main plugin, the volume knob (smooth) looks like:

lv2:port [
        a lv2:InputPort ,
            lv2:ControlPort ;
        lv2:index 0 ;
        lv2:symbol "MasterGain" ;
        lv2:name "MasterGain";
        lv2:default -15.0 ;
        lv2:minimum -20.0 ;
        lv2:maximum 20.0 ;
    ]

and the tonestack selection (stairstep) looks like this:

[
        a lv2:InputPort ,
            lv2:ControlPort ;
        lv2:index 10 ;
        lv2:symbol "t_model" ;
        lv2:name "Tonestack Model" ;
        lv2:default 1 ;
        lv2:minimum 0 ;
        lv2:maximum 26 ;
        **lv2:portProperty lv2:integer;**
        lv2:portProperty lv2:enumeration ;
        lv2:scalePoint [rdfs:label "default"; rdf:value 0];
        lv2:scalePoint [rdfs:label "Bassman Style"; rdf:value 1];
        lv2:scalePoint [rdfs:label "Twin Reverb Style"; rdf:value 2];
        lv2:scalePoint [rdfs:label "Princeton Style"; rdf:value 3];
        lv2:scalePoint [rdfs:label "JCM-800 Style"; rdf:value 4];
        lv2:scalePoint [rdfs:label "JCM-2000 Style"; rdf:value 5];
        lv2:scalePoint [rdfs:label "M-Lead Style"; rdf:value 6];
        lv2:scalePoint [rdfs:label "M2199 Style"; rdf:value 7];
        lv2:scalePoint [rdfs:label "AC-30 Style"; rdf:value 8];
        lv2:scalePoint [rdfs:label "Mesa Boogie Style"; rdf:value 9];
        lv2:scalePoint [rdfs:label "SOL 100 Style"; rdf:value 10];
        lv2:scalePoint [rdfs:label "JTM-45 Style"; rdf:value 11];
        lv2:scalePoint [rdfs:label "AC-15 Style"; rdf:value 12];
        lv2:scalePoint [rdfs:label "Peavey Style"; rdf:value 13];
        lv2:scalePoint [rdfs:label "Ibanez Style"; rdf:value 14];
        lv2:scalePoint [rdfs:label "Roland Style"; rdf:value 15];
        lv2:scalePoint [rdfs:label "Ampeg Style"; rdf:value 16];
        lv2:scalePoint [rdfs:label "Rev.Rocket Style"; rdf:value 17];
        lv2:scalePoint [rdfs:label "MIG 100 H Style"; rdf:value 18];
        lv2:scalePoint [rdfs:label "Triple Giant Style"; rdf:value 19];
        lv2:scalePoint [rdfs:label "Trio Preamp Style"; rdf:value 20];
        lv2:scalePoint [rdfs:label "Hughes&Kettner Style"; rdf:value 21];
        lv2:scalePoint [rdfs:label "Fender Junior Style"; rdf:value 22];
        lv2:scalePoint [rdfs:label "Fender Style"; rdf:value 23];
        lv2:scalePoint [rdfs:label "Fender Deville Style"; rdf:value 24];
        lv2:scalePoint [rdfs:label "Gibsen Style"; rdf:value 25];
        lv2:scalePoint [rdfs:label "Off"; rdf:value 26];
    ]

Doesn't "lv2:portProperty lv2:integer" make the difference?

cyrusadkisson commented 4 years ago

Wondering if you have any thoughts on the plugin automation and popping?

Keep in mind that you don't need automation, just turning a knob manually is equivalent.

I see your point, but people don't typically do that in the middle of making signal (i.e. playing).

ssj71 commented 4 years ago

people don't typically do that in the middle of making signal (i.e. playing).

I see you are not an electronic artist. ;) Also you must not have an expression pedal. Automation is just making the computer turn the knob for you. They are exactly the same to the plugin and it hasn't a clue which one is happening. It doesn't change the fact though.

Also portProperties like that are just hints, and the host must implement how they handle the hints, and so different apps handle them differently.

brummer10 commented 4 years ago

Keep in mind that you don't need automation, just turning a knob manually is equivalent.

With automation you could jump with the parameter value direct from 0.0 to 100.0, for example. You cant do that with knobs, even not with a expression pedal. This could bring normal parameter smoothing to it's limits.

cyrusadkisson commented 4 years ago

@ssj71 As far as the original purpose of this issue: the artefacts audible when automating between harmonizing intervals, would this be something that is fixable? I'm happy to provide a reasonable donation to get the ball rolling.

x42 commented 4 years ago

You cant do that with knobs, even not with a expression pedal.

Sure can. The prime example is Cry Baby Wah. Anyway the context here are enum, in the analog world that be rotary switches.

Anyway, you cannot jump directly in a DAW using automation, either. The minimal granularity is 1 sample. It may be fast but it's not immediate. A plugin should still behave properly regardless.

brummer10 commented 4 years ago

Sure can. The prime example is Cry Baby Wah.

I wouldn't go into the maths for how long one sample takes, but, to move a expression pedal from zero to max, in the same amount of time one sample takes, wow, you must be superman.

x42 commented 4 years ago

There's a switch in said pedal. It's had on/off. And the analog electronics also filters he click in this case.

brummer10 commented 4 years ago

A switch, toggle between on/off, not a problem at all. This could be ramped. What the problem here is the (to) fast move of a variable parameter during run, which normally is smoothed. Making the smooth of parameter changes to big will result in a notable delay for small changes. So finding the "right smooth" is the task. On the other hand, it will be easy to do in the automation engine of the DAW.

x42 commented 4 years ago

The interpolation that happens inside the effect should be independent of the speed of which you change a controller. There is usually a limit and faster changes are always smoothed at rate.

I'm not sure why we're even arguing about this.

In analog electronics is just a capacitor charging. It's common even for knobs that can only be moved slowly. In DSP a tuned 1st order LPF is common and good practice for the same reason.

brummer10 commented 4 years ago

I'm not sure why we're even arguing about this.

Me to. Even a LPF comes to it's limits when a input changes from min to max during one sample. And so does as well a capacitor in analogue world.

x42 commented 4 years ago

Even a LPF comes to it's limits when a input changes from min to max during one sample. And so does as well a capacitor in analogue world.

Both of these statements are not correct, but I'll drop it, this is not the place to educate on the subject.

Anyway, it'd be great if the original issue could be addressed.

brummer10 commented 4 years ago

It would be nice if a plugin could give a hint like lv2:automation step_size 0.1 which should mean the max accepted parameter change per sample. Surly that must be optional for the host.

brummer10 commented 4 years ago

The guitarix plugs use a one-pole lowpass with a pole at 0.993. Surly I could set the pole lower, so that value changes been more smoothed out. But, for some parameters it would require a so low pole to ensure a smoothing for the full range at once, that you get a notable delay on parameter changes. In guitarix main I've implemented therefore a parameter ramping for those affected params. The ramping step in when a value change comes in a range which cant be handled by the implemented lowpass. This could happen on preset switch. So, when a plugin could give a hint to the host, which range of parameter change it is able to handle smoothly, the host could implement a ramp for the case a value change range overcome this.

cyrusadkisson commented 4 years ago

Anybody have suggestions for who might solve these audible automation issues for me (on a paid basis)? When I think about someone playing both parts of Jessica at the same time, it gets me all excited.

Anyone, anyone? Bueller?

Stazed commented 4 years ago

O.K. @cyrusadkisson

Try this in the Harmonizer.C file. In function out():

line 118: -- if((DS_state != 0) && (Pinterval !=12)) { ++ if(DS_state != 0) {

line 135: -- if (Pinterval != 12) { line 137: -- }

line 139: -- if((DS_state != 0) && (Pinterval != 12)) { ++ if(DS_state != 0) {

The above just removes the harmonizer algorithm effect bypass when the interval is 0 (offset by 12). It will make the effect process even when the interval is 0. Will cause the effect to sound different when the interval is 0, but not change the tone, kind of like a chorus effect.

cyrusadkisson commented 4 years ago

@Stazed Thanks for the patch, but my issue is the audible noise that happens when automating from one interval (say, +5 semitones to +7 semitones). How does removing the effect bypass when interval == 0 solve this problem?

Stazed commented 4 years ago

@cyrusadkisson I did some testing for the noise using different hosts. I could only produce the noise when going from interval 0 to another value. The changes from non-0 to non-0 did not produce the noise, regardless of the range. The patch fixed the 0 issue. What host are you using?

cyrusadkisson commented 4 years ago

Ardour 6. I tried your fix but hear the same thing.

I made a video where you can hear the clicks as it automates. https://youtu.be/Tz00tNQH-KE

Note there's also a click when I pause the playback, something I don't normally hear in Ardour. Also emanating from rkr Harmonizer?

cyrusadkisson commented 4 years ago

Figured it out. I don't get any audible problems when using rkr Harmonizer on audio tracks. Only on MIDI.

... which might be why the plugin description in the Ardour plugin manager says "no midi".

Whoops.

What's the difference anyway?