Module:Infobox MOS: Difference between revisions
No edit summary |
Added step ratio range for named tamnams ancestors to see how it looks |
||
| Line 333: | Line 333: | ||
local ancestor_long_scalesig = mos.as_long_string(ancestor_mos) | local ancestor_long_scalesig = mos.as_long_string(ancestor_mos) | ||
local ancestor_name = mos.tamnams_name[ancestor_scalesig] | local ancestor_name = mos.tamnams_name[ancestor_scalesig] | ||
-- Helper code for finding mos ancestor and relation to it | |||
local num1 = lg_chunk.nL + lg_chunk.ns | |||
local den1 = sm_chunk.nL + sm_chunk.ns | |||
local num2 = lg_chunk.nL | |||
local den2 = sm_chunk.nL | |||
local first_ancestor_step_ratio = "" | |||
local second_ancestor_step_ratio = "" | |||
if num1/den1 < num2/den2 then | |||
first_ancestor_step_ratio = string.format("%d:%d", num1, den1) | |||
second_ancestor_step_ratio = string.format("%d:%d", num2, den2) | |||
else | |||
first_ancestor_step_ratio = string.format("%d:%d", num2, den2) | |||
second_ancestor_step_ratio = string.format("%d:%d", num1, den1) | |||
end | |||
-- Step ratio range as text | |||
local step_ratio_range = string.format("%s to %s", first_ancestor_step_ratio, second_ancestor_step_ratio) | |||
-- Step ratio range as a named range | |||
local named_range = step_ratio_range | |||
if step_ratio_range == "1:1 to 2:1" then | |||
named_range = named_range .. " (soft-of-basic)" | |||
elseif step_ratio_range == "2:1 to 1:0" then | |||
named_range = named_range .. " (hard-of-basic)" | |||
elseif step_ratio_range == "1:1 to 3:2" then | |||
named_range = named_range .. " (soft)" | |||
elseif step_ratio_range == "3:2 to 2:1" then | |||
named_range = named_range .. " (hyposoft)" | |||
elseif step_ratio_range == "2:1 to 3:1" then | |||
named_range = named_range .. " (hypohard)" | |||
elseif step_ratio_range == "3:1 to 1:0" then | |||
named_range = named_range .. " (hard)" | |||
elseif step_ratio_range == "1:1 to 4:3" then | |||
named_range= named_range .. " (ultrasoft)" | |||
elseif step_ratio_range == "4:3 to 3:2" then | |||
named_range = named_range .. " ((parasoft)" | |||
elseif step_ratio_range == "3:2 to 5:3" then | |||
named_range = named_range .. " (quasisoft)" | |||
elseif step_ratio_range == "5:3 to 2:1" then | |||
named_range = named_range .. " (minisoft)" | |||
elseif step_ratio_range == "2:1 to 5:2" then | |||
named_range = named_range .. " (minihard)" | |||
elseif step_ratio_range == "5:2 to 3:1" then | |||
named_range = named_range .. " (quasihard)" | |||
elseif step_ratio_range == "3:1 to 4:1" then | |||
named_range = named_range .. " (parahard)" | |||
elseif step_ratio_range == "4:1 to 1:0" then | |||
named_range = named_range .. " (ultrahard)" | |||
end | |||
local ancestor_entry = string.format("[[%s | %s]]", ancestor_long_scalesig, ancestor_scalesig) | local ancestor_entry = string.format("[[%s | %s]]", ancestor_long_scalesig, ancestor_scalesig) | ||
| Line 341: | Line 391: | ||
section_entries = { | section_entries = { | ||
{string.format("<b>%s</b>", section_header)}, | {string.format("<b>%s</b>", section_header)}, | ||
{"Descends from", ancestor_entry} | {"Descends from", ancestor_entry}; | ||
{"Required step ratio range", string.format("%s", named_range)} | |||
} | } | ||
end | end | ||