Module:Scale tree: Difference between revisions
Revert edits, changes didn't look right |
Bolded default comments, added back "generators smaller than this are proper" to appropriate mosses |
||
| Line 80: | Line 80: | ||
-- Default comments for TAMNAMS-named step ratios | -- Default comments for TAMNAMS-named step ratios | ||
local default_comments = {} | local default_comments = {} | ||
default_comments["1/1"] = "Equalized " | local mos_as_string = MOS.as_string(input_mos) | ||
default_comments["4/3"] = "Supersoft " | default_comments["1/1"] = string.format("'''Equalized %s'''", mos_as_string) | ||
default_comments["3/2"] = "Soft " | default_comments["4/3"] = string.format("'''Supersoft %s'''", mos_as_string) | ||
default_comments["5/3"] = "Semisoft " | default_comments["3/2"] = string.format("'''Soft %s'''", mos_as_string) | ||
default_comments["2/1"] = "Basic " | default_comments["5/3"] = string.format("'''Semisoft %s'''", mos_as_string) | ||
default_comments["5/2"] = "Semihard " | default_comments["2/1"] = string.format("'''Basic %s'''", mos_as_string) | ||
default_comments["3/1"] = "Hard " | default_comments["5/2"] = string.format("'''Semihard %s'''", mos_as_string) | ||
default_comments["4/1"] = "Superhard " | default_comments["3/1"] = string.format("'''Hard %s'''", mos_as_string) | ||
default_comments["1/0"] = "Collapsed " .. | default_comments["4/1"] = string.format("'''Superhard %s'''", mos_as_string) | ||
default_comments["1/0"] = string.format("'''Collapsed %s'''", mos_as_string) | |||
-- Append boundary of proper scales to basic comment, if applicable | |||
if n ~= ns then | |||
default_comments["2/1"] = default_comments["2/1"] .. "Bright generators smaller than this are proper" | |||
end | |||
-- Create table | -- Create table | ||
| Line 158: | Line 164: | ||
-- Cell for comment | -- Cell for comment | ||
-- Default comments are on their own line before custom comments | |||
local key = step_ratios[i][1] .. "/" .. step_ratios[i][2] -- The step ratio is (literally and figuratively) the key to add comments! | local key = step_ratios[i][1] .. "/" .. step_ratios[i][2] -- The step ratio is (literally and figuratively) the key to add comments! | ||
local comment = "" | local comment = "" | ||
local default_comment = default_comments[key] or "" | |||
local custom_comment = comments[key] or "" | |||
if default_comment ~= "" then | |||
comment = | comment = custom_comment | ||
else | |||
comment = | comment = default_comment .. "<br>" .. custom_comment | ||
end | end | ||
result = result .. string.format("| %s\n", comment) | result = result .. string.format("| %s\n", comment) | ||