Trying to get AudioTK working with JUCE

I’m relatively new to both Juce and c++ and wanted to try Audio Toolkit, but am unable to get it working with Juce.

Here’s the instructions provided in gihub:

How to add AudioTK as JUCE modules

Get an official relase version of ATK from github

Copy modules/JUCE/ATK/config.h in the folder ATK and modify to select a FFT implementation

In Projucer
    Add to the extra compiler flag -I/path/to/ATK/folder -I/path/to/Boost/headers
    Add also the path to Eigen if you selected it
    Depending on the choice of FFT backend, add the compiler and linker extra flags
    Add the modules you want to your project

Can someone instruct me on how to get this working?

I don’t understand the syntax for adding extra compiler flags or linker flags, might have some other problems as well, so step by step would be most helpful, but even explaining how to add the flags would be a huge help.

Summoning @Matthieu_Brucher, the author of AudioTK.

Summoning Cthulhu done :smiley:

What is your problem? The selection of the FFT implementation? (you can use the one shipping with JUCE if I remember properly) What’s the problem with the compiler flags?

This is already step by step, so I need more info on what’s the actual problem.

Hello Cthulhu :smiley:

Yep, that’s step by step it’s just that I’m pretty new to both JUCE and c++ and lack some probably obvious knowledge, so I was unable to follow.

Other than getting boost and Eigen to work with JUCE this is a first library I’m installing, so I’ll just list here everything I’m not 100% about. Btw Audio toolkit looks to be an amazing library so thanks for making it available.

  • So when I first add the modules, do I add them by making a new project and choosing static library or do I add them to each project separately?

  • I’m supposed to copy config.h into folder audioTK-master/ modify it to choose FFT implementation and leave the modules where they are right?

  • I don’t yet really understand adding flags at all, but if I am right extra compiler and linker flags are added in projucer under exporters and then in my case Visual Studio. Do I just drag the folders there or do I add -l/ before (e.g. -l/Libraries/AudioTK…) ?

  • I have the newest boost 168.0 installed, but I can’t find folder Boost/headers anywhere. Do I just use the path to …/boost/ or what should I do?

  • If I choose to use JUCE built in FFT-backend, I assume these are again added in Projucer->Exporter->Visual Studio, but again I don’t understand flags yet, so can you provide me with syntax or example?

I’m supposed to copy config.h into folder audioTK-master/ modify it to choose FFT implementation and leave the modules where they are right?

Meant audioTK-master/ATK

  1. I found that the easiest was to use modules, so you just need to add the modules/JUCE folder to the projucer module path. Once it’s done, you can add the module you want to any project
  2. yes, you should copy config.h in the root ATK folder. Modify it, for instance by default it uses FFTW (GPL), but you may want to use IPP instead.
  3. the projucer should set up the Visual Studio solution, so you must add the flags in the projucer.
  4. for Boost, you need to add the root folder of Boost (the one that contains the “boost” folder), I use its standard layout.
  5. you cannot use the JUCE FFT, but as I think it uses IPP, you should have all the headers and libraries you need automatically. If not, you can install IPP (from Intel, free) and add the include folders with -I/… and you need to link against IPP libraries core, s and vm.

Let’s try with he first steps and let me know where you are stuck!

I think this is not right. When I looked at the dsp::fft internals some time ago, I it used the fft from the accellerate framework on Apple platforms and a quite unoptimized juce-internal fallback implementation on all other platforms as default.
JUCE allows you to supply an Intel FFT or fftw optionally that will be used instead of the default implementations, but they don’t come with JUCE, so you cannot expect them to be present in a normal JUCE installation.

Thanks for the precision, I suppose the one choice is then to install IPP!

Ok, got close with the instructions. Thanks.

I linked to IPP with using default linking in Projucer instead of doing it with -l/ .
Also needed to link to GSL.

Tested by trying to add EQ module (+ core and utility) Now, I’m down to 3 errors.

  1. Cannot open include file: ‘ipp.h’ no such file or directory. Maybe I need to add the include folders to IPP manually instead of using default linking in Projucer?

  2. Cannot open include file: 'ATK/EQ/FourthOrderFilter.cpp - Seems to be missing from the folder. I can comment it out of course. Also if I switch to Distortion there’s only 2 errors.

  3. Cannot open file ‘testATK.lib’

That’s wrong, it’s a header only library!

  1. yes, you need to add the IPP header path
  2. you have to have the path to ATK to your include path, otherwise… well, you won’t get ATK!
  3. obviously.

Sorry, was tired. I meant I had to add header search path in Projucer.

  1. Thanks, that fixed it.

  2. I had added that and I can access it. It’s only the FourthOrderFilter.cpp that is missing and I can just comment it out no problem, but I did check the folder and github and everything else has .h .hxx. cpp except for FourthOrderFilter, which is missing the .cpp, so maybe that’s by accident.

  3. This error is no more, but instead I get Linker tools error now saying cannot open file …/AudioTK-master/ATK.obj
    I’ll try to look into this later when I have time, but if you know what the problem is would really appreciate it if you could tell me how to solve it. That’s the last error I have, so hopefully everything should work after.

Got it working now :smiley:

Except for the fourth order filter missing .cpp of course.

Excited to test the library this evening when I have more than a moment.

Thanks for helping with my noobie questions!

Great! Indeed, that may be a bug (for the FourthOrderFilter), feel free to submit a bug for it if there is a file missing.
No problem at all with helping a fellow DSP developer :smiley: