Module:Interval table: Difference between revisions
ArrowHead294 (talk | contribs) m Alphabetise dependencies |
ArrowHead294 (talk | contribs) mNo edit summary |
||
| Line 97: | Line 97: | ||
local ratios_list = get_ratios_list((20 + (et.size / 4)), 12, 47) | local ratios_list = get_ratios_list((20 + (et.size / 4)), 12, 47) | ||
result = t_head .. | |||
"|-\n" .. | "|-\n" .. | ||
"! Steps\n" .. | "! Steps\n" .. | ||
| Line 103: | Line 103: | ||
if rat.eq(et.equave, 3) then | if rat.eq(et.equave, 3) then | ||
result = result .. "! [[Hekt]]s\n" | |||
end | end | ||
result = result .. | |||
"! Approximate ratios\n" | "! Approximate ratios\n" | ||
if rat.eq(et.equave, 2) then | if rat.eq(et.equave, 2) then | ||
if dual_fifth then | if dual_fifth then | ||
result = result | |||
.. string.format("! [[Ups and downs notation]]<br />(Dual flat fifth %s\\%s)\n", dual_flat_fifth, et.size) | .. string.format("! [[Ups and downs notation]]<br />(Dual flat fifth %s\\%s)\n", dual_flat_fifth, et.size) | ||
.. string.format("! [[Ups and downs notation]]<br />(Dual sharp fifth %s\\%s)\n", dual_sharp_fifth, et.size) | .. string.format("! [[Ups and downs notation]]<br />(Dual sharp fifth %s\\%s)\n", dual_sharp_fifth, et.size) | ||
else | else | ||
result = result .. "! [[Ups and downs notation]]\n" | |||
end | end | ||
end | end | ||
| Line 120: | Line 120: | ||
if #additional_split > 0 then | if #additional_split > 0 then | ||
for i = 1, #additional_split[1] do | for i = 1, #additional_split[1] do | ||
result = result .. string.format("! %s\n", additional_split[1][i]) | |||
end | end | ||
end | end | ||
| Line 128: | Line 128: | ||
if decimalPlaces < 1 then decimalPlaces = 1 end | if decimalPlaces < 1 then decimalPlaces = 1 end | ||
for i = 0, et.size do | for i = 0, et.size do | ||
result = result .. "|-\n" | |||
.. string.format("| %s\n", i) | .. string.format("| %s\n", i) | ||
.. string.format("| %s\n", utils._round_dec(ET.cents(et, i), decimalPlaces)) | .. string.format("| %s\n", utils._round_dec(ET.cents(et, i), decimalPlaces)) | ||
if rat.eq(et.equave, 3) then | if rat.eq(et.equave, 3) then | ||
result = result .. string.format("| %s\n", utils._round_dec(ET.hekts(et, i), decimalPlaces)) | |||
end | end | ||
result = result .. "| " | |||
for j = 1, #ratios_list do | for j = 1, #ratios_list do | ||
| Line 148: | Line 148: | ||
< (1200 / (math.log(et.size) * (et.size + 5))) | < (1200 / (math.log(et.size) * (et.size + 5))) | ||
then | then | ||
result = result .. string.format("[[%s/%s]], ", ratios_list[j][1], ratios_list[j][2]) | |||
end | end | ||
end | end | ||
-- ??? | -- ??? | ||
if | if result:sub(-2, -1) == "| " then | ||
result = result .. "\n" | |||
else | else | ||
result = result: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 | ||
result = result .. string.format("| %s\n", ud_note(et, dual_flat_fifth, i)) | |||
result = result .. string.format("| %s\n", ud_note(et, dual_sharp_fifth, i)) | |||
else | else | ||
result = result .. string.format("| %s\n", ud_note(et, fifth, i)) | |||
end | end | ||
end | end | ||
| Line 170: | Line 170: | ||
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 | ||
result = result .. string.format("| %s\n", additional_split[i + 2][j]) | |||
end | end | ||
end | end | ||
end | end | ||
result = result .. "|}" | |||
if debugg == true then | |||
result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" | |||
end | |||
return frame:preprocess(result) | |||
end | end | ||
return p | return p | ||