Upcoming Tonecarver module: tcArpGen (in Beta)

Well, at least my “demos” are still testing the beta version :thinking:

What do the Arp and Harm Prob parameter setting show? If these are set to 0, no note will play of that type.

I cannot determine what is setting the Expand Depth minimum length number. Is it set by the rules txt file?

The minimum value for the Expand Depth parameter is fixed at 2 so that there is at least some initial expansion of the l-system rules. That parameter is set manually, user’s choice, to determine how many levels of recursion are performed when doing the rule set expansion (aka term rewriting). The as yet unlabeled numbers appearing next to the Expansion Depth knob show the number of terms in the fully expanded sequence. (note to self: add label identifying the sequence length display). Rule expansion stops after the sequence length hits a fixed internal maximum so, for some rules, increasing the Expansion Depth beyond a certain point will have no additional effect. The sequence length may or may not make a difference to tcArpGen output, depending entirely on the specific rule set that is expanded. Nice sequences can be generated from shorter sequences as well as longer ones. Sequence length will determine the frequency of EOC triggers though.

1 Like

Had a chat with @fractalgee and the the issue is resolved by reloading a local copy of the rules file.

Loading a patch containing tcArpGen that someone else created restores the rules file path as an absolute path to the rules file location on the patch creator’s system. That path most likely does not exist on the system where the patch is being downloaded to, so tcArpGen cannot load the rules and thus has no actions to perform. The Valid LED shows red and the expansion length shows ‘—’ to indicate no rules available to execute Perhaps those indicators are too subtle.

Will have to consider how to solve this:

  • Save the rules file path as relative to the plugin folder?
  • Save the contents of the rules file (the rule definitions themselves) instead of the file path?
  • … some other clever approach :wink:
1 Like

So, can @fractalgee see the rule file name in my patch, even if the path is wrong? If not, I do not see how patches could be shared… without something more clever.

So, in this latest patch, I’m using the harmony.txt rule file. I suppose that is what they reloaded locally?

So, I suppose my question should have been, why if the expansion depth is set to the minimum of 2, the expanded length varies from patch to patch, with different rule files. I have been trying to work at small depths and lengths until I understand tcArpGen better. Sometimes the length is 5 or 6 or 12 or…

Maybe I do not need to know the answer to this, but, I am surprised when it changes and I don’t understand what caused it to change.

yes, it shows as your plugin folder’s path on right clicking. Missed it pointed to your user dir, so didn’t catch that at first.

1 Like

Given the rules file is inside your plugin folder, would a relative path not work, as that would be same on every system… Unless a module cannot discover it’s own plugin folder, of course, something I am not sure about. Then saving rules file inside the patch file (which is really a zip file) would be the way to go, or it’s contents in the zipped .vcv json file, unless it’s large… Then you could load that if the original path couldn’t be found

The expanded sequence length depends on the number of terms in the rule set and the complexity of the recursive references among the various productions. For example, consider the following rule from the up.txt rule set:

S = X
X = N + X

Expanding this gives:

depth 2: N + X
depth 3: N + N + X
depth 4: N + N + N + X

where X is present as a placeholder. It is not playable and has no associated action. Expanding this rule set just gives a repeating mini-sequence of N +

Now, consider the arp-demo.txt rules:

S = $h1=1  X 
X = N $h1+ + X

Expansion:

depth 2: $h1=1 N $h1+ + X
depth 3: $h1=1 N $h1+ + N $h1+ + X
depth 4: $h1=1 N $h1+ + N $h1+ + N $h1+ + X

At equivalent expansion depths the sequence lengths differ because there are a different number of terms in the two rule sets.

Now if we consider something more complex like the branch.txt rule set whose rules include cross-references:

S = $h1=2 $h2=3 $h3=4 X A B 
X = A B [ + B + + A ] X
A = N + B X
B = [ $h1+ $h2+ $h3+ N ] A

Expansion:

depth 1: $h1=2 $h2=3 $h3=4 X A B 
depth 2: $h1=2 $h2=3 $h3=4 A B [ + B + + A ] X  N + B X  [ $h1+ $h2+ $h3+ N ] A
depth 3: is 50 nodes by substituting the X phrase where X appears, the A phrase where A appears, and the B phrase where B appears. The sequence length for this rule set grows very quickly.

The N terms cause output to be emitted. The solo + term increments the position of the input note arpeggiator. The $h1, $h2, and $h3 terms affect the position of the harmony arpeggiators. The remaining letter terms are placeholders for further expansion.

And, for an example in the oppisite direction, the soup.txt rule set never grows beyond the minimum length because the X rule does not contain any expandable terms, i.e., no references to itself or any other rules, so there is no opportunity to expand further:

S = $h1=3 $h2=5 $h3=7 $s=0 X
X = N + [ $s+ $s+ $h1=4 N ]

Expansion:

depth 2: $h1=3 $h2=5 $h3=7 $s=0 N + [ $s+ $s+ $h1=4 N ]
depth 3: $h1=3 $h2=5 $h3=7 $s=0 N + [ $s+ $s+ $h1=4 N ]
depth 200:$h1=3 $h2=5 $h3=7 $s=0 N + [ $s+ $s+ $h1=4 N ]
2 Likes

Thanks for the detailed explanation. It should be no surprise that L-systems can generate complexity very quickly :wink:

1 Like

I’m trying to test k-chaffin’s patches but I can’t get any output from the module in win 11.

1 Like

Try right-clicking to bring up the context menu and loading the rules file from your local arprules directory.

In its current state tcArpGen saves the absolute path to the rules file with the module/patch state. Since the path was created on someone else’s system that file path is not likely to exist in your system. Reloading the rules file from your local system cures that.

Btw, I’m working on a fix for that … stay tuned.

2 Likes

that’s the case… thank you

1 Like

I’ve been having fun with this module.

Any plans to add it to the library, or at least build an apple silicon (m1) version? Currently I have to open VCV Rack under Rosetta on my M1 mac in order to run this module.

I’d be happy to build it from source if I had the source.

Thanks.