Module:MOS tunings: Difference between revisions

Ganaram inukshuk (talk | contribs)
Comments; simplify some code; removed unnecessary modules
Ganaram inukshuk (talk | contribs)
No edit summary
Line 135: Line 135:
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 search_params = {["Int Limit"] = 25, ["Tenney Height"] = 9, ["Prime Limit"] = 11}
local search_params = {["Int Limit"] = 32, ["Tenney Height"] = 9, ["Prime Limit"] = 13}
local modal_union = mos.modal_union(input_mos)
local modal_union = mos.modal_union(input_mos)
Line 218: Line 218:
return result
return result
end
function p.parse_step_ratios(unparsed)
local parsed = {}
if parsed == "Central Spectrum" then
parsed = {{4,3}, {3,2}, {5,3}, {2,1}, {5,2}, {3,1}, {4,1}}
elseif parsed == "Soft-of-basic" then
parsed = {{4,3}, {3,2}, {2,1}}
elseif parsed == "Hyposoft" then
parsed = {{3,2}, {5,3}, {2,1}}
elseif parsed == "Hypohard" then
parsed = {{2,1}, {5,2}, {3,1}}
elseif parsed == "Hard-of-basic" then
parsed = {{2,1}, {3,1}, {4,1}}
else
-- Default is the simple step ratios
parsed = tip.parse_numeric_pairs(unparsed) or {{2,1}, {3,1}, {3,2}}
end
return parsed
end
end


Line 227: Line 246:
local mos_abbrev  = frame.args["MOS Abbrev"]
local mos_abbrev  = frame.args["MOS Abbrev"]
local collapsed  = yesno(frame.args["Collapsed"], false) -- Currently does nothing
local collapsed  = yesno(frame.args["Collapsed"], false) -- Currently does nothing
local step_ratios = tip.parse_numeric_pairs(frame.args["Step Ratios"]) or (frame.args["Step Ratios"] == "Central Spectrum" and {{4,3}, {3,2}, {5,3}, {2,1}, {5,2}, {3,1}, {4,1}} or {{2,1}, {3,1}, {3,2}})
local step_ratios = p.parse_step_ratios(frame.args["Step Ratios"])
local ji_ratios  = tip.parse_numeric_pairs(frame.args["JI Ratios"]  ) or {{1,1}, {3,2}, {2,1}}
local ji_ratios  = tip.parse_numeric_pairs(frame.args["JI Ratios"]  ) or {{1,1}, {3,2}, {2,1}}