4 ms·
Chris @ airwindows is super nice to release all his plugins and source code for free. But the code quality is really bad. That doesn't matter if you're using a
by squeaky-clean 2y ago
Chris @ airwindows is super nice to release all his plugins and source code for free. But the code quality is really bad. That doesn't matter if you're using a plugin in the production of a song and it works well. But for learning dsp, it's a bad resource.
- mottosso 2y agoI was curious what you meant and went to have a look. At first all seemed well, until I got to the actual audio processing part. :) https://github.com/airwindows/airwindows/blob/master/plugins/WinVST/BassDrive/BassDriveProc.cpp https://github.com/airwindows/airwindows/blob/master/plugins... Then again, maybe this is the norm for audio engineers? Not my field.
- al2o3cr 2y agoThe documentation for that specific module even calls it out as "painfully hard-coded biquad filter code", YMMV. I'd guess those files aren't what the author actually edits - there are commits that suggest that they are _generated_ from "boilerplate", and even a few files that seem to have failed interpolations ("__MyCompanyName__" in some copyright lines, for instance) A lot of files also seem to have duplicated code, down to individual comments. For instance, the comment on line 24 reoccurs on line 344 of this effect: https://github.com/airwindows/airwindows/blob/master/plugins/WinVST/Doublelay/DoublelayProc.cpp https://github.com/airwindows/airwindows/blob/master/plugins... and in the Mac AU version on line 267: https://github.com/airwindows/airwindows/blob/master/plugins/MacAU/Doublelay/Doublelay.cpp#L267 https://github.com/airwindows/airwindows/blob/master/plugins... and in the Linux VST version on lines 24 and 344: https://github.com/airwindows/airwindows/blob/master/plugins/LinuxVST/src/Doublelay/DoublelayProc.cpp#L24 https://github.com/airwindows/airwindows/blob/master/plugins...
- djaychela 2y agoNot looking for an argument, but can you give some pointers as to what is bad about the code?
- squeaky-clean 2y agoSomeone already shared an example of how difficult the dsp code is to read. There's tons of magic numbers and short variable names with no description of why the code does what. Again, that's cool if you want to use the compiled version in a song, but it's not friendly to learn from. But I don't think the goal of this project is to be educational, it's just a little bonus that the code is open source. There's also just things like uneven indentation, lots of things to reduce linecount at the expense of readability like single line if statements. Old optimization tricks that aren't necessary with modern compiler like `while (--sampleFrames >= 0)`. Here's another example file https://github.com/airwindows/airwindows/blob/master/plugins/WinVST/Baxandall/BaxandallProc.cpp https://github.com/airwindows/airwindows/blob/master/plugins... And the project structure is really weird. Normally you would use a framework like JUCE or iPlug, or write your own, such that your dsp code is written once and your multiplatform code is separate. Instead every platform (Mac, Windows, Linux, VST, AU) are a separate codebase with all the dsp code duplicated. He's definitely using some sort of templating system to do this, maybe even using some tool that lets him write the dsp in Python or Matlab and converts it to C++. Basically these files in the github are not his true "source", this is generated from his real source. For that reason, commits are often massive and unhelpful in tracing changes to any individual effect. For example, a recent commit where he added the WolfBot effect, a guitar amp simulator, has 427 changed files and 150,284 added lines. Also even though the commit is titled WolfBot, this commit includes the addition of other fx, CreamCoat, DeRez3, kCathedral3, kGuitarHall, kPlate140, kPlate240. https://github.com/airwindows/airwindows/commit/7623a1c14b012a1a6407bb0e3ba252d1f027a823 https://github.com/airwindows/airwindows/commit/7623a1c14b01...
- djaychela 2y agoThanks, much appreciated that you took the time to point those things out.