Hi everyone,
I’d like to introduce to you libdaisy_nim, a Nim wrapper for libDaisy ! I’ve wanted to use Nim in embedded audio for a while now and thanks to copilot cli I’ve been able to write a wrapper for libDaisy to use it with.
For those who don’t know Nim “Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula.” I think it’s a really cool language to try and tinker with and since it can compile to C++ I thought it would be relatively easy to try to wrap libDaisy with.
It’s still in it’s early days and while it’s far from complete I think I the global architecture of the wrapper is sufficiently stable to share it with people now. I desperately need some help to try and fix the examples since I don’t have enough parts to try and fix some examples. As of right now, I’ve only tested the blink, button_led, i2c_scanner, audio_passthrough, basic_sine_generator and distortion_effect exemples. There’s a technical document explaining how the wrapper works in detail for those who are curious. The wrapper is heap free and has almost no overhead as most of the basic functions are inline so you get the advantages of Nim basically for free ! Feel free to contribute and/or correct me as it is my first project in Nim and my first open source project on top of that !
Welcome to the forum, @Brokezawa!
That’s awesome!! Thank you so much for sharing this new Nim wrapper with the community ![]()
Please feel to keep us updated!
Hello everyone !
I’ve reworked my Nim wrapper for libDaisy and I think it is now mostly feature complete (90% percent coverage of libDaisy and 95% for the user-facing features) with full board support, comprehensive documentation and full DocGen, automated setup and build using Nim’s default package manager ! It also provides some new niceties, like a small DSL for menu creation compatible with libDaisy UI modules.
I’ve changed the name to Nimphea (stylized from the French Nymphéa, which means white water lily) and started a new repo.
I’ve tried to make it as robust as possible by following libDaisy’s method of testing, so it now includes unit tests for the pure Nim modules that don’t depend on hardware and there is a comprehensive test table for the example. I don’t have hardware on hand, so what would be really helpful is if you could help with testing the examples to attest its robustness for real world applications ! Since it’s a wrapper and Nim has direct C++ interop it shouldn’t introduce too many bugs apart from libDaisy’s one, but I’ve been using agents to wrap libDaisy so some bugs might have slipped through.
I hope you find it some use cases as I really think Nim has some strong arguments for embedded and audio applications. Happy coding everyone !
Hey everyone, Nimphea v1.1.0 is out !
The repo has been restructured into a proper nimble
package (with post-install hooks to automatically build libDaisy, FatFs LFN and CMSIS-DSP), examples moved for external hosting, and new Basic/Audio project templates to get started quickly. The release adds:
- full CMSIS‑DSP support (comprehensive wrappers and modules such as dsp_basic,
dsp_filtering, dsp_transforms, dsp_statistics, dsp_fastmath, dsp_matrix, dsp_complex, and
more) - automated build support and memory-safety fixes (custom =copy/=sink for CMSIS
types) - handwritten GitHub Pages docs cover installation and getting started.
I didn’t had hardware on hand while developing it so it may be a bit rough around the edges but I just got my Daisy Seed back with some components to test in real conditions so it should become more stable in the coming weeks.
Contributions are welcomed ![]()