MOS scale: Difference between revisions

Wikispaces>genewardsmith
**Imported revision 142461149 - Original comment: **
Wikispaces>genewardsmith
**Imported revision 142751603 - Original comment: **
Line 1: Line 1:
<h2>IMPORTED REVISION FROM WIKISPACES</h2>
<h2>IMPORTED REVISION FROM WIKISPACES</h2>
This is an imported revision from Wikispaces. The revision metadata is included below for reference:<br>
This is an imported revision from Wikispaces. The revision metadata is included below for reference:<br>
: This revision was by author [[User:genewardsmith|genewardsmith]] and made on <tt>2010-05-17 06:34:11 UTC</tt>.<br>
: This revision was by author [[User:genewardsmith|genewardsmith]] and made on <tt>2010-05-18 03:22:22 UTC</tt>.<br>
: The original revision id was <tt>142461149</tt>.<br>
: The original revision id was <tt>142751603</tt>.<br>
: The revision comment was: <tt></tt><br>
: The revision comment was: <tt></tt><br>
The revision contents are below, presented both in the original Wikispaces Wikitext format, and in HTML exactly as Wikispaces rendered it.<br>
The revision contents are below, presented both in the original Wikispaces Wikitext format, and in HTML exactly as Wikispaces rendered it.<br>
Line 32: Line 32:
==MOS in equal temperaments==  
==MOS in equal temperaments==  
In the special case of an equal temperament, more concrete things about MOS can be stated.
In the special case of an equal temperament, more concrete things about MOS can be stated.
In an equal temparement, all intervals - and hence also the intervals L and s - are integer multiples of a smallest unit. (Example: in case of the diatonic scale in 12EDO, L would be 2 and s 1.)
In an equal temperament, all intervals - and hence also the intervals L and s - are integer multiples of a smallest unit. (Example: in case of the diatonic scale in 12EDO, L would be 2 and s 1.)
If we have an arbitrary MOS scale in an n-tone equal temperament, with a steps of size L and b steps of size s, there holds
If we have an arbitrary MOS scale in an n-tone equal temperament, with a steps of size L and b steps of size s, there holds


