Max inside SuperCollider?

thanks, i have to learn more about member variables.

#ifndef RNBO_USE_FLOAT32
#error "RNBO_USE_FLOAT32 must be defined!"
#endif

thanks, i guess #ifndef means “if not defined”, throw an error. Have to learn more about these # statements.

thanks, is registerUnit a method from"SC_PlugIn.hpp"? I have a hard time to understand why, when setting one of its arguments to true or false it does enable or disable buffer aliasing. Does it look up #define DefineSimpleCantAliasUnit(name) in the SC_InterfaceTable.h?

I’m afraid you need to learn some C++ before writing a C++ extension :wink:

thanks, is registerUnit a method from"SC_PlugIn.hpp"?

Yes. Any decent IDE or code editor will lead you to the declaration/definition.

Does it look up #define DefineSimpleCantAliasUnit(name) in the SC_InterfaceTable.h?

DefineSimpleCantAliasUnit is a macro and registerUnit is the modern alternative. The last argument sets the aliasing flag, hence true instead of false.

I have a hard time to understand why, when setting one of its arguments to true or false it does enable or disable buffer aliasing

Well, it’s simply what this argument is supposed to do. Again, look at the function declarations!

Unfortunately, the plugin API is completely uncommented, but there are some online resources. Will post some later when I’m home.

yeah, thats obvious. Ive already started :slight_smile:

thanks, already started using VSCode.

You have shared DefineSimpleCantAliasUnit inside SC_InterfaceTable.h with me. It was not clear to me how when setting an argument in registerUnit is doing the same thing and where this is defined. But i can accept that for now. EDIT: I have made use of the “Go to Definition” option in VSCode to find registerUnit inside SC_Plugin.hpp thanks for the hint :slight_smile:

EDIT: Also figured out that the member variable for buf is declared in the private category for our RnboSaw class inside the RnboSaw.hpp with a yet unfamliar notation RNBO::SampleValue **buf, but will figure that out :slight_smile:

You have shared DefineSimpleCantAliasUnit inside SC_InterfaceTable.h with me. It was not clear to me how when setting an argument in registerUnit is doing the same thing and where this is defined.

Ah, I didn’t mention registerUnit indeed, sorry for that!

+1

with a yet unfamliar notation RNBO::SampleValue **buf

RNBO:: is a namespace. (Your IDE should direct you to the declaration.) SampleValue is a typedef for the sample type. If you look at the RNBO header, you will notice that it’s an alias for float if RNBO_USE_FLOAT32 defined, otherwise it’s an alias for double.

The SuperCollider book contains a very good chapter about writing ugen plugins but some parts are a bit out of date. I have revamped that chapter for the upcoming second edition but the book hasn’t been published yet… I would still recommend to read that chapter if you can grab a copy of the first edition.

For an introduction to C++ I can recommend this online tutorial: https://cplusplus.com/doc/tutorial/. (At least that’s how I started.) You could also read “A Tour of C++” by Bjarne Stroustrup (the creator of C++), it’s only about 200 pages. Of course, this will only scratch the surface – C++ is a huge language – but SuperCollider plugin development generally does not require advanced C++ skills. For the most part it’s just loops and math :slight_smile:

hey, thanks alot im half through with this journey of 31 hours https://www.youtube.com/watch?v=8jLOx1hD3_o&t=329s and currently reading the c++ primer will check out the other resources you have shared, thanks alot :slight_smile:

Alot of the concepts needed for developing this extention are intermediate / advanced stuff. But will come to these things at some point. Especially the syntactic sugar of C++ is giving me a hard time right now.

I started to merge the rnbosaw example with the attempt from the sc plugins tutorial and the additional ideas you have shared with me in this thread and made some comments. I could publish a github repository if people would be interested in participating, but right now i guess I have to get familiar with the basics before bothering other people.

I was about to recommend it, but then I thought 1000 pages might be a bit heavy for the beginning. But hey, if you’re motivated, go for it :slight_smile: