KlangFalter: Yet another convolution plugin


#1

Hi everybody,

I’m quite new to the forum, in fact, this is my first post here. Nevertheless, I already follow the posts already quite some time, and I’ve used the great JUCE framework for some of my hobby projects.

One of them is KlangFalter, which is a free (GPL) audio convolution plugin, which I wrote because I couldn’t find any free Audio Unit convolution plugin, and because I was curious about writing any audio plugin:
https://github.com/HiFi-LoFi/KlangFalter

It’s not perfect, but at least it works for me already in Ableton Live. :slight_smile:

Furthermore, you can find the following two “sub-parts” of the plugin on Github.

[list]https://github.com/HiFi-LoFi/AudioFFT[/list]
A simple 2-file (.h+.cpp) 1D FFT implementation in C++ using either Ooura FFT or the FFT routines of the Apple Accelerate framework (MIT licensed). I wrote it, because I was looking for a very fast FFT library in C++ without any further dependencies and which does not consist of many files.

[list]https://github.com/HiFi-LoFi/FFTConvolver[/list]
The FFT convolution algorithm used in KlangFalter (GPL licensed). Again, no further dependencies (not even JUCE).

Maybe parts of this stuff is somehow useful for people.

Regards from Munich,

Uli


FFT and convolution
#2

Looks very interesting!
But I don’t have a Mac :expressionless:
Is there a fast way to bring it to an windows-project?


#3

Looks interesting ! A few questions :

  • What is the latency of your plug-in ?
  • Have you developed a partitioned convolution algorithm to improve the performance of the process when the impulse length is > 1 sec ?

Thanks :wink:


#4

Look very nice ! and code is clear !
Great. Now, we need to have time to test it :slight_smile:


#5

Thanks a lot for your nice feedback! :smiley:

… and sorry for not answering earlier (I was out of town for a couple of days). :oops:

Concerning your questions:

Basically yes, as there’s nothing OS-specific in the code, it shouldn’t be too hard (i.e. as hard resp. easy as porting any JUCE audio plugin). However, I only have a Mac at the moment, so I can’t try it. :frowning:

I’m not sure about the exact definition of “latency”. However, it immediately outputs the processed result of the passed input samples, so I’d say that it has zero latency (except for the time required for processing the input samples), so there’s no latency of a constant number of samples, for example. Does this help? I thankful for any hint how to determine the exact latency.

Yes, exactly, it’s a partitioned convolution algorithm. Furthermore, there’s a further convolver class (TwoStageFFTConvolver), which works internally with a short-block convolver in the front and a long-block (background thread) convolver in the back for improving the balance between short processing time and CPU load.

Regards from the cold and snowy Munich,

Uli


#6

This is very nice! Nice job on the plugin, and special thanks for making it opensource!

Do you mind if I import your code into my distrho project? (http://distrho.sourceforge.net/)
That way I can release Linux binaries (with LV2 support).


#7

Hi falkTX,

thank you very much! :smiley:

[quote=“falkTX”]Do you mind if I import your code into my distrho project? (http://distrho.sourceforge.net/)
That way I can release Linux binaries (with LV2 support).[/quote]

Becoming part of your distrho project would be an honour for me! However, I’d like to do a little more cleanup on the code and testing before releasing it from its “beta” stadium, and at the moment the code is not on the latest and greatest version of JUCE. I hope that I’ll find the time to do this within the next one or two weeks. What about, if I drop you a message as soon as I’m finished with this?


#8

Yes, sure thing! (and thanks again for the opensource plugin, we need more of those!) :smiley:

I’m busy with some other things now anyway, but I plan to get working on a new distrho release around the middle of next month (Feb).


#9

I tried your TwoStageFFTConvolver, Output volume increases when increasing sample rate.. as much as 6 dB when moving from 44.1 kHz to 96 kHz.

I can't really figure out why it's happening though, IR normalization is performed as usual.

I checked KlangFalter and it's happening there as well.

Any ideas?


#10

Did you try to apply a correction gain factor of 44.1/96 (or sqrt(44.1/96)) on the output ? I remember I did something like that on a IR loader I have worked on in the past ;)

For me the DC gain of a FIR filter is simply the sum of all the coefficient values, so obviously when you resample an IR, you increase the output volume of a signal convoluted with this IR, since the number of coefficients has increased, and they may all be positive in the worst case.

You may still have a difference after that since the anti-imaging/anti-aliasing filter is not perfect, but a lot lower than 6 dB...


#11

44100.0 / sampleRate did the trick ;) 

Thanks


#12

Hi,

I downloaded the code and set up the project with the Projucer. It compiles, but plugin won’t work in any of the audio programs I’m trying (Logic, Live and Audacity). The project generates both ‘.vst’ and a ‘.a’ files.

Any idea? Thanks!