Module:MOS tunings: Difference between revisions

Ganaram inukshuk (talk | contribs)
Added checks for hard/soft-of-basic without needing the boundary points of 1:0 or 1:1
Ganaram inukshuk (talk | contribs)
If a step ratio is named, the ratio it represents is also displayed
Line 190: Line 190:
-- Headers for tunings; these span two cols
-- Headers for tunings; these span two cols
for i = 1, #step_ratios do
for i = 1, #step_ratios do
local step_ratio_as_text = tamnams.lookup_step_ratio(step_ratios[i]) or string.format("%s:%s", step_ratios[i][1], step_ratios[i][2])
local step_ratio_as_text = tamnams.lookup_step_ratio(step_ratios[i])
step_ratio_as_text = p.capitalize_first(step_ratio_as_text)
if step_ratio_as_text == nil then
step_ratio_as_text = string.format("%s:%s", step_ratios[i][1], step_ratios[i][2])
else
step_ratio_as_text = p.capitalize_first(step_ratio_as_text) .. string.format(" (%s:%s)", step_ratios[i][1], step_ratios[i][2])
end
local et_as_string = et.as_string(mos.mos_to_et(input_mos, step_ratios[i]))
local et_as_string = et.as_string(mos.mos_to_et(input_mos, step_ratios[i]))
local header_text = string.format("%s<br>%s", step_ratio_as_text, et_as_string)
local header_text = string.format("%s<br>%s", step_ratio_as_text, et_as_string)
result = result .. string.format("! colspan=\"2\" | %s\n", header_text)
result = result .. string.format("! colspan=\"2\" | %s\n", header_text)