Voxglitch Community Feedback

:wink:

image

2 Likes

valgrind will find those pretty quickly, as we discovered a while back, right?

2 Likes

Yep. I myself have not used Valgrind, but I do remember that you saw a good bit of evidence of uninitialized variables in a variety of modules when we were chasing down my Rack crash. I did revise Meander at that time to initialize all (hopefully) Meander variables, but it turned out the crash was not related to Meander anyway, but still a worthwhile effort, I believe.

2 Likes

@Squinky Would you have time to give us really quick instructions on how to use valgrind with VCV Rack? I watched a tutorial on valgrind here, but I’m not sure how to adapt it for compiling VCV Rack. My knowledge stops at “make install”. I really don’t know anything deeper, such as which compiler is being used, or how to apply valgrind to the compilation process.

Any direction would be much appreciated. :man_bowing:

1 Like

yeah, as far as I remember you just run it. But it only runs in linux (or at least not windows, don’t know about mac).

The makefile for rack itself has valgrind as a target. So I have a feeling you just run make valgrind and it goes. But you can see that all it’s doing is running valgrind with rack:

valgrind: $(TARGET)
	# --gen-suppressions=yes
	# --leak-check=full
	valgrind --suppressions=valgrind.supp ./$< -d     

So I think you don’t need to make a special build, you just run it.

I’ve used address sanitizer more often, and that does require a special build. I find with valgrind everything runs so slow I can’t really use rack, but that’s ok to find these uninitialized memory things.

I also run most of my code in a unit test framework of my own hacking, and that uses the microsoft compiler, which makes it trivial to run address sanitizer on windows, but in general to run in normally you need Linux

1 Like

I was in the same boat as you with finding unitiallized variables under Windows. But, I was able to sanitize my own code by making sure I explicitly initialized everything I could. In my opinion, there are some real differences in how C and C++ handle initialization and perhaps differences in compilers and OS. I try to use static variables where possible, as they are more consistently initialized implicitly. I do most of my iniitializations in my declarations and some explicitly upon instantiation.

I’m not an elegant programmer and I probably have some bad habits, so take this with a grain of salt.

Since Meander is so complex and heavy on array indexing, I try to do a clamp() on all array indices before using them to access the array. Or at least for the mostly heavily used and/or dynamic arrays.

@k-chaffin I also use clamp() on my array indexes and initialize all my variables. Well, in theory. Maybe I missed some! I’ll walk through the code line-by-line and see if I can spot anything.

1 Like

Always initialize everything. And it’s super easy in c++. I’ll use struct here, even thought I use class in my code:

struct foo {
    int bar = 0;
};

With that syntax, the member variable bar will be initialized to zero when foo is constructed. Works in any modern-ish version of c++. Certainly every version that VCV has supported. Initializing arrays isn’t as easy, but it is possible.

1 Like

My next module is going to be… :drum:

2 Likes

Can’t wait! Us technoheads have been in dire need of new unique percussion modules. There’s only so many generic “bass drum snare drum hi hat” modules we can stand, can’t wait to see what you come up with.

2 Likes

I’ve fallen in love with Digital Programmer. It really makes sequencing a patch so easy. I also use it to store different “presets” on modules, which I can switch to on the fly. Thank you so much.

Oh, a nice :drum: module?!? At last!

:crazy_face: :tada:

Ever thought of a live patching video with Digital Programmer?

I’m familiar with the features (more or less) but I just can’t see how to fit it into my work flow. It’d be interesting to see how people are using it. I kind of like those @Omri_Cohen style videos seeing him working for 2 hours to get a nice tune.

1 Like

Coming soon (well not live patching, but a couple of tunes), and it will be nowhere near the quality of an @Omri_Cohen video :grinning:

2 Likes

One nice example is patching the polyphonic output into the mutes input on mindmeld mixers. You can then plan out when what is muted and in what order. You can either use a slow clock to switch between the stored programs, or do it manually (I use a trigger buffer to make sure it switches on the beat, but I do wish it had a built in trigger buffer.)

BTW why is that Digital Programmer output named poly audio out?

image

Sorry, but not a drum module! That was a “drum roll please!” emoji! :grinning:

The next module is going to be … my take on the Vestax Faderboard - Rare - Korg Electribe engine | Reverb. See also: https://www.youtube.com/watch?v=E1Kr0EJwZ-c

I haven’t started planning it, but it’s totally my type of thing!

5 Likes

That was a mistake by the graphic designer which I haven’t fixed yet. Thanks for reminding me!

This has been fixed and will roll out with the next update. :pray:

2 Likes