I’m new here, I am a student who’s taken a fair amount of programming and Computer Science courses, I wanna make a simple oscillator plugin but I’ve never taken on a large C++ project before, I understand the basics of algorithms and programming in general and I wanna get into the DSP stuff but the math looks very daunting (I passed Calculus, I wasn’t the best at it though). Where do you recommend I start?
I wanna start as basic as can be and I’m also fairly new to github so while i see a lot of open source stuff flying around I don’t know how I would use such things in my project and I apologize for being very new to github, I have one but all I’ve really made is a GUI Weather App in Python that takes JSON data from an API, so building a rack plugin is very new territory for me but I’m very eager to learn I just feel a bit overwhelmed. I love using VCV rack to make music.
While calculus is required for most topics in DSP, DSP is not required to make Rack modules, especially those operating at CV-rates. Sequencers, clocks, CV processors, etc don’t need any DSP knowledge.
I started out making modules 2 months ago knowing very little about c++ (just toying around with C many years ago) and very little Github experience (only used git for solo projects without the hub part) and I found it much less scary to start by reimplementing something that exists in a new form factor, a split & merge module, a project too simple to screw up, but still providing some value to the community (plus I later added a unique feature to it). It might be best not to start on something operating on audio rates to make it easier to diagnose weird behavior.
Whatever branch of mathematics it might be, in my experience there’s a huge difference between math taught by a teacher in the context of a classroom and textbook and “it will be on the exam” kinda setting, and math that has clear practical applications for something I care about, and where using a library that gets the math right in my stead is not cheating but a smart move instead. If you want to do DSP, it will probably prove easier to learn the math than if you were just required to learn it because some nerd decided it goes on an exam.
Well, I’m pretty good at DSP, and I’m good at math (for a programmer). And by that I mean I remember most everything I learned up through the easy part of calculus. While that puts me light years ahead of my co-workers, it’s obviously not too impressive.
I would ventures to say that most people doing DSP in music products don’t know “all the math”. There is a ton you can do with varying levels of understanding. You can just copy articles from the internet to do most basic DSP chores. A little reading and you can understand sampling, aliasing, etc… A little experimenting and you will learn waht you can get a way with in terms of numeric approximations, etc…
As far as git and open source, a good intro is VCV Rack. Go get (git?) the source from github and build it. The instructions are decent. Then go get some third party plugins and build them, etc… It’s all easy, just a lot of details that are overwhelming at first but will become second nature quickly.
I’m relatively new here but wanted to offer you some encouragement. VCV rack may feel overwhelming at first, but many modules are just a few simple pages of C++. All of the advice given so far is great.
Here’s a few things that I would recommend:
Get your development environment up and running by following the tutorial that Andrew linked to. The most difficult part for me was getting the environment set up properly. On Windows, this part is especially important: “launch the MinGW 64-bit shell from the Start menu, not the default MSYS shell”
When I first tried building my first module, I somehow overlooked the fact that I needed to update plugin.cpp and plugin.hpp to include my new module. You’ll also need to add your module to plugin.json
Compiling a module is super simple. The framework has done all the heavy lifting for you. You just type “make install” and everything happens like magic. You don’t have to worry about compiler or linker stuff.
As the others have said, Math may be useful depending on the type of module you’re building. My math skills are horrible.
There’s minimal documentation written in a friendly, nurturing way. There are class references and such, but I’ve found that the best way to learn is to start small and look at other people’s code. It only takes a few days to start to understand the basics. After a few weeks, you’ll know enough that the possibilities seem endless.
Here’s a super simple outline on how to create a module:
Create a .cpp file for the module, like my_module.cpp. Put all your module code in there.
Create a front panel for your module using Inkscape
Add your module to plugin.cpp, plugin.hpp, and plugin.json
“make install” your module
Test your module in VCV Rack
When I first started, I copied someone else’s code and stripped everything but the function definitions, includes, and other framework stuff.
Model* (memory pointer to Model named MyModule)
this is assigned (=) to a method/function called (createModel()) which inherites data from structs called MyModule and MyModuleWidget what is being passed to this method/function is the slug called “MyModule”
that’s really interesting, I’ve always kinda seen science and math as something that I’ve struggled with just because it forces me to problems solve and while it can be frustrating at times at least math follows a clear set of rules and theirs no room for ambiguity it seems. Hopefully I can start viewing math differently and have more fun with it using programming as a medium and actually make things.
I’ve just been super busy with work and making music in vcv allows me to get lost and forget about all that stuff for a bit and just create, i’m stilly trying to get a good workflow down instead of having to pick over the thousands of modules every time i make something.
how did you go about learning C++, i mostly use Udemy to learn all kinds of programming stuff to help me and I have a bunch of books but I can be a slow reader sometimes.
Brute-forcing it, trying things until it works, transferring experience from other languages, plus a friend on speed dial to point me in the right direction when I have no clue what I want to search. I’ll probably consolidate with some book later, but for me nothing beats getting hands-on experience ASAP.
I generally consider video tutorials as a last resort, they are never respectful of my time, and C++ is so widely documented they’re never the only option.
VCV Rack itself and the overall galaxy of its open-source plugins is possibly one of the best source of inspiration and knowledge base for a hungry coder.
Have fun with it, and with your coding journey!