Module:Interval table: Difference between revisions
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 | local t_head = "{| class=\"wikitable center-1 right-2" | ||
if et.size > 20 then | if et.size > 20 then | ||
t_head = " | 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) | ||
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 | ||
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" | ||
.. "! [[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 | ||
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 | ||
wtext = wtext .. "! " .. additional_split[1][i] .. "\n" | |||
end | end | ||
end | end | ||
for i = 0, et.size do | for i = 0, et.size do | ||
wtext = wtext .. "|-\n" | |||
.. "| " .. i .. "\n" | |||
.. "| " .. utils._round_dec(ET.cents(et, i), 3) .. "\n" | |||
.. "| " | |||
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 | ||
wtext = wtext .. "[[" .. ratios_list[j][1] .. "/" .. ratios_list[j][2] .. "]], " | |||
end | end | ||
end | end | ||
-- ??? | -- ??? | ||
if | if wtext:sub(-2, -1) == "| " then | ||
wtext = wtext .. "\n" | |||
else | else | ||
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 | ||
wtext = wtext .. "| " .. ud_note(et, dual_flat_fifth, i) .. "\n" | |||
wtext = wtext .. "| " .. ud_note(et, dual_sharp_fifth, i) .. "\n" | |||
else | else | ||
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 | ||
wtext = wtext .. "| " .. additional_split[i + 2][j] .. "\n" | |||
end | end | ||
end | end | ||
end | end | ||
wtext = wtext .. "|}" | |||
return wtext | |||
return | |||
end | end | ||
return p | return p | ||