lucianodato / noise-repellent

Lv2 suite of plugins for broadband noise reduction
GNU Lesser General Public License v3.0
455 stars 38 forks source link

Storage of Noise Profiles #49

Closed borgdylan closed 6 years ago

borgdylan commented 6 years ago

Would it be possible for the plugin to be able to save the noise profiles to disk, so they could be reloaded in future sessions. I tried using the plugin in ardour, and when I close and reopened the project the noise profile got lost.

lucianodato commented 6 years ago

That shouldn't be the default behavior. This is a bug. By the way what version of Ardour are you using?

lucianodato commented 6 years ago

A basic one, but are you using the latest version of the plugin?

borgdylan commented 6 years ago

I am using ardour 5.12 manually compiled from git.

borgdylan commented 6 years ago

I have also compiled the plugin from the master branch.

lucianodato commented 6 years ago

Ok I will check asap. Thanks for reporting.

lucianodato commented 6 years ago

Indeed I can replicate the bug. I will fix it as soon as I can. Sorry for the inconvenience I'm now getting back to work on the plugin after a long period of inactivity.

borgdylan commented 6 years ago

Thanks. I came across it as I was trying to find something better than using the Calf Equalizer for removing noise. EQ can be too destructive for certain cases.

lucianodato commented 6 years ago

You can try now again. It's fixed in Mixbus 4.3 and Ardour 5.12 in my machine. Tell me how it goes for you.

borgdylan commented 6 years ago

I have tested again on a project I was working on. The profile seesm to still be lost. The project was started after updating noise-repellent on my machine.

borgdylan commented 6 years ago

Ardour seems to be saving LV2 state only, I cannot see any separate file under the plugins directory with noise-repellent data.

borgdylan commented 6 years ago

Also remeber that for ardour to save LV2 state, it must be mentioned in the manifest files along with other parameters if you are going the route of adding the profile as an LV2 parameters rather than a separate on -disk file.

lucianodato commented 6 years ago

Yeah it is implemented as an lv2 state. Was working right with ardour 5.11. In fact lots of users tested that feature successfully. I might have changed something during my latest commits. I will take a look. The weird thing is that is working here. I will inform you when I have something.

Efenstor commented 6 years ago

Luciano, your plugin is incredible! It definitely surpasses the commercial solutions from Izotope and WaveArts! The only source of sorrow is this bug.

Yes, I can confirm, it does not save the noise profile with the latest stable Ardour 5.12 (official binaries for Linux x64). Sometimes it saves the profile, sometimes it does not. I mean, if I have, say, 5 tracks with Noise Repellent, there's a big change that only 2 of them will have the profile saved.

lucianodato commented 6 years ago

I haven't had much time to work on this lately. It seems that this is a difficult one. I'm sorry for the inconvenience I will get back to it ASAP.

Efenstor commented 6 years ago

A couple of things I have noticed about the "plugins" dir behavior:

  1. Each time I save the project the number of saved states increases for each track. Is that normal? I see that "state1" still has the FFT data inside, while all the rest already have zeros. At some point the earlier states are erased, and thus the FFT data becomes lost completely.

  2. When I insert the plugin into 8 stereo tracks, two instances are created for each track ((2x1) Noise Repellent), but in the "plugins" I see only 8 subdirs, while logically there should be 16 states saved somewhere. May be I'm wrong, since the 2 instances are always identical and possibly treated as a single plugin.

  3. There is data inside the state files which seems abnormal to me , such as "-3890321247174656.0"^^xsd:float or "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u00000.0"^^xsd:float. There are also a lot of zeros and even the useful data seems to be repeated twice. Looks like a typical overflow or "saving more than the allocated" problem (don't know how it's properly called).

lucianodato commented 6 years ago

Hi Efenstor, thanks for your detailed comments.

  1. Every time you save a state will be saved for each plugin instance. I think that this is the way the lv2 state extension work. I don't know how many states the host will keep that's something that is not implemented in my code but in Ardour itself.
  2. This might be another bug altogether. I have never tried noise-repellent on stereo tracks. Will report soon on this one.
  3. Well if you don't capture any noise profile the information that will store will be all zeros. Indeed it was an overflow. Well spotted. I have tried to fix that in my latest commit. Could you try now and report back? Maybe it's fixed now.
Efenstor commented 6 years ago

Believe it or not, this small fix solved all the issues! Now there are 8 plugin dirs for 4 stereo tracks, no redundant saved states (only after re-training of the profile a new one is added), and the FFT data is saved and restored correctly, I tested it several times.

Efenstor commented 6 years ago

Now I can finally carry on with my project (remastering of my old demo album). Thank you very much, Luciano!

lucianodato commented 6 years ago

Finally! Great news! Thanks for your help Efenstor! This might deserve a new release.

Efenstor commented 6 years ago

One more thing: it's recommended to clean up the "plugins" dir manually and re-train Noise Repellent for all tracks in existing projects.

Efenstor commented 6 years ago

I was wrong about the number of tracks for stereo tracks, it's not doubled as probably should, so this shall require a bit more clarification, I mean how Noise Repellent works with stereo tracks, in the two-instanced mode. But the profiles are now saved and restored correctly and there are no excessive saved states.

Efenstor commented 6 years ago

I think I already got it: Ardour creates a separate state dir, not a plugin dir for multi-instance plugins. So for each stereo track two state files are written or read. So I guess Noise Repellent works fine with the stereo tracks out of the box.

lucianodato commented 6 years ago

That's an Ardour feature. I have tried with a stereo track and obtained what you mention. Great, less work for me!

lucianodato commented 6 years ago

I will close this bug but if anyone is still having problems feel free to reopen it.

davidhealey commented 5 years ago

Noise profiles are being reset when reloading my Ardour 5.12 project. I'm using the latest master branch.

davidhealey commented 4 years ago

Noise profiles still being reset with Ardour 6 release candidate.

FrnchFrgg commented 4 years ago

@davidhealey I do not see that here. Noise Repellent correctly saves and restores the noise profile in my A6 projects. So either there is a problem with your setup, or a bad interaction from Noise Repellent with it. Maybe something was overlooked in the way NR stores its profiles, that makes it fail in your system. Could you create a session that exhibits the problem and attach a zip file of it here ?

davidhealey commented 4 years ago

I've narrowed down the issue. It only seems to happen if the track has more than 2 channels.

Noise Repellent Test.zip

davidhealey commented 4 years ago

I just spoke with the Ardour devs and it seems this is an issue with Ardour assuming the state is shared for all instances of the plugin. When I add it to a three channel track it inserts 3 instances. The solution is to instead insert 3 copies of the plugin into the chain and route them so each one gets one channel of audio.

lucianodato commented 4 years ago

yep, the plugin is mono