Reading other people's code helps a lot! Browse Github topics like "synth", "synthesizer", you can also narrow it down by language (C, C++, D, Rust, and Go are all fairly easy to translate between one another). I haven't looked at any of the theory stuff, which would've probably helped too.
I kind-of abandoned the project before I could figure out what went wrong when rewriting it to keep track of the phase. I understand what needs to be done, I just have a stupid bug somewhere down there and it kinda demotivated me.