MOS scale: Difference between revisions

Wikispaces>genewardsmith
**Imported revision 143392329 - Original comment: **
Wikispaces>genewardsmith
**Imported revision 143392517 - 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-20 02:37:21 UTC</tt>.<br>
: This revision was by author [[User:genewardsmith|genewardsmith]] and made on <tt>2010-05-20 02:39:36 UTC</tt>.<br>
: The original revision id was <tt>143392329</tt>.<br>
: The original revision id was <tt>143392517</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 130: Line 130:


log2 := proc(x)
log2 := proc(x)
# logarithm base 2
# logarithm base 2
evalf(ln(x)/ln(2)) end:
evalf(ln(x)/ln(2)) end:


Line 214: Line 214:


Lsgen := proc(g, n)
Lsgen := proc(g, n)
# given generator g and scale size n determines large-small steps
# given generator g and scale size n determines large-small steps
local q, u, w;
local q, u, w;
q := round(n*g)/n;
q := round(n*g)/n;
Line 224: Line 224:


revlist := proc(l)
revlist := proc(l)
# reverse of list
# reverse of list
local i, v, e;
local i, v, e;
e := nops(l);
e := nops(l);
Line 232: Line 232:


invcon := proc(l)
invcon := proc(l)
# inverse continued fraction
# inverse continued fraction
local d, i, h, k;
local d, i, h, k;
h[-2] := 0;
h[-2] := 0;
Line 245: Line 245:


quest := proc(x)
quest := proc(x)
# Minkowski ? function
# Minkowski ? function
local i, j, d, l, s, t;
local i, j, d, l, s, t;
l := convert(x, confrac);
l := convert(x, confrac);
Line 258: Line 258:
s end:
s end:


box := proc(x)
Box := proc(x)
# inverse ? function
# inverse ? function
local d, e, i, n, w, y;
local d, e, i, n, w, y;
if type(x, integer) then RETURN(x) fi;
if type(x, integer) then RETURN(x) fi;
Line 639: Line 639:
&lt;br /&gt;
&lt;br /&gt;
log2 := proc(x)&lt;br /&gt;
log2 := proc(x)&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;logarithm base 2&lt;/li&gt;&lt;/ol&gt;evalf(ln(x)/ln(2)) end:&lt;br /&gt;
# logarithm base 2&lt;br /&gt;
evalf(ln(x)/ln(2)) end:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
nextfarey := proc(q, n)&lt;br /&gt;
nextfarey := proc(q, n)&lt;br /&gt;
Line 722: Line 723:
&lt;br /&gt;
&lt;br /&gt;
Lsgen := proc(g, n)&lt;br /&gt;
Lsgen := proc(g, n)&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;given generator g and scale size n determines large-small steps&lt;/li&gt;&lt;/ol&gt;local q, u, w;&lt;br /&gt;
# given generator g and scale size n determines large-small steps&lt;br /&gt;
local q, u, w;&lt;br /&gt;
q := round(n*g)/n;&lt;br /&gt;
q := round(n*g)/n;&lt;br /&gt;
w := n/denom(q);&lt;br /&gt;
w := n/denom(q);&lt;br /&gt;
Line 731: Line 733:
&lt;br /&gt;
&lt;br /&gt;
revlist := proc(l)&lt;br /&gt;
revlist := proc(l)&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;reverse of list&lt;/li&gt;&lt;/ol&gt;local i, v, e;&lt;br /&gt;
# reverse of list&lt;br /&gt;
local i, v, e;&lt;br /&gt;
e := nops(l);&lt;br /&gt;
e := nops(l);&lt;br /&gt;
for i from 1 to e do&lt;br /&gt;
for i from 1 to e do&lt;br /&gt;
Line 738: Line 741:
&lt;br /&gt;
&lt;br /&gt;
invcon := proc(l)&lt;br /&gt;
invcon := proc(l)&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;inverse continued fraction&lt;/li&gt;&lt;/ol&gt;local d, i, h, k;&lt;br /&gt;
# inverse continued fraction&lt;br /&gt;
local d, i, h, k;&lt;br /&gt;
h[-2] := 0;&lt;br /&gt;
h[-2] := 0;&lt;br /&gt;
h[-1] := 1;&lt;br /&gt;
h[-1] := 1;&lt;br /&gt;
Line 750: Line 754:
&lt;br /&gt;
&lt;br /&gt;
quest := proc(x)&lt;br /&gt;
quest := proc(x)&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Minkowski ? function&lt;/li&gt;&lt;/ol&gt;local i, j, d, l, s, t;&lt;br /&gt;
# Minkowski ? function&lt;br /&gt;
local i, j, d, l, s, t;&lt;br /&gt;
l := convert(x, confrac);&lt;br /&gt;
l := convert(x, confrac);&lt;br /&gt;
d := nops(l);&lt;br /&gt;
d := nops(l);&lt;br /&gt;
Line 762: Line 767:
s end:&lt;br /&gt;
s end:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
box := proc(x)&lt;br /&gt;
Box := proc(x)&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;inverse ? function&lt;/li&gt;&lt;/ol&gt;local d, e, i, n, w, y;&lt;br /&gt;
# inverse ? function&lt;br /&gt;
local d, e, i, n, w, y;&lt;br /&gt;
if type(x, integer) then RETURN(x) fi;&lt;br /&gt;
if type(x, integer) then RETURN(x) fi;&lt;br /&gt;
y := x-floor(x);&lt;br /&gt;
y := x-floor(x);&lt;br /&gt;