Audio Programming Environment 0.5.0: C++ DSP directly in your DAW!
DSP, Plugin and Host development discussion.
Moderator: KVR Moderators (Main)
Audio Programming Environment 0.5.0: C++ DSP directly in your DAW!
2021-02-09T18:13:24+00:00
Hey guys.
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)
Videos
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
• 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.
Check it out, hopefully it can be useful or provide some fun!
- Janus
Mayae
https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=295503
viewtopic.php?p=6368374#p6368374
-
- KVRian
- 1194 posts since 28 May, 2010 from Finland
Post by soundmodel »
I was thinking about this today again, but this time I thought:
Is this really under GPL v3? So it cannot be used to deploy closed source code (with linking exception)?
With GPL v3 license I would only think it being useful for prototyping, but not deployment.
Is this really under GPL v3? So it cannot be used to deploy closed source code (with linking exception)?
With GPL v3 license I would only think it being useful for prototyping, but not deployment.
- Beware the Quoth
- 35428 posts since 4 Sep, 2001 from R'lyeh Oceanic Amusement Park and Funfair
Post by whyterabbyt »
This time, same as the last time....soundmodel wrote: Fri May 16, 2025 3:16 pm I was thinking about this today again, but this time I thought:
viewtopic.php?p=6368374#p6368374
An idiot on Set Theory:
"In some cases there is an object called red that contains everything that is red. In much the same way a pot is a plate."
"In some cases there is an object called red that contains everything that is red. In much the same way a pot is a plate."
Return to “DSP and Plugin Development”
Jump to
- The Main Forums
- ↳ KVR Studio Manager
- ↳ Getting Started (AKA What is the best...?)
- ↳ Instruments
- ↳ Effects
- ↳ Hosts & Applications (Sequencers, DAWs, Audio Editors, etc.)
- ↳ Guitars
- ↳ Mobile Apps and Hardware
- ↳ Soundware
- ↳ Samplers, Sampling & Sample Libraries
- ↳ Hardware (Instruments and Effects)
- ↳ Modular Synthesis
- ↳ Sound Design
- ↳ Production Techniques
- ↳ Music Theory
- ↳ Computer Setup and System Configuration
- ↳ DSP and Plugin Development
- ↳ DIY: Build it and they will come
- ↳ Music Cafe
- ↳ Sell & Buy (+Special Offers, Deals & Promos)
- ↳ KVR Experts
- ↳ KVR Developer Challenge 2023
- ↳ Everything Else (Music related)
- ↳ Off Topic
- ↳ Off Topic Classics
- ↳ Machine Learning and AI for Music Creation
- Official Company Forums
- ↳ 2getheraudio
- ↳ accSone
- ↳ Acon Digital
- ↳ AcousticsampleS
- ↳ AcousModules
- ↳ Agitated State
- ↳ AIR Music Technology
- ↳ AMG
- ↳ Ample Sound
- ↳ Antares Audio Technologies
- ↳ Apisonic Labs
- ↳ APU Software
- ↳ apulSoft
- ↳ AriesCode
- ↳ Arts Acoustic
- ↳ Arturia
- ↳ Audjoo
- ↳ AudioSpillage
- ↳ Audiority
- ↳ Best Service
- ↳ Big Tick
- ↳ Bitwig
- ↳ Controller Scripting
- ↳ Blue Cat Audio
- ↳ Cherry Audio
- ↳ CWITEC
- ↳ Embertone
- ↳ energyXT
- ↳ Eventide
- ↳ Expert Sleepers
- ↳ forward audio
- ↳ Future Audio Workshop
- ↳ FXpansion
- ↳ g200kg
- ↳ Harrison Mixbus
- ↳ HG Fortune
- ↳ Homegrown Sounds
- ↳ HoRNet Plugins
- ↳ Ilya Efimov Production
- ↳ Image Line
- ↳ Impact Soundworks
- ↳ Indiginus
- ↳ Insert Piz Here
- ↳ Ju-X
- ↳ Kirk Hunter Studios
- ↳ Kirnu
- ↳ Kong Audio
- ↳ Krotos
- ↳ Kuassa
- ↳ KV331 Audio
- ↳ LennarDigital
- ↳ Les Productions Zvon
- ↳ Liqube Audio
- ↳ Loomer
- ↳ LVC-Audio
- ↳ Maizesoft
- ↳ Manytone Music
- ↳ Media Overkill (MOK)
- ↳ MeldaProduction
- ↳ Mellowmuse
- ↳ MIDIMood
- ↳ moForte
- ↳ Mozaic Beats
- ↳ mucoder
- ↳ MusicDevelopments
- ↳ Tips & Tricks
- ↳ MusicLab
- ↳ MuTools
- ↳ New Sonic Arts
- ↳ NUSofting
- ↳ Oli Larkin Plugins
- ↳ Orange Tree Samples
- ↳ patchpool
- ↳ Photosounder
- ↳ PlugInGuru
- ↳ Polyverse Music
- ↳ Precisionsound
- ↳ Premier Sound Factory
- ↳ Psychic Modulation
- ↳ Realitone
- ↳ Resonance-Sound
- ↳ Reveal Sound
- ↳ Roger Linn Design
- ↳ rs-met
- ↳ S3A: Spatial Audio
- ↳ SaschArt
- ↳ Smart Electronix
- ↳ sonible
- ↳ SonicBirth
- ↳ Sonic Reality / eSoundz.com
- ↳ Soundiron
- ↳ SPC Plugins
- ↳ Sugar Bytes
- ↳ TAL Software
- ↳ Tokyo Dawn Labs
- ↳ Tracktion
- ↳ Tweakbench
- ↳ u-he
- ↳ u-he Linux support
- ↳ UJAM
- ↳ United Plugins
- ↳ VAZ Synths
- ↳ Virharmonic
- ↳ xoxos
- ↳ XSRDO - SynthCraft
- ↳ ZynAddSubFX
- Site Stuff
- ↳ Site Stuff
- Archived Forums
- ↳ AlgoMusic
- ↳ easytoolz
- ↳ Elevayta
- ↳ Hollow Sun
- ↳ LinPlug
- ↳ Muse Research and Development
- ↳ Shuriken
- ↳ SoHa Sound Design
- ↳ Soniccouture
- ↳ Topten Software
- ↳ Valhalla DSP
- ↳ CK Modules & VST
- ↳ Sennheiser AMBEO
- ↳ Muon Software
- ↳ Westgatesounds.net
- ↳ Squaredheads
- ↳ Sonigen
- ↳ CFA-Sound
- ↳ Back In Time Records
- ↳ Livelab.dk
- ↳ Skytopia
- ↳ audioD3CK
- ↳ Inspire Audio
- ↳ Krakli
- ↳ Drumdrops
- ↳ Futucraft
- ↳ OverTone DSP
- ↳ RaXnTraX
- ↳ solar3d-software
- ↳ Signaldust
- ↳ Soundemote
- ↳ ReleaseLab (Powered by Artist Expansion)
- ↳ Wolfgang Palm
- KVR Forum index
- All times are UTC
- Delete cookies
