Cabbage Logo
Back to Cabbage Site

First run goes fine, second run locks cabbage

Other than the whole program not running? This is the instrument that gets called to build the interface. So, yeah, kind of important.

Do any of your other .csd files that use these modules crash? Or is it particular to this .csd? I didn’t have time to run this in my Mac. It’s crashing on my Windows machine straight away, but I think the problem is the same. There is an access violation in Csound. I’m not sure why. When Cabbage tries to delete the Csound object, so it can create a new one, it can’t. Csound is not releasing some memory. There only way to get to the bottom of this is by running a debug version of Csound and stepping through it manually. Leave it with me. I only run a debug build of Csound on Linux, but I will fire up the Linux box during the week and see if I can spot the problem.

Ok, I dug out an old laptop with a fairly recent version of Linux on it and gave this a twirl. I don’t get any crashes but I do get that:

B 0.000 - note deleted. i11 (builder) had 0 init errors

Seems kind of cryptic. It’s kind of a pity I don’t get a crash like on Windows. If I did I could learn more about the issue.

If you look down through the 3000+ lines of Csound output, you’ll see the following somewhere in the middle of it all:

InitError in wrong mode 0
INIT ERROR in instr 11 (opcode makeEnvelope) line 678: requested row is out of range

I’m guessing that’s your problem. Btw, I think it would be a good idea to add a way to silence all that output. It would certainly make it easier to spot the relevant output messages :wink:

Well, I commented out the ‘makeEnvelope’ call and it gets rid of the INIT ERROR in ‘builder’… But there is nothing obvious in my code that would indicate any requested row…

Two steps forward, one step back…

Thanks for your direction, Rory. I don’t think I would have ever made this connection because the code does seem to execute.

Can you try to initialise the filter first, and then set the values? I recall seeing a post on the Csound discord recently about some weirdness with krate arrays.

Rory,

This has been a rollercoaster ride for the past couple of days. I rewrote much of the structure of the program, breaking it into smaller modules, and while I never figured out exactly what was causing the above program, my rewrite isn’t generating that error.

Plus other things that I had been struggling with in that time, and now magically working.

So, thanks again, and I hope to have a demo release for this in the next two weeks.

Mike

I should have also mentioned, the changes I made cut about 10 megs from the size of the memory usage, and it also seems to be quite a bit faster at loading. All in all, good things are coming!

Nice. Rewrites are great that way!