< Back to IRCAM Forum

PC-Sets with specified amount of common notes

Hello,

Im currently trying to create an automated patch to make a progression of PC sets using a specified amount of common notes between successive Sets to progress. However, while I was able to use Mathtools to create a list of suitable sets (transpositions or inversions), my intention is for the patch to automatically select a random chord that fits the rule.

I think the omif functions should be able to do this relatively easily, but im stuck at the moment.

PC-Sets- common notes.omp (24.3 KB)

Hi Lukas,

I think you can use OMCS library download from sources to solve this kind of problem. Is the latest release the PC-Set-Theory part was adapted from PW-Constraints (PatchWork) to OM by Karim Haddad and I’ve made some small changes in the code.

This is one possible way to do it using this library (you can choose all possible solutions or only one solution by changing the pop-up menu):

There is also a difference between MathTools and Pc-Set-Theory in the way the set classes are labelled. In the latter, there is a form A (prime) and form B (inversion), but only when the inversion is different (this does not apply for the set class 4-24, for example.

omcs-pc-sets-common-notes.omp (33.4 KB)

See if it works for you.

Best,
Paulo

Hi Paulo,

Thanks for coming to the rescue again. The patch looks great and thanks for the tip on the B form. The OMCS looks super helpful in general, I haven’t used it yet.

However, I tend to get stack overflow when using the “all” function with small sets like 4-24, or in the “once” setting when using larger sets like 8-25. How can I avoid this?

Also, I want to enter a specific transposition or inversion as the first reference chord, rather than the prime form of a set. How would I be able to do this, or should I just set the pc-set input in the n-common-tones patch with the m-values (e.g. 1 2 5 6) as the second input in the intersection LISP?

Thank you very much.

Hi Lukas,

I’m testing here and I think it is impossible to find a transposition of the sc. 4-25 with 3 common notes with sc. 4-19A (it works with 2 common notes). However, I’m not getting the stack overflow error, but instead the pmc-engine simply returns nil. I’ve had this problem in the past and apparently the stack overflow error disappears when the library is compiled (I’m using the free version of LispWorks to do this).

About a specific transposition of a set class, you can change the internal patch “n-common-tones”. The first input uses “sc-info” to return the prime form of the starting sc. If you remove this, you can use integers instead:

Best,
Paulo

I think I need to fix the stack overflow problem first. At the moment I am getting either a stack overflow or nil as a result.

I installed the latest OMSC, hoping it would contain compiled files, but the error remains.

Dear Lukas,

You can’t fix the stack overflow issue which isn’t in fact as Paulo stated it is just an endless computation going on because no solution is found. But still i can send you a compiled version which will avoid this. Just tell me on what OS/processor you are using.

And by the way, thanx a lot Paulo for your precious help.

Best
K

1 Like

Hello Karim,

I am using Windows 11 x64 with Om 7.3.

Thank you very much.

Dear Lukas,

Here you are:
OMCS.zip (721.1 KB)

best
K

1 Like

Thank you very much Karim.

The stack overflow no longer occurs.

However, it seems that the plugin only works with sets that have the same number of pitches.

For example, using the
PC set: 5-30
Start: PC-Set: 4-24 (A or B)
Common notes: 3

The result is nil. However, since 4-24 is a subset of 5-30, there should be a result (2 possible results without Inversions).

Hi Lukas,

To use this patch with set classes with more than 4 notes you have to make some changes in the search space and the rules:

  • Change the repeat-n to 5 (because the pmc-engine will search for solutions in a list with 5 numbers between 0 and 11);

search-space

  • Change the pc-set and n-common-tones internal patches to return true if the length of the list is equal or less than 4 (instead of 3);

set-class-length

  • Change the name of the set class to A or B form (5-30A or 5-30B), otherwise the “sc-info” will return nil (you can check the available set classes in the library with the method “all-sc-names”.

A-or-B

all-sc-names

With all these changes the engine has found 2 solutions here (5-30A pentachords which shares exactly 3 common notes with 4-24):

See if it works now.

Best,
Paulo

1 Like

Hello Paulo,

I’m not sure. On the one hand, it would be great if you could clarify for me why I use 4 instead of 3 within the patch.

But even following this logic, when I try to find suitable supersets for, for example, 4-24 I To (0 4 8 10) within 6-15A, I can find two in my previous patch and only one in the current one.


Hi Lukas,

The motive for using length 4 instead 3 is because the pmc-engine will not test sets with less than 5 numbers (<= 4) , otherwise it will always return nil, since we are trying to find pentachords. It is related to the way the pmc-engine works:

  • The engine starts with one number member of the list in the search-space, (0) and returns true to all rules.
  • Then add another number (0 0) and returns true again in the first two rules, but false in the last one (because it is not in ascending order). The next logical solution is (0 1);
  • when the list is complete, for example (0 1 2 3 4), the first two rules will be applied.
  • A final solution is collected only when all the rules returns true and all combinations between the numbers in the search-space were tested (which is a lot!).

About the problem with the OMCS patch, I think it is because it will not calculate supersets or subsets, but only sets with exactly “n-common-notes”.
For example, the solution with 3 common notes will exclude sets with 4 common notes, and so on.
If you substitute “om=” for “om>=” inside the n-common-tones internal patch, the engine will return more possibilities, I think (I’ve not tested this yet).

Best,
Paulo

Hi Paulo,

I am still having massive problems with this plugin. Basically, any deviation from the original 3 common notes of a 4-pitch set results in nil.

Ill try to do some more testing myself before getting back to you.

Hi Lukas,

This is another test intended to work with any set class.

omcs-pc-sets-common-notes-v2.omp (19.5 KB)

Best,
Paulo

Hi Paulo,

Thanks a lot, I think this one did the trick. I’m going to use it for a few operations to check, but it seems to be working great.

1 Like