Getting Started with development

Here’s the issue this should probably be MyModule

Model* MyPlugin = createModel<MyModule, MyModuleWidget>("MyModule");

I just now saw this, i changed it to MyPlugin to get the naming all the same, like i changed it in the header.cpp, plugin.cpp and right there too.

lemme try this all again hold on :neutral_face:

Model* MyModule = createModel<MyModule, MyModuleWidget>("MyModule")

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”

in plugin.json “slug”: “MyModule”,

1 Like

I’m gonna come back to this just gimme a couple days to redo everything to understand it better i kinda rushed through the tutorial a bit too fast.

I’m also gonna refresh on c++ so I know what I’m really doing I’ve seen this stuff before I just forgot a lot of it.

thank you for the help it’s greatly appreciated!

1 Like

Finally got it working!!! :smiley: :smiley:

14%20PM

9 Likes

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.

Here’s a really good C++ YouTube series by an EA dev that will probably make your head explode if watched consecutively.

Must get back to that series myself only watched about 1/4 of it!

3 Likes

thank you!!! I’ll for sure start watching these!

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.

1 Like

I was just about to ask, thanks allot!

Hi @Spiderman2001 I’m just adding a few cross-reference stuff from this VCV Community Board, as it is in itself a repository full of specific advice and useful learning tips.

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!

4 Likes

Thank You for all of this!!! :smiley:

1 Like

Probably not what you need first of all, but this paper on writing efficient plugins may help avoid some common mistakes. Of file it away and come back later. https://github.com/squinkylabs/SquinkyVCV/blob/master/docs/efficient-plugins.md

4 Likes

+1 for that series. I’d not done any serious programming for over 20 years, and then it was mainly pure C - those vids have got me back up to speed and demystified some of the C++ syntax. I did watch about 1/3 of them back to back, and yes my head did nearly explode! I’m still finding I’m dipping back in to them for little refreshers now and then. Best of all they’re not delivered so slowly you’re shouting at the screen to “just get on with it”

1 Like

That’s the thing with them. They’re fast paced but not information overload fairly well done!

Regarding rack development - today I learned:

  • struct is used in rack for saving the “public:” line because in contrary to classes it is public by default.
  • outside of vcv coders often prefer using classes when methods are called and structs only if you’re just calling a set of data types.

Not sure if the last point is expressed correctly for reason of language barrier. Yet I am happy, that vcv rack puts me getting back into programming again (: Are there more reasons to use struct instead of class in vcv rack?

Sound correct to me. VCV’s use of struct is not something I’ve seen that often, but it isn’t difficult to get used to. And it’s for sure very versatile to have everything public so that a module can do anything it wants to.

In C++,

struct {

is syntactically equivalent to

class {
    public:

In C++, there are three common ways to encapsulate class members.

  • public/private labels: If you’re going to have private members, it shouldn’t be part of the ABI. However, a private member is still part of the ABI. This makes this C++ feature completely pointless.
  • “weak encapsulation”: simply documenting that certain symbols should not be used by certain callers.
  • “opaque pointers”: e.g. struct Internal; Internal* internal. This makes private members not part of the plugin ABI.

VCV uses the latter two methods.

2 Likes

Private members are supposed to be objects anyway, no? object obj = new object;

Huh? A C++ member is either a data member (aka class variable), member function (aka method), etc. See https://en.cppreference.com/w/cpp/language/class under “Member specification” for the full list.