Promoting my own tools here, but I highly recommend checking out Soundpipe. I initially wrote it because as a musician, I wanted a very portable lightweight DSP library for making music, that would also be fun to hack on. The library written completely in C, with absolutely no C++ ever. It’s also designed to be fairly decentralized, as far as C libraries go. It’s fairly trivial to extract specific modules from the library rather than use the whole thing. Most of the modules are adopted from Csound opcodes, so the underlying algorithms are pretty legit. Musically, it’s comprehensive enough now that I’ve been able to use Soundpipe (and other tools I write) in place of Csound for my needs. It’s also used quite a fair bit in audio framework AudioKit. IIRC, the sound architecture of Synth One, an open source iPad synthesizer, is actually designed using Soundpipe.
It’s great to write simple filters, oscillators, and delay lines in C to get a low level sense of how things work. Anything more complex, and I switch to the FAUST language, which can generate highly optimized C/C++ code. It is much easier to learn and understand the underlying DSP in a functional language like FAUST. I’ve never had much luck groking much DSP staring at DSP C code.
I found composing music in pure C + Soundpipe to be a fairly slow and frustrating task, so I wrote a silly little language on top of Soundpipe called Sporth. In the context of what is already out there, it’s a minimal language. The core Sporth engine and parser is about 2k lines of code. The rest of the codebase are mostly just boilerplate code for the unit generators.
My personal take on writing your own music software:
Writing your own music tools is slow work. The problem I always run into is that I spend more time debugging my code and adding features than actually writing music. Still working out the balance to that. That being said, I still very much encourage it! There is still much to be explored in the intersection of computation, music, and creative expression. With pre-made music software, many creative decisions have been made for you before you even begin creating. When you write your own software, you call the shots every step of the way for how things should look, feel, behave, and sound. You make enough of these decisions, and pretty soon you’ll have something very special and unique. This has at least been my experience. I’m not a great composer by any stretch of the imagination, but I’ve certainly become a better one because of my experience writing tools like Soundpipe and Sporth.