Straight line pattern: Difference between revisions

Naren (talk | contribs)
Create page
 
Naren (talk | contribs)
Add Python code, change wording
 
Line 1: Line 1:
'''Straight line patterns''' are diagrams showing how the pitch of each scale tone in a [[moment of symmetry]] varies with the size of the generator.<ref name="wilson1975mos"/><ref name="wilson1996straight"/>
'''Straight line patterns''' are diagrams showing how the pitch of each scale tone in a [[moment of symmetry]] varies with the size of the generator.<ref name="wilson1975mos"/><ref name="wilson1996straight"/>


Figure 1 shows a straight line pattern for stacking a generator twelve times, from chain position -6 up to +5 (so stacking six times downwards and five times upwards).
Figure 1 shows a straight line pattern for a twelve-note MOS with chain positions -6 up to +5 (so stacking six times downwards and five times upwards).
The y-axis is the generator size in units of octaves, so the range 4/7 to 3/5 shown corresponds to 685.7 cents to 720 cents.
The y-axis is the generator size in units of octaves, so the range 4/7 to 3/5 shown corresponds to 685.7 cents to 720 cents.
The x-axis is the scale tone pitch in octaves.
The x-axis is the scale tone pitch in octaves.
Line 7: Line 7:
The lines are labeled with the number of generators stacked to give the corresponding scale tone.  
The lines are labeled with the number of generators stacked to give the corresponding scale tone.  


[[File:Straight-line-1.jpg|thumb|center|800px|'''Figure 1''': Straight line pattern for stacking a generator twelve times]]
[[File:Straight-line-1.jpg|thumb|center|800px|'''Figure 1''': Straight line pattern for a twelve-note MOS]]


A given MOS exists only for generators in a certain range of sizes (the [[Gral method]] lets us calculate this range).
A given MOS exists only for generators in a certain range of sizes (the [[Gral method]] lets us calculate this range).
Line 23: Line 23:


[[File:Straight-line-3.jpg|thumb|center|800px|'''Figure 3''': Straight line pattern showing Erv Wilson's system of fluctuating nominal symbols]]
[[File:Straight-line-3.jpg|thumb|center|800px|'''Figure 3''': Straight line pattern showing Erv Wilson's system of fluctuating nominal symbols]]
The Python code below calculates the generator range and exponents of the generator and period for an ''m/n'' MOS, that is an ''n''-note MOS with the generator at scale degree ''m''.
<syntaxhighlight lang="python">
from fractions import Fraction
def mos_generator_range(m, n):
    """
    Find the generator range in which an m/n MOS exists.
    >>> mos_generator_range(4, 7)
    (Fraction(1, 2), Fraction(3, 5))
    """
    c = pow(m, -1, n)
    d = n - c
    a = (c * m - 1) // n
    b = m - a
    return (Fraction(a, c), Fraction(b, d))
def mos_exponents(m, n, *, start):
    """
    Find exponents of generator and period for each note in an m/n MOS.
    The MOS starts at the generator with exponent `start`.
    >>> exponents = mos_exponents(4, 7, start=-1)
    >>> for p, q in exponents: print(f"{p:+}, {q:+}  ->  {p * 700 + q * 1200}")
    -1, +1  ->  500
    +0, +0  ->  0
    +1, +0  ->  700
    +2, -1  ->  200
    +3, -1  ->  900
    +4, -2  ->  400
    +5, -2  ->  1100
    """
    return [(p, -((p * m) // n)) for p in range(start, n + start)]
</syntaxhighlight>


== References ==
== References ==