Hello everyone !
I'm happy to introduce nimplug: a pure Nim audio plugin framework for writing VST3, CLAP, AUv2, and standalone plugins. Everything is written in Nim, no C++ required !
Here are the main features:
It is macOS and Windows only for now (tested using clang and MSYS2 UCRT64 environment) but I hope to add Linux support in the future.
Here is a basic headless gain plugin:
import nimplug
import ./pluginconfig
defParams PluginParams:
let bypass* {.name: "Bypass", id: "byps", bypass.}: bool = false
let gain* {.name: "Gain", id: "gain", min: 0.0, max: 1.0.}: float32 = 0.5
type MyPlugin* = ref object of RootObj
params*: PluginParams
proc onCreate*(T: typedesc[MyPlugin], ctx: HostContext): MyPlugin =
new(result)
proc onSetSampleRate*(plugin: MyPlugin, sr: float64, maxBlock: uint32) =
discard
proc onProcess*(
self: MyPlugin,
input: AudioBufferView[float32],
output: var AudioBufferView[float32],
midi: var MidiBuffer,
): ProcessStatus =
let bypass = self.params.bypass.load() > 0.5
let gain = self.params.gain.load()
output.copyFrom(input)
if not bypass:
output.applyGain(gain)
result = psNormal
generatePlugin(MyPlugin, pluginCfg, pluginParamsList)
Some context:
I just validated a bachelor's degree in CS and I would like to get a job in the audio industry. I wanted to learn DSP and audio plugin development and I wanted to try to do it in Nim, but there was no ready made solution out there.
I made several unsuccessful attempts to wrap C++ audio frameworks in Nim. I tried to update the june wrapper to Nim 2.X, rewrote it from scratch, tried to wrap DPF (let me know if someone would be interested in this). Each time I faced issues regarding C++ interop requiring some part of the user plugin to still be written in C++, defeating the whole purpose. Then I found CPLUG (a C wrapper for VST3, AUv2, CLAP audio plugin formats) and thought that maybe I could write something myself with it, so I did. Fast forward a few months and I ended up with a relatively feature rich library. This has been a good project to learn the internals of an audio plugin framework to experiment with various new tools and libraries.
I used LLMs extensively to write this project as I don't have the expertise to tackle something of this scale, but I did not "vibe coded" it. I read every line of code (except maybe some tests), but there are parts that are outside my competences right now (especially the DSP, windowing modules, drivers and cross thread communication), so I cannot attest its correctness. While I tried to make it architecturally sound, as stated I have little to no prior experience in this and there may be bad practices, poorly optimized and/or plainly wrong code in it. I want to be transparent about this. It is still very experimental.
I made this for myself but I hope that this project can gather some traction so that more experienced Nim and/or audio developers can help me improve it and make it viable, or if it is really bad that I can get some insights to start anew with a better foundation.
Finally I would like to special thanks Tremus for creating CPLUG and all the developers and contributors of the libraries used in nimplug. Without this strong ecosystem I wouldn't have tried to create nimplug to begin with.


Seems curious!
Is your link supposed to reference back to this post instead of a repo?