Recursive structure of MOS scales: Difference between revisions
m Categories, todo:expand for missing proof, "See also" section with 1 link, misc. edit |
→Recursive structure (chunking operation): Clarified chunking process for scales with more s's than L's; also accounted for multi-period scales as repetitions of a single-period scale. I've brought up these properties on the xen discord and I've finally gotten around to putting it on the wiki in hopefully a proper place. My contributions may still need some rewording. (Does not include the pseudocode I brought up since it still had bugs) - Ganaram |
||
Line 3: | Line 3: | ||
== Recursive structure (chunking operation) == | == Recursive structure (chunking operation) == | ||
Let w be an | Let w be an arbitrary moment-of-symmetry scale in either its brightest mode or darkest mode. Let x be the number of L's in the scale and let y be the number of s's in the scale. Such a scale will fall under one of three general cases or one of three special cases: | ||
* '''Case 1:''' The scale is a single-period moment-of-symmetry scale where there are more L's than s's, and there is more than one s (or x > y > 1). Scale w can broken up into substrings (or chunks) where each substring contains at least one L and exactly one s. Among these chunks, of which there are y in total, there are two unique chunks whose sizes differ by exactly one L: the larger of the two contains ceil(x/y) L's and exactly one s, and the smaller of the two contains floor(x/y) L's and exactly one s. If the scale is in its brightest mode, groups of L's should come before singular s's; this order is reversed if the scale is in its darkest mode. | |||
* '''Case 2:''' The scale is a single-period moment-of-symmetry scale where there are more s's than L's, and there is more than one L (or y > x > 1). Scale w can broken up into substrings (or chunks) where each substring contains at least one s and exactly one L. Among these chunks, of which there are x in total, there are two unique chunks whose sizes differ by exactly one s: the larger of the two contains ceil(y/x) s's and exactly one L, and the smaller of the two contains floor(y/x) s's and exactly one L. If the scale is in its brightest mode, singular L's should come before groups of s's; this order is reversed if the scale is in its darkest mode. | |||
* '''Case 3:''' The scale is a multi-period moment-of-symmetry scale. Because a multi-period scale consists of a single MOS-like chunk that's repeated throughout the scale, x and y necessarily share a common factor c, where c is the greatest common factor of x and y, and c is the number of times that chunk is repeated. Therefore, when considering a multi-period moment-of-symmetry scale, only the first chunk, the first (x+y)/c steps of the scale, needs to be considered. This chunk will fall under case 1 or case 2, or one of the special cases. | |||
'''Special cases:''' | |||
* The special case for case 1 is when there is only one s in the scale. The scale is a moment-of-symmetry scale where the entire scale is considered to be one chunk. | |||
* The special case for case 2 is when there is only one L in the scale. The scale is a moment-of-symmetry scale where the entire scale is considered to be one chunk. | |||
* There is a third special case where there is exactly one L and one s in the scale, producing "Ls" or "sL". Technically speaking, it's possible to reduce the previous two special cases even further into this special case. | |||
In both case 1 and 2, the L's and s's are distributed such that they are maximally even (that is, they are distributed as evenly as possible), but the chunks of L's and s's are arranged so that they too are maximally even. This can be demonstrated by reducing the larger chunks into L and the smaller chunks into s. This produces a new scale W that is also a moment-of-symmetry scale. This process can be repeated multiple times until the scale is reduced into one of the special cases. In case 3, it is possible to reduce a multi-period scale until it consists of a single unique MOS-like chunk repeated c times, where that chunk is one of the special cases. | |||
Note that in this reduction process, the order of L's and s's may reverse. This is normal. | |||
Just as reducing a moment-of-symmetry scale using the aforementioned process produces another moment-of-symmetry scale, reversing the reduction rules into production rules will produce another scale w' that is also a moment-of-symmetry scale. One of the following sets of production rules can be used: | |||
* L -> LL...LLs (n+1 L's and one s), s -> LL...LLs (n L's and one s) | |||
* L -> ss...ssL (n+1 s's and one L), s -> ss...ssL (n s's and one L) | |||
* L -> Ls, s -> s (a special case of the first set of productions rules where n = 0) | |||
* L -> sL, s -> L (a special case of the second set of productions rules where n = 0) | |||
Repeating these production rules will produce a scale that is more chromatic than the last, and every scale produced this way is another moment-of-symmetry scale. | |||
The recursive nature of moment-of-symmetry scales allows for two algorithms to be made: one that can determine whether an arbitrary scale of large and small steps is a valid moment-of-symmetry scale and another that can construct a moment-of-symmetry scale from any number of large and small steps, without any prior knowledge of the scale's structure. | |||
(TODO: Maximal evenness test for any arbitrary scale in any arbitrary mode.) | |||
=== Examples === | |||
6L 1s, or LLLLLLs. This falls under one of the special cases and is a moment-of-symmetry scale. | |||
1L 6s, or Lssssss. This falls under one of the special cases and is a moment-of-symmetry scale. | |||
5L 2s, or LLLsLLs. This produces two unique chunks of LLLs and LLs; replacing them with L and s respectively reduces the scale into Ls. | |||
2L 5s, or LssLsss. This produces two unique chunks of Lss and Lsss; replacing them with s and L respectively reduces the scale into sL. | |||
5L 7s, or LsLsLssLsLss. This produces two unique chunks of Ls and Lss; replacing them with s and L respectively reduces the scale into ssLsL. That scale produces two unique chunks of ssL and sL; replacing them with L and s respectively reduces the scale into Ls. | |||
7L 5s, or LLsLsLLsLsLs. This produces two unique chunks of LLs and Ls; replacing them with L and s respectively reduces the scale into LsLss. That scale produces two unique chunks of Ls and Lss; replacing them with s and L respectively reduces the scale into sL. | |||
5L 4s, or LLsLsLsLs. This scale consists of two unique chunks of LLs and Ls; replacing them with L and s respectively reduces the scale into Lsss. | |||
3L 6s, or LssLssLss. Since 3 and 6 share a common factor of 3, this scale consists of Lss repeated three times, which falls under the special cases and is a multi-period moment-of-symmetry scale. | |||
=== Counterexamples === | |||
LLLLsLs. This produces two unique chunks of LLLLs and Ls. However, the two chunks differ in size by two L's, and it is not maximally even. | |||
LLLLLss. This produces one chunk of LLLLLs. The lone s at the end can be considered a chunk consisting of zero L's and one s. Since the two chunks differ in size by 5 L's, this is not maximally even. | |||
LsssLsssL. The quantity of L's and s's are coprime, sharing a common factor of 3. However, dividing the scale into three equal chunks shows that all three chunks are different (Lss, sLs, and ssL), so this is not maximally even. | |||
LLsLLLsLLLLs. This produces three unique chunks of LLs, LLLs, and LLLLs. This is not maximally even. | |||
== Finding the MOS pattern from xL ys == | |||
This is the general algorithm for generating a maximally even scale consisting of x large steps and y small steps (a moment-of-symmetry scale). This algorithm will produce that scale without any prior knowledge of how the scale's steps are ordered. This algorithm is recursive. | |||
1. If x and y are coprime (that is, they have no common factors other than 1), then go to step 2. If x and y are not coprime (that is, they share a common factor c, where c is the greatest common factor of x and y), then record that common factor c and repeat the algorithm recursively to produce the scale corresponding to x/c large steps and y/c small steps. Duplicate the scale produced this way c times, as this is a multi-period scale, then go to step 5. (If done correctly, this step will be performed exactly once, even across recursive calls.) | |||
2. If either x or y is equal to 1, or both x and y are equal to 1, then proceed to step 3a, 3b, or 3c, depending on which situation is true. If not, proceed to either step 4a or 4b, depending on which situation is true. | |||
3a. If both x and y equal to 1, then the scale produced is exactly one L and exactly one s, or simply Ls. Proceed to step 5. | |||
3b. If only x = 1, then the scale produced consists of y s's followed by exactly one L. Proceed to step 5. | |||
3c. If only y = 1, then the scale produced consists of x L's followed by exactly one s. Proceed to step 5. | |||
4a. If there are more large steps than small steps (that is, x > y), then the scale will consist of y groups. Of those groups, x mod y groups will contain ceil(x/y) large steps and exactly one small step, and y - (x mod y) groups will contain floor(x/y) large steps and exactly one small step. Record the production rules L -> LL...LLs (where the number of L's is ceil(x/y)) and s -> LL...LLs (where the number of L's is floor(x/y)). Repeat the algorithm recursively for the scale with (x mod y) large steps and (y - (x mod y)) small steps to produce an intermediate scale. Replace L and s in the intermediate scale according to the production rules produced earlier, then proceed to step 5. | |||
4b. If there are more small steps than large steps (that is, y > x), then the scale will consist of x groups. Of these groups, y mod x groups will contain exactly one large step and ceil(y/x) small steps, and x - (y mod x) groups will contain exactly one large step and floor(y/x) small steps. Record the production rules L -> ss...ssL (where the number of s's is ceil(y/x)) and s -> ss...ssL (where the number of s's is floor(y/x)). Repeat the algorithm recursively for the scale with (y mod x) large steps and (x - (y mod x)) small steps to produce an intermediate scale. Replace L and s in the intermediate scale according to the production rules produced earlier, then proceed to step 5. | |||
5. If the algorithm was never called recursively, or the algorithm has reached this step after returning from its recursive calls, then the scale produced from the previous steps is the final scale, represented in its brightest mode if there are were L's than s's or the number of L's and s's were the same, or its darkest mode if ther were more s's than L's. If the algorithm was called as part of a recursive step, then the scale produced from the previous steps is an intermediate scale. Return the scale produced to when the algorithm was recursively called, and continue from that step. | |||
(TODO: Examples) | |||
=== Example === | === Example === |