Peaks clone ?

yep - this is where went wrong just automatically clicked update; working now :yum:

Screenshot 2022-04-21 at 12.20.49

Been there done that, occasionally intentionally :wink:

I don’t have GDB set up yet, I’ll look into it today. The first log I posted was the built version with -d.

I’ll build this and test it when I get to it today!

Yeah, I get mixed up with the rules to initialize c arrays. the actual original memset looks ok, but ?? I did try a few versions of {} using the microsoft compiler for windows. Seems it doesn’t do what we want it to?

static void testx() {
    int x[5] = { 123 };
    int y[5]{ 234 };
    std::vector<int> z(5, {567});
    for (int i = 0; i < 5; ++i) {
        printf("x[%d] = %d y=%d z= %d\n", i, x[i], y[i], z[i]);
    }
    fflush(stdout);
}
output: 
x[0] = 123 y=234 z= 567
x[1] = 0 y=0 z= 567
x[2] = 0 y=0 z= 567
x[3] = 0 y=0 z= 567
x[4] = 0 y=0 z= 567

No you were right to remove this code as processors isn’t a trivial type. So the line peaks::Processors processors[2] = {}; is correct.

I edited my crash log post as I initially thought it was a problem with the firmware; in reading the log I assumed (wrongly) that a large value was being passed by the module to the firmware. This is not the case. The problem is in the eurorack/peaks/modulations/multistage_envelope.cc file the trace is pointing to. This is due to the shape_ variable not being initialized in the void MultistageEnvelope::Init() method.

The line pointed to in the crash is

which uses shape_ as an index for lookup_table_table

LUT_ENV_LINEAR is defined in eurorack/peaks/resources.h

segment_ and phase_ are initialized in void MultistageEnvelope::Init()

The fix I have used is to add this code to the end of void MultistageEnvelope::Init() in peaks/modulations/multistage_envelope.cc

for (uint8_t i = 0; i < 8; i++) {
    shape_[i] = {};
}

Any builders feel free to try the firmware code fix and let us know how you get on. :slight_smile:

Nice! great analysis! On a trivial point, don’t you think my test, above, shows that initializing an array with {} doesn’t work (with the current microsoft compiler)? Of course always possible I made a mistake.

btw, it’s super easy to run your stuff under Valgrind, which will flag all sorts of uninitialized variable. You don’t need a special build or anything, just valgrind ./Rack

1 Like

I see what you’re trying to show with that code, I don’t get why suddenly the x and y arrays seem to have been “zeroized”. It’s been a few years since I’ve used MS compilers, always found them to be a bit wobbly, for want of a better term.

That fixes it for me, nice work all.

It appears VCV Audible instruments uses a fork of the Mutable code anyway, so I’ve opened a PR (slightly different but same net effect):

1 Like

Ah yes, I’ve done it at the .cc level, whereas it can be also be done at the header level. Nice one Ewan!

On a side note this should also be done with Braids to remove the warnings there:

And remove the memset lines here:

@Steve_Russell - while I don’t want to put words in Andrew’s mouth, I think generally he prefers changesets for PRs to be compartmentalised (already I’ve done a seperate PR for the Elements bugfix). I understand why, as we don’t want to introduce any side-effects, especially for such a popular module. I’m not 100% though, so say if you think it’s really worth doing. Maybe a follow-up “cleanup” PR for the other modules is another option?

Are there any other issues/experiences with Peaks for people to report?

Yes, that is what I meant. It’s not a big thing atm; it’s seems only to manifest as a potential problem mainly on Windows as we saw with Peaks. Although to add to that, I’ve never had a crash due to Braids so as I said not a priority.

1 Like

I tried downloading it today, but Peaks is not showing up for me either. I am running rack 2.1.0 on windows 10 and have not updated the audible instruments plugin. Let me know if you need any more info

Did you download the appropriate .vcvplugin file for your OS, put it in Rack/plugins, delete the original AudibleInstruments folder, and restart Rack?

try going to the AudibleInstruments plugin page in the library and clicking “subscribe” to add the entire plugin to your collection. Peaks will show up then.

No it won’t as Peaks hasn’t been released to the library yet. One has to download a test release from here: Release Development Build · hemmer/AudibleInstruments · GitHub

i mean after copying the beta build into your plugins folder, you may need to subscribe to the plugin on the library page in order for Peaks to appear. that’s what happened when i added the beta build to my folder. Peaks didn’t show up, so i subscribed to the plugin, and then it showed up.

1 Like

You don’t need to subscribe to a plugin to get any of the modules to show up in the browser, I add dev builds all the time and the modules always show up.

So unless you restarted Rack more than once, your post doesn’t make sense.

1 Like

well i don’t know what to tell you. Rack wasn’t running, i added the beta plugin to my plugins folder, i loaded Rack, and Peaks didn’t show up in my library. as i’ve done before with other dev builds, i went to the corresponding plugin’s library page and subscribed to the plugin, then restarted Rack, and Peaks showed up. i’m not claiming to know why this is the case, only stating that it is the case. ¯\_(●_●)_/¯