Upcoming Tonecarver module: tcArpGen (in Beta)

hmm … I downloaded the demo patch you posted earlier in the thread (built with previous tcArpGen version) and it came up fine for me with the current tcArpGen version. No issues other than the rules file not being loaded because the path to our user folders are different

Are you able to create/save/restore new patches with the updated tcArpgen?

The quick answer is “apparently, yes”. I created one with Meander providing the Poly Ext Scale, and tcArpGen is picking up the scale fine. I don’t have tcArpGen generating an arp, etc. as I have not set everything up with polyphonic v/oct and gate from Meander. I will do that, but I am going to create some revisions from this patch so that if it crashes, I have a good restore point to go back to.

I’m not sure of your level of experience developing for VCV Rack, so please forgive me if you know all of this.

For Meander, I learned the hard way how necessary it it to code pre-emptively so that compatability issue crashes are not introduced as new features are added (and sometimes removed).

My key points are:

  1. Always initialize all variables so that crashes will not happen on uninitialized variable usage.
  2. in json todata and fromdata, make sure to handle missing tags gracefully. Check for null pointers before use.
  3. Be very careful in adding and deleting parameter and port ID’s
1 Like

in my iterative test patch, Rack crashes as soon as I connect a v/oct or Gate cable to tcArpGen V/OCT or Gate Poly In, regardless of where the cable is coming from. Have you changed the port IDs on either of these. perhaps? This happens regardless of which mode the poly scale input is in.

I took Meander out of the patch, just in case, but results are the same.

This reminds me of when you were testing my ill-fated modules. crashes and crashes :wink:

No, those port IDs have not changed. The only change related to ports and port IDs is the addition of the Note Order port that was added to the end of the inputs array so as not o disturb the other port numbers.

Curious to know if starting up a new project with only tcArpGen loaded (or very few modules loaded) and then connecting tcArpgen outputs to tcArpgen inputs shows the same crashing. If that works does it still crash when connecting the outputs from some other module to tcArpgen inputs?

I created a bare-bones patch with tcArpGen. When output is connected to input, the crash happens. Nothing is noted in the log. I created a bare-bare-bones patch and it crashes when output connected to input.

1 Like

Wow, okay, very strange. Thank you. I have some digging to do.

The previous version is here if you want to roll back: Tonecarver-2.0.3-win-x64.vcvplugin (beta-0 version)

1 Like

The only time I experienced a crash with cable attachments in Meander was when I changed up my code to detect cable attachments and detachments. Turns out I was accessing something associated with the cable before it was in the logical connected (or complete?) state. That was a CableWidget->isComplete() success before doing anything else on the cable.

Yes, similar. There is the possibility that those crashes were related to that well known and reputable sequencer that could crash when sequenced backwards and was an out of range or uninitialized array index issue.

Thanks. I may do that if you don’t find the cause of the crashes I am experiencing.

I was able to reproduce the crash here a few times using a solo tcArpGen with its output connected to its input. It does not happen every time though so this feels like an uninitialized variable or stray pointer type of problem or possibly the port not fully ready race condition you mentioned.

1 Like

Found an uninitialized variable that was being used to index an array. Here are updated builds: (Thanks to @pgatt for the Mac build!)

1 Like

Address sanitizer will find those kinds of things.

1 Like

Good job. That fix got rid of my crash, so far. Thanks.

1 Like

It works OK on my iMac

… at least it isn’t crashing, but I’m getting nothing through it - no sound out on that channel;

I’m back to working with my existing tcArpGen patches, which now load and do not crash, but, it appears to me that there is a problem in the tcArpGen implementation of “Poly Ext Scale”.

In this patch, Meander is sending an A Aeolian (Am) Poly Ext Scale to tcArpGen which is set to Poly Ext Scale. This should be the scale “ABCDEFG” but tcArpGen is displaying “C#DEF#G#AB” and sounds bad as Meander and tcArpGen are playing from different scales.

Tonecarver tcArpGen 2.0.3 Test-1.vcv (9.4 KB)

Edit: Likewise, the Aaron Static ScaleCV Am scale shows incorrectly in tcArpGen with it set to “SortV/Oct”. Strangely, tcArpGen is displaying the same scale as in the image above when the Am scale is sent from ScaleCV, “C#DEF#G#AB”.

Thanks, found the problem and fixed it. An updated Windows build is available at the same location: Tonecarver-2.0.3-win-x64.vcvplugin

1 Like

This seems to fix the problem under Windows for both types of external scale. Thanks.

1 Like

The ‘----’ in the upper right corner of tcArpGen and the red LED below it indicate that no rules file is loaded. Use the context menu (right-click > L-System Rules File) to load one of the provided rules files and you should then be getting some output from it.

Maybe tcArpGen should have a default rule set so that it at least does something when initially loaded … hmmm

2 Likes

I would like that! I usually use the arp-demo.txt for my testing.