Yeah, I’ve just gotten a bit into classes (being a forever noob at programming).
If you read the class/OOP part on the official lua page, you’ll find that a class is pretty much a template table with one of the elements being a constructor function. This constructor is used when creating copies/objects of this table/class. The constructor function and what setmetatable can do is pretty much what you need to understand to set up simple classes. But… one thing worth mentioning is that Renoise provides (via luabind?) an ‘enhanced’ way of dealing with classes that seems to be a bit more convenient.
Danoise has explained some of it to me in this thread recently: https://forum.renoise.com/t/creating-a-class-beginner-question/46235 It might help you get in the ballpark.
EDIT: Imo the xStream might benefit from an even more standardized and modular framework. I’ve been thinking about the possibility of a “Pulse/Oscillator” class for setting up various hit patterns, instead of coding intricate if statements with arithmetics in each and every model.