Line 52: Line 52:
David Canright was the first to suggest Fibonacci Rhythms in 1/1. This lead to Kraig Grady to be the first to apply MOS patterns to rhythms. Two papers on the subject can be found here [[http://anaphoria.com/hora.PDF]] and [[http://anaphoria.com/horo2.PDF]]
David Canright was the first to suggest Fibonacci Rhythms in 1/1. This lead to Kraig Grady to be the first to apply MOS patterns to rhythms. Two papers on the subject can be found here [[http://anaphoria.com/hora.PDF]] and [[http://anaphoria.com/horo2.PDF]]
MOS structures and thinking can be applied to the design of rhythms as well. See [[MOS Rhythm Tutorial]]
MOS structures and thinking can be applied to the design of rhythms as well. See [[MOS Rhythm Tutorial]]
=Algorithms=
Below is some Maple code for various mathematical routines having to do with MOS. If you have access to Maple, you can of course copy and run these programs. Even if you do not, since Maple code makes better pseudocode than most languages or computer algebr packages afford, it can be used as pseudocode. For that purpose, it will be helpful to know that "modp(x, n)" means reducing x mod the integer n to 0, 1, ..., n-1 not only when x is an integer, but also when it is a rational number with denominator prime to n. In that case, p/q mod n = r means p = qr mod n.
nextfarey := proc(q, n)
# next in row n of Farey sequence from q, 0 &lt;= q &lt;= 1
local a, b, r, s;
if q &gt;= (n-1)/n then RETURN(1) fi;
a := numer(q);
b := denom(q);
s := n - modp(n + 1/a, b);
r := modp(1/b, s);
r/s end:
prevfarey := proc(q, n)
# previous in row n of Farey sequence from q, 0 &lt;= q &lt;= 1
local a, b, r, s;
if q=0 then RETURN(0) fi;
if n=0 then RETURN(0) fi;
a := numer(q);
b := denom(q);
s := n - modp(n - 1/a, b);
r := modp(-1/b, s);
r/s end:
fareypair := proc(q)
# Farey pair with q as its mediant
local n;
n := denom(q);
[prevfarey(q, n), nextfarey(q, n)] end:
mediant := proc(u, v)
# mediant of two rational numbers u and v
(numer(u) + numer(v))/(denom(u) + denom(v)) end:
convergents := proc(z)
# convergent list for z
local q;
convert(z,confrac,'q');
q end:
exlist := proc(l)
# expansion of a convergent list to semiconvergents
local i, j, s, d;
if nops(l)&lt;3 then RETURN(l) fi;
d[1] := l[1];
d[2] := l[2];
s := 3;
for i from 3 to nops(l)-1 do
for j from 1 to (numer(l[i])-numer(l[i-2]))/numer(l[i-1]) do
d[s] :=
(j*numer(l[i-1])+numer(l[i-2]))/(j*denom(l[i-1])+denom(l[i-2]));
s := s+1 od od;
convert(convert(d, array), list) end:
semiconvergents := proc(z)
# semiconvergent list for z
exlist(convergents(z)) end:
penult := proc(q)
# penultimate convergent to q
local i, u;
u := convergents(q);
if nops(u)=1 then RETURN(u[1]) fi;
for i from 1 to nops(u) do
if u[i]=q then RETURN(u[i-1]) fi od;
end:
Ls := proc(q)
# large-small steps from mediant q
local u;
u := fareypair(q);
[denom(u[2]), denom(u[1])] end:
medi := proc(u)
# mediant from Large-small steps
local q;
if u[2]=1 then RETURN(1/(u[1]+1)) fi;
if igcd(u[1], u[2])&gt;1 then RETURN("not relatively prime") fi;
q := penult(u[1]/u[2]);
if q &gt; u[1]/u[2] then RETURN((numer(q)+denom(q))/(u[1]+u[2])) fi;
(u[1]+u[2]-numer(q)-denom(q))/(u[1]+u[2]) end:


=[[MOSDiagrams]]= </pre></div>
=[[MOSDiagrams]]= </pre></div>
Line 81: Line 164:
&lt;!-- ws:start:WikiTextHeadingRule:8:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id="toc4"&gt;&lt;a name="MOS scales-MOS in equal temperaments"&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:8 --&gt;MOS in equal temperaments&lt;/h2&gt;
&lt;!-- ws:start:WikiTextHeadingRule:8:&amp;lt;h2&amp;gt; --&gt;&lt;h2 id="toc4"&gt;&lt;a name="MOS scales-MOS in equal temperaments"&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:8 --&gt;MOS in equal temperaments&lt;/h2&gt;
  In the special case of an equal temperament, more concrete things about MOS can be stated.&lt;br /&gt;
  In the special case of an equal temperament, more concrete things about MOS can be stated.&lt;br /&gt;
In an equal temparement, all intervals - and hence also the intervals L and s - are integer multiples of a smallest unit. (Example: in case of the diatonic scale in 12EDO, L would be 2 and s 1.)&lt;br /&gt;
In an equal temperament, all intervals - and hence also the intervals L and s - are integer multiples of a smallest unit. (Example: in case of the diatonic scale in 12EDO, L would be 2 and s 1.)&lt;br /&gt;
If we have an arbitrary MOS scale in an n-tone equal temperament, with a steps of size L and b steps of size s, there holds&lt;br /&gt;
If we have an arbitrary MOS scale in an n-tone equal temperament, with a steps of size L and b steps of size s, there holds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Line 329: Line 412:
MOS structures and thinking can be applied to the design of rhythms as well. See &lt;a class="wiki_link" href="/MOS%20Rhythm%20Tutorial"&gt;MOS Rhythm Tutorial&lt;/a&gt;&lt;br /&gt;
MOS structures and thinking can be applied to the design of rhythms as well. See &lt;a class="wiki_link" href="/MOS%20Rhythm%20Tutorial"&gt;MOS Rhythm Tutorial&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:12:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id="toc6"&gt;&lt;a name="MOSDiagrams"&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:12 --&gt;&lt;a class="wiki_link" href="/MOSDiagrams"&gt;MOSDiagrams&lt;/a&gt;&lt;/h1&gt;
&lt;!-- ws:start:WikiTextHeadingRule:12:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id="toc6"&gt;&lt;a name="Algorithms"&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:12 --&gt;Algorithms&lt;/h1&gt;
Below is some Maple code for various mathematical routines having to do with MOS. If you have access to Maple, you can of course copy and run these programs. Even if you do not, since Maple code makes better pseudocode than most languages or computer algebr packages afford, it can be used as pseudocode. For that purpose, it will be helpful to know that &amp;quot;modp(x, n)&amp;quot; means reducing x mod the integer n to 0, 1, ..., n-1 not only when x is an integer, but also when it is a rational number with denominator prime to n. In that case, p/q mod n = r means p = qr mod n.&lt;br /&gt;
&lt;br /&gt;
nextfarey := proc(q, n)&lt;br /&gt;
# next in row n of Farey sequence from q, 0 &amp;lt;= q &amp;lt;= 1&lt;br /&gt;
local a, b, r, s;&lt;br /&gt;
if q &amp;gt;= (n-1)/n then RETURN(1) fi;&lt;br /&gt;
a := numer(q);&lt;br /&gt;
b := denom(q);&lt;br /&gt;
s := n - modp(n + 1/a, b);&lt;br /&gt;
r := modp(1/b, s);&lt;br /&gt;
r/s end:&lt;br /&gt;
&lt;br /&gt;
prevfarey := proc(q, n)&lt;br /&gt;
# previous in row n of Farey sequence from q, 0 &amp;lt;= q &amp;lt;= 1&lt;br /&gt;
local a, b, r, s;&lt;br /&gt;
if q=0 then RETURN(0) fi;&lt;br /&gt;
if n=0 then RETURN(0) fi;&lt;br /&gt;
a := numer(q);&lt;br /&gt;
b := denom(q);&lt;br /&gt;
s := n - modp(n - 1/a, b);&lt;br /&gt;
r := modp(-1/b, s);&lt;br /&gt;
r/s end:&lt;br /&gt;
&lt;br /&gt;
fareypair := proc(q)&lt;br /&gt;
# Farey pair with q as its mediant&lt;br /&gt;
local n;&lt;br /&gt;
n := denom(q);&lt;br /&gt;
[prevfarey(q, n), nextfarey(q, n)] end:&lt;br /&gt;
&lt;br /&gt;
mediant := proc(u, v)&lt;br /&gt;
# mediant of two rational numbers u and v&lt;br /&gt;
(numer(u) + numer(v))/(denom(u) + denom(v)) end:&lt;br /&gt;
&lt;br /&gt;
convergents := proc(z)&lt;br /&gt;
# convergent list for z &lt;br /&gt;
local q; &lt;br /&gt;
convert(z,confrac,'q'); &lt;br /&gt;
q end:&lt;br /&gt;
&lt;br /&gt;
exlist := proc(l)&lt;br /&gt;
# expansion of a convergent list to semiconvergents&lt;br /&gt;
local i, j, s, d;&lt;br /&gt;
if nops(l)&amp;lt;3 then RETURN(l) fi;&lt;br /&gt;
d[1] := l[1];&lt;br /&gt;
d[2] := l[2];&lt;br /&gt;
s := 3;&lt;br /&gt;
for i from 3 to nops(l)-1 do&lt;br /&gt;
for j from 1 to (numer(l[i])-numer(l[i-2]))/numer(l[i-1]) do&lt;br /&gt;
d[s] := &lt;br /&gt;
(j*numer(l[i-1])+numer(l[i-2]))/(j*denom(l[i-1])+denom(l[i-2]));&lt;br /&gt;
s := s+1 od od;&lt;br /&gt;
convert(convert(d, array), list) end:&lt;br /&gt;
&lt;br /&gt;
semiconvergents := proc(z)&lt;br /&gt;
# semiconvergent list for z&lt;br /&gt;
exlist(convergents(z)) end:&lt;br /&gt;
&lt;br /&gt;
penult := proc(q)&lt;br /&gt;
# penultimate convergent to q&lt;br /&gt;
local i, u;&lt;br /&gt;
u := convergents(q);&lt;br /&gt;
if nops(u)=1 then RETURN(u[1]) fi;&lt;br /&gt;
for i from 1 to nops(u) do&lt;br /&gt;
if u[i]=q then RETURN(u[i-1]) fi od;&lt;br /&gt;
end:&lt;br /&gt;
&lt;br /&gt;
Ls := proc(q)&lt;br /&gt;
# large-small steps from mediant q&lt;br /&gt;
local u;&lt;br /&gt;
u := fareypair(q);&lt;br /&gt;
[denom(u[2]), denom(u[1])] end:&lt;br /&gt;
&lt;br /&gt;
medi := proc(u)&lt;br /&gt;
# mediant from Large-small steps&lt;br /&gt;
local q;&lt;br /&gt;
if u[2]=1 then RETURN(1/(u[1]+1)) fi;&lt;br /&gt;
if igcd(u[1], u[2])&amp;gt;1 then RETURN(&amp;quot;not relatively prime&amp;quot;) fi;&lt;br /&gt;
q := penult(u[1]/u[2]);&lt;br /&gt;
if q &amp;gt; u[1]/u[2] then RETURN((numer(q)+denom(q))/(u[1]+u[2])) fi;&lt;br /&gt;
(u[1]+u[2]-numer(q)-denom(q))/(u[1]+u[2]) end:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- ws:start:WikiTextHeadingRule:14:&amp;lt;h1&amp;gt; --&gt;&lt;h1 id="toc7"&gt;&lt;a name="MOSDiagrams"&gt;&lt;/a&gt;&lt;!-- ws:end:WikiTextHeadingRule:14 --&gt;&lt;a class="wiki_link" href="/MOSDiagrams"&gt;MOSDiagrams&lt;/a&gt;&lt;/h1&gt;
&lt;/body&gt;&lt;/html&gt;</pre></div>
&lt;/body&gt;&lt;/html&gt;</pre></div>