A big turning point for me was being able to jump into some of these codebases. It is more about pyschology than understanding, IMO. Being able to say “fuck it, lets jump in and try and see how this works” is a very useful mindset to have at any level. It also is helpful to look read random bits of code, as it helps you learn to skim code to get the gist of things. The more you do it, the more confidence you will get in jumping in.
If you aren’t sure if you are ready or not to jump into things, you are ready. Just download some code, open a file, and start going line by line to see what you can understand. 90% comprehension? Great. 10%? Great! Nothing at all? Also great. There is something to be said about just the physical act of moving eyeballs across code.
I have looked at the source code for the projects listed above at varying degrees. For those interested in doing some code spelunking, here are my thoughts on them below. If any one wants to contribute their own person thoughts and experiences, feel free:
STK:
I have spent minimal time looking at this code, but it seems fairly readable. The core codebase is very small, and written in a style of C++ which I call “C+”. Code basically reads like C with classes.
Csound:
I have spent a considerable amount of time examining the source code to Csound, and adapting some of the algorithms for soundpipe. There is a treasure trove of great DSP algorithms there, but it definitely took me a while to get used to reading. It has a range of coding styles. A lot of the older code can be cryptic to read, and the style should not be emulated. If you get the Audio Programming Book, I recommend reading John ffitches chapter on Opcode design (this is what I did to learn). His tutorial has code samples that boil away some of the weird bits of the production code that you don’t really need to understand. Opcodes can be in a variety of places, depending on what decade they were made. I would recommend grepping for the opcode in quoates to find the dictionary entry in the code, then finding the compute code that way.
SuperCollider:
I actually know the least about this one. I’ve had some SC friends of mine tell me that SC did a major refactoring effort a while back. Looking at the code, I certainly believe it. It is written in what looks to me like clean enough C++ code (I do not really know C++ code, so I can’t really speak much on this). C++ is one of those languages that keeps evolving, so I have no idea of it is “modern C++” or not. Like Csound, SC has a rich ecosystem of good DSP algorithms. C++ has a tendency for code to be more coupled together, so my biased opinion is that it is could be harder to extract DSP code from SC than from Csound? But what do I know here.
PD:
I am only a casual PD user, mostly using it as a prototying environment. I managed to learn enough PD guts to get a fork of PD vanilla embedded as a sort of PD file player without the use of the libpd. I have also managed to implement some undocumented features in some of my custom PD objects by looking at standard PD object code.
Look at PD vanilla source code, if you are going to look at PD. It is actually a pretty small codebase, so you could definitely digest a sizeable chunk of it if you wanted to. Many people will tell you that PD source code is hard to read, but honestly it is not too bad if you are just interested in looking at external code. There is a lot of similar-looking code you can use as a rosetta tablet. Similar to Csound, PD has a lot of old-school looking code and design choices. Both Csound and PD were written for very different kinds of computers that we use today! So just take in things with a grain of salt.