As I’m a student of electrical engineering, I learned some C programming for microprocessors at university, after that I taught myself how to use C++ in the context of Arduino programming, but I never learned C++ in any lecture from scratch. But I had a Java lecture some years ago. Even if I don’t remember any piece of Java code, it gave me a good impression of the ideas behind object oriented programming.
I’m familiar with theory and practice of digital (audio) signal processing and I’m a musician and sound engineer myself, but I only did MATLAB and MAX MSP based software Projects and FPGA based hardware projects until now. My goal is to be able to use the power of modern CPUs for linux powered embedded audio devices as well as for cool Mac/PC based Audio Plugins in future.
So it’s time for me to learn a lot of different stuff. As a starting point, I want to start improving my C++ skills and then go on and practice some other programming languages. I’m glad to have found JUCE as an easy starting point. I already played around with a simple VST plugin, but I think it’s good to get familiar with efficient algorithm programming before starting to build a gui, so I started with a simple command line tool, placing a biquad filter between the default system in- and output. It is meant to be a learning project rather than to be a really useful application.
You’ll find my project here: https://github.com/JanosGit/simpleAudioFilters
I wanted to try to focus on different things:
- inheritance: The biquad class inherits from the myAudioProcessor class, myAudioProcessor should be a base class for all classes that process audio and should have virtual member functions, that are implemented by its child classes
- readability: The code should be well structured to help other people understanding my code. I’m no native english speaker, but I tried to use my best english
- performance: I tried to implement the critical audio processing part as efficient as possible
Now I would appreciate some feedback! What can be done better, what is good? Any suggestions for good websites/books?
And there are two special questions:
In line 29 of myAudioProcessor.h the virtual destructor is commented out. This way, the project builds without errors, but Xcode show the warning
'myAudioProcessor'h has virtual functions but non-virtual destructor
But if I remove the comment, I get the linker error
Undefined symbols for architecture x86_64: "myAudioProcessor::~myAudioProcessor()", referenced from: biquad::~biquad() in biquad.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
What is wrong at this point?
The second question is how to setup a JUCE based project, so that it could be shared via github? I cloned the repo to a different machine with JUCE installed, but all search paths in the project were absolute paths to the JUCE folder on the machine, the project was created with, so I was unable to build it with that configuration and had to change all paths to all modules. I’m sure there is a better way