TL;DR
APE is, simply put, an free open source audio plugin with a built-in C++ JIT compiler and a text editor.
Downloads, documentation, manual, repo, more stuff
The old version has been completely rewritten to use a bleeding edge C++ compiler, with a completely refreshed API, UI and many more capabilities.
See flashy videos a bit below if you want to know what this is all about.
Prolog
So I made this little thing a good while back, a "simple" audio plugin with a text editor and a C compiler (TCC) allowing you to write simple DSP code and JIT it into the audio stream...
I was just minding my own business, when the very first comment was about the choice of compiler and optimizations
Flash forward 4 more years, the idea never really left me. The plugin was cool but C is really limiting. Creativity is blocked by the smallest things, and if you're not able to efficiently reuse and eliminate boiler plate, you're not having a good time.
So... C++. LLVM and clang seem to be doing well, even having invested in a JIT framework - but that's a lot of code to pull in, right? Thinking I would save on time and binary size, I even pulled Bjarne Stroustrup's very old CFront transpiler to make a C++ frontend feeding into TCC.
Eventually... It actually worked. But you were stuck with a buggy, 30 year old C++ standard. And of course, still suffering from TCC's (lack of) performance.
I finally broke down and integrated clang and LLVM directly in the binary plugin, giving me a modern C++ library, a configurable linker, parser, optimizer and JIT'er. It only took 3 years of not-getting-much-sleep (after a complete rewrite of the original project anyway, and many new features)!
So, what can this thing do?
- Completely self-contained - ships with SDKs, compiler, linker, editor, console and runtime
- Bleeding edge Clang/LLVM C++ compiler for class leading diagnostics and code optimization
- Full C++17 support (partial C++20 support)
- Most of the C++ standard library included (containers, math, numeric, algorithmic etc.)
- I/O Audio file streaming with a variety of codecs
- System-level exception handling to avoid crashing your host on small errors like integral division
- Console with logging
- Themeable editor with syntax highlighting
- Oscilloscope with expression evaluation
- Precise, smoothed automatable parameters
- Built-in optimized FFTs
- 26 included effect scripts that are documented (54 legacy scripts for inspiration, as well)
- Cross platform support (AU/VST Windows, OS X, Linux for anyone who wants to compile it)
I made a short, quick rundown of the features of this plugin:
https://youtu.be/srJ6EWiXOTo
I also made a longer annotated video of me developing a morph filter from scratch in this plugin:
https://youtu.be/7_jtCDy39FU
Changelog - new in v. 0.5.0
Code: Select all
• Version controlled
• New repository: https://bitbucket.org/Mayae/ape
o New source structure with permanent platform projects
o Most dependencies now included as submodules
o Modular and testable components
o Unit tests
• Build system
• Headers shared between plugin and user scripts, removes stale errors
• Complete rewrite to modern C++
• All manual memory management and leaks removed
• All UI, utility etc. now uses cpl
• Extended platform support, including technical Linux support. See requirements.
• Parameters
o Much more precise user controls, with ability to type in precise 64 bit values
o More flexible and extensible format / range options for parameter values
o Enumeration / lists of strings now supported as combo boxes
o Now automatable by host
o 64-bit precision internally
• Widgets
o Meters are now per-sample evaluated and properly decaying. Also contains peak markers.
• Iteration
o Compatible parameter values preserved
o Hotkeys for all major operations
o True multithreaded compilation across plugins
o Old/new sound blended on swapping instances
• Engine
o Optimized and built-in FFT
o Support for streaming audio files to and from disk, optionally resampled
o Audio thread interactions now completely lock free
o Precise transport access and playback state events to the plugin
• Quality of life
o SDKs and libraries now ship included, removed reliance on user development setup
o Plugin callbacks for initialization and reconfigurations now run asynchronously to avoid stutter on audio thread and hiccups on main thread
o Many more checks of resource managements, assertions etc. to make it much more safe
o Working code is serialized into the project as well, instead of referencing a script on disk.
o User is notified mismatched / out-of-date scripts
o Removed nonsensical errors on abandoned save dialogs
o Long operations timed and printed to the console
• Plugin GUI
o Resizable
o Redesigned, bit buttons removed in favor of simple icons and hotkeys
o Now completely uses vector graphics instead of bitmaps
o Switched to a tabbed system to increase real estate
o Tabs can be orphaned into separate desktop windows, and redocked back
o Graphics optimized and employs precise redrawing, much faster on OS X using core graphics ren-derer
o Subpixel text rasterization for normal DPI displays
o Removed "fpu exceptions" and "protected buffers" switches. These are now determined by compila-tion mode.
• Source code editor
o Externally editing files is now supported, reloading and recompiling whenever the file is saved exter-nally
o Full project and intellisense when working in the source repository for user scripts
o Evaluate source code expressions as "breakpoints"
o Text scaling
o Auto indentation
o Saving a file without extension and determined language appends the default language extension
o Menu option to open "home" (also configurable) scripting directory
o Menu option to create a new file, cloned from the template file
o Menu options for build events (compile, activate, clean, edit externally etc.)
o Default now with a dark theme
• New compiler / language: CppApe
o C++ 17 bleeding edge compiler, based on Clang
o Runtime vehicle is libCppJit: Multithreaded, lazy JIT based on LLVM
o User scripts can now include and use other scripts
o Completely revised front end together with safe and idiomatic user API, boiler plate removed
o Access to most of C++ standard library, based on libcxx
o Subset of C standard library available, based on ccore
o Built-in SIMD vectorized math
o DSP primitives, interpolation algorithms
o Type safe and much faster print() family functions
o 32-bit / 64-bit / 80-bit templated math precision, switchable by user in UI
o Typical scientific math constants available as templated constant expressions
o Complete user API documentation here: TODO
o Assertions supported
o RAII and unwind support
o Some exception support
o Globals, static constructors and destructors supported
o Memory mapped and precompiled system headers for compilation speed
• Oscilloscope
o Based on Signalizer
o Per-sample source code expression evaluation and graphing
o Color coded inputs / outputs
o User-defined triggering
• Bugs
o Console is now thread safe
o Compilation is now thread safe
o Fixed crashes on immediate deserialization
o Many user file bugs fixed
• Tcc4APE
o More or less deprecated, still ships in source form but complete support is missing
o Same for syswrap.
- Janus