Module:Interval table: Difference between revisions

BudjarnLambeth (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 80: Line 80:
} -- NOTE: indices are prime numbers
} -- NOTE: indices are prime numbers


local t_head = "{| class=\"wikitable center-1 right-2\"\n"
local t_head = "{| class=\"wikitable center-1 right-2"
if et.size > 20 then
if et.size > 20 then
t_head = "{| class=\"wikitable center-1 right-2 mw-collapsible mw-collapsed\"\n"
t_head = t_head .. " mw-collapsible mw-collapsed"
end
end
t_head = t_head .. "\"\n"
local fifth = patent_val[3] - patent_val[2]
local fifth = patent_val[3] - patent_val[2]
local fifth_error = ET.cents(et, fifth) - rat.cents(rat.new(3, 2))
local fifth_error = ET.cents(et, fifth) - rat.cents(rat.new(3, 2))
Line 91: Line 92:


-- List of all 47-limit ratios with numerator and denominator <= certain cents value and in the range 1/1 - 12/1
-- List of all 47-limit ratios with numerator and denominator <= certain cents value and in the range 1/1 - 12/1
local ratios_list = get_ratios_list((20 + (et.size / 4)),12,47)
local ratios_list = get_ratios_list((20 + (et.size / 4)), 12, 47)


wikitext = t_head ..  
wtext = t_head ..
"|-\n" ..
"! Steps\n" ..  
"! Steps\n" ..  
"! Cents\n" ..
"! Cents\n" ..
Line 99: Line 101:
if rat.eq(et.equave, 2) then
if rat.eq(et.equave, 2) then
if dual_fifth then
if dual_fifth then
wikitext = wikitext
wtext = wtext
.. "! [[Ups and downs notation|Ups and Downs Notation]]<br>(Dual Flat Fifth "
.. "! [[Ups and downs notation|Ups and Downs Notation]]<br />(Dual Flat Fifth "
.. dual_flat_fifth
.. dual_flat_fifth
.. "\\"
.. "\\"
.. et.size
.. et.size
.. ")\n"
.. ")\n"
wikitext = wikitext
.. "! [[Ups and downs notation|Ups and Downs Notation]]<br />(Dual Sharp Fifth "
.. "! [[Ups and downs notation|Ups and Downs Notation]]<br>(Dual Sharp Fifth "
.. dual_sharp_fifth
.. dual_sharp_fifth
.. "\\"
.. "\\"
Line 112: Line 113:
.. ")\n"
.. ")\n"
else
else
wikitext = wikitext .. "! [[Ups and downs notation|Ups and Downs Notation]]\n"
wtext = wtext .. "! [[Ups and downs notation|Ups and Downs Notation]]\n"
end
end
end
end
Line 118: Line 119:
if #additional_split > 0 then
if #additional_split > 0 then
for i = 1, #additional_split[1] do
for i = 1, #additional_split[1] do
wikitext = wikitext .. "! " .. additional_split[1][i] .. "\n"
wtext = wtext .. "! " .. additional_split[1][i] .. "\n"
end
end
end
end


for i = 0, et.size do
for i = 0, et.size do
wikitext = wikitext .. "|-\n"
wtext = wtext .. "|-\n"
wikitext = wikitext .. "| " .. i .. "\n"
.. "| " .. i .. "\n"
wikitext = wikitext .. "| " .. utils._round_dec(ET.cents(et, i), 3) .. "\n"
.. "| " .. utils._round_dec(ET.cents(et, i), 3) .. "\n"
wikitext = wikitext .. "| "
.. "| "
for j = 1, #ratios_list do
for j = 1, #ratios_list do
-- Go through all ratios.
-- Go through all ratios.
Line 137: Line 138:
< (1200 / (math.log(et.size) * (et.size + 5)))
< (1200 / (math.log(et.size) * (et.size + 5)))
then
then
wikitext = wikitext .. "[[" .. ratios_list[j][1] .. "/" .. ratios_list[j][2] .. "]], "
wtext = wtext .. "[[" .. ratios_list[j][1] .. "/" .. ratios_list[j][2] .. "]], "
end
end
end
end
-- ???
-- ???
if wikitext:sub(-2, -1) == "| " then
if wtext:sub(-2, -1) == "| " then
wikitext = wikitext .. "\n"
wtext = wtext .. "\n"
else
else
wikitext = wikitext:sub(0, -3) .. "\n"
wtext = wtext:sub(0, -3) .. "\n"
end
end
if rat.eq(et.equave, 2) then
if rat.eq(et.equave, 2) then
if dual_fifth then
if dual_fifth then
wikitext = wikitext .. "| " .. ud_note(et, dual_flat_fifth, i) .. "\n"
wtext = wtext .. "| " .. ud_note(et, dual_flat_fifth, i) .. "\n"
wikitext = wikitext .. "| " .. ud_note(et, dual_sharp_fifth, i) .. "\n"
wtext = wtext .. "| " .. ud_note(et, dual_sharp_fifth, i) .. "\n"
else
else
wikitext = wikitext .. "| " .. ud_note(et, fifth, i) .. "\n"
wtext = wtext .. "| " .. ud_note(et, fifth, i) .. "\n"
end
end
end
end
Line 159: Line 160:
if (i + 2) <= #additional_split then
if (i + 2) <= #additional_split then
for j = 1, #additional_split[i + 2] do
for j = 1, #additional_split[i + 2] do
wikitext = wikitext .. "| " .. additional_split[i + 2][j] .. "\n"
wtext = wtext .. "| " .. additional_split[i + 2][j] .. "\n"
end
end
end
end
end
end


wikitext = wikitext .. "|}"
wtext = wtext .. "|}"
 
return wtext
return wikitext
end
end


return p
return p