Module:MOS tunings: Difference between revisions

Ganaram inukshuk (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 63: Line 63:
and step_ratios[2][1] == 2 and step_ratios[2][2] == 1
and step_ratios[2][1] == 2 and step_ratios[2][2] == 1
and step_ratios[3][1] == 3 and step_ratios[3][2] == 1 then
and step_ratios[3][1] == 3 and step_ratios[3][2] == 1 then
return "Simple Tunings", {{2,1}, {3,1}, {3,2}}
return "Simple Tunings", {{2, 1}, {3, 1}, {3, 2}}
end
end
end
end
Line 139: Line 139:
local mos_prefix = mos_prefix or "mos"
local mos_prefix = mos_prefix or "mos"
local mos_abbrev = mos_abbrev or "m"
local mos_abbrev = mos_abbrev or "m"
local step_ratios = step_ratios or {{2,1}, {3,1}, {3,2}}
local step_ratios = step_ratios or {{2, 1}, {3, 1}, {3, 2}}
local ji_ratios = ji_ratios or {}
local ji_ratios = ji_ratios or {}
local is_collapsed = is_collapsed == true
local is_collapsed = is_collapsed == true
Line 158: Line 158:
-- Table caption
-- Table caption
result = result .. string.format("|+ style=\"font-size: 105%%; white-space: nowrap;\" | %s of %s\n", step_ratio_range, scale_sig)
result = result .. "|+ style=\"font-size: 105%; white-space: nowrap;\" | " .. string.format("%s of %s\n", step_ratio_range, scale_sig)
-- First row of headers
-- First row of headers
Line 218: Line 218:
-- Ratios link to their respective pages, and are comma-delimited.
-- Ratios link to their respective pages, and are comma-delimited.
local ratios_as_text = jira.ratios_as_text(sorted_ji_ratios[i], true)
local ratios_as_text = jira.ratios_as_text(sorted_ji_ratios[i], true)
result = result .. string.format("|| style=\"text-align: left\" | %s", ratios_as_text)
result = result .. "|| style=\"text-align: left;\" | " .. string.format("%s", ratios_as_text)
end
end
Line 240: Line 240:
local lookup_table = {
local lookup_table = {
["Central Spectrum"] = {{4,3}, {3,2}, {5,3}, {2,1}, {5,2}, {3,1}, {4,1}},
["Central Spectrum"] = {{4, 3}, {3, 2}, {5, 3}, {2, 1}, {5, 2}, {3, 1}, {4, 1}},
["Simple Tunings"]  = {{2,1}, {3,1}, {3,2}},
["Simple Tunings"]  = {{2, 1}, {3, 1}, {3, 2}},
["Soft-of-basic"]    = {{4,3}, {3,2}, {2,1}},
["Soft-of-basic"]    = {{4, 3}, {3, 2}, {2, 1}},
["Ultrasoft"]        = {{6,5}, {5,4}, {4,3}},
["Ultrasoft"]        = {{6, 5}, {5, 4}, {4, 3}},
["Parasoft"] = {{4,3}, {7,5}, {3,2}},
["Parasoft"] = {{4, 3}, {7, 5}, {3, 2}},
["Quasisoft"]        = {{3,2}, {8,5}, {5,3}},
["Quasisoft"]        = {{3, 2}, {8, 5}, {5, 3}},
["Minisoft"]        = {{5,3}, {7,4}, {2,1}},
["Minisoft"]        = {{5, 3}, {7, 4}, {2, 1}},
["Hyposoft"]        = {{3,2}, {5,3}, {2,1}},
["Hyposoft"]        = {{3, 2}, {5, 3}, {2, 1}},
["Hypohard"]        = {{2,1}, {5,2}, {3,1}},
["Hypohard"]        = {{2, 1}, {5, 2}, {3, 1}},
["Minihard"]        = {{2,1}, {7,3}, {5,2}},
["Minihard"]        = {{2, 1}, {7, 3}, {5, 2}},
["Quasihard"]        = {{5,2}, {8,3}, {3,1}},
["Quasihard"]        = {{5, 2}, {8, 3}, {3, 1}},
["Parahard"]        = {{3,1}, {7,2}, {4,1}},
["Parahard"]        = {{3, 1}, {7, 2}, {4, 1}},
["Ultrahard"]        = {{4,1}, {5,1}, {6,1}},
["Ultrahard"]        = {{4, 1}, {5, 1}, {6, 1}},
["Hard-of-basic"]    = {{2,1}, {3,1}, {4,1}},
["Hard-of-basic"]    = {{2, 1}, {3, 1}, {4, 1}},
}
}
Line 306: Line 306:
local ji_ratios, search_params = p.parse_ji_ratios(frame.args["JI Ratios"], equave_in_cents)
local ji_ratios, search_params = p.parse_ji_ratios(frame.args["JI Ratios"], equave_in_cents)
local search_params_footnote = "<small>" .. jira.search_param_footnotes(search_params) .. "</small>"
local search_params_footnote = "<span style=\"font-size: 0.75em;\">" .. jira.search_param_footnotes(search_params) .. "</span>"


return p._mos_tunings(input_mos, mos_prefix, mos_abbrev, step_ratios, ji_ratios, is_collapsed) .. search_params_footnote
return p._mos_tunings(input_mos, mos_prefix, mos_abbrev, step_ratios, ji_ratios, is_collapsed) .. search_params_footnote
Line 312: Line 312:


function p.tester()
function p.tester()
local range, ratios = p.preprocess_step_ratios({ {7,1}, {3,1}, {2,1} })
local range, ratios = p.preprocess_step_ratios({{7, 1}, {3, 1}, {2, 1}})
local input_mos = mos.parse("9L 4s<7/2>")
local input_mos = mos.parse("9L 4s<7/2>")