Module:Infobox MOS: Difference between revisions

Ganaram inukshuk (talk | contribs)
m Updated todo
Ganaram inukshuk (talk | contribs)
m Simplified code, adjusted heading names
Line 139: Line 139:
end
end
local section_header = "Scale structure"
local section_entries = {
local section_entries = {
{string.format("<b>%s</b>", section_header)},
{"[[Step pattern]]", brightest_mode},
{"[[Step pattern]]", brightest_mode},
{"[[Equave]]", string.format("%s (%.1f¢)", equave_as_string, equave_in_cents)},
{"[[Equave]]", string.format("%s (%.1f¢)", equave_as_string, equave_in_cents)},
{"[[Period]]", string.format("%s (%.1f¢)", period_as_string, period_in_cents)}
{"[[Period]]", string.format("%s (%.1f¢)", period_as_string, period_in_cents)}
}
}
 
local section_header = "Scale structure"
return section_entries
local section = { {string.format("<b>%s</b>", section_header)} }
p.concatenate_tables(section, section_entries)
return section
end
end


Line 190: Line 188:
local section_entries = {
local section_entries = {
{string.format("<b>%s</b>", section_header)},
{"[[Bright]]", string.format("%s to %s (%.1f¢ to %.1f¢)", bright_min_in_steps, bright_max_in_steps, bright_min_in_cents, bright_max_in_cents)},
{"[[Bright]]", string.format("%s to %s (%.1f¢ to %.1f¢)", bright_min_in_steps, bright_max_in_steps, bright_min_in_cents, bright_max_in_cents)},
{"[[Dark]]", string.format("%s to %s (%.1f¢ to %.1f¢)", dark_min_in_steps, dark_max_in_steps, dark_min_in_cents, dark_max_in_cents)},
{"[[Dark]]", string.format("%s to %s (%.1f¢ to %.1f¢)", dark_min_in_steps, dark_max_in_steps, dark_min_in_cents, dark_max_in_cents)},
}
}
local section = { {string.format("<b>%s</b>", section_header)} }
return section_entries
p.concatenate_tables(section, section_entries)
return section
end
end


Line 232: Line 229:
local section_entries = {
local section_entries = {
{string.format("<b>%s</b>", section_header)},
{"Large", string.format("%s to %s (%.1f¢ to %.1f¢)", large_step_min_in_steps, large_step_max_in_steps, large_step_min_in_cents, large_step_max_in_cents)},
{"Large", string.format("%s to %s (%.1f¢ to %.1f¢)", large_step_min_in_steps, large_step_max_in_steps, large_step_min_in_cents, large_step_max_in_cents)},
{"Small", string.format("%s to %s (%.1f¢ to %.1f¢)", small_step_min_in_steps, large_step_min_in_steps, small_step_min_in_cents, large_step_min_in_cents)}
{"Small", string.format("%s to %s (%.1f¢ to %.1f¢)", small_step_min_in_steps, large_step_min_in_steps, small_step_min_in_cents, large_step_min_in_cents)}
}
}
local section = { {string.format("<b>%s</b>", section_header)} }
return section_entries
p.concatenate_tables(section, section_entries)
return section
end
end


Line 372: Line 368:
sister_scalesig = sister_scalesig .. " (self)"
sister_scalesig = sister_scalesig .. " (self)"
end
end
 
local section_header = "Related MOS scales"
local section_entries = {
local section_entries = {
{string.format("<b>%s</b>", section_header)},
{"[[Operations_on_MOSes#Parent_MOS | Parent]]", parent_scalesig},
{"[[Operations_on_MOSes#Parent_MOS | Parent]]", parent_scalesig},
{"[[Operations_on_MOSes#Sister_MOS | Sister]]", sister_scalesig},
{"[[Operations_on_MOSes#Sister_MOS | Sister]]", sister_scalesig},
Line 379: Line 377:
}
}
local section_header = "Related scales"
return section_entries
local section = { {string.format("<b>%s</b>", section_header)} }
p.concatenate_tables(section, section_entries)
return section
end
end


Line 422: Line 416:
}
}
local section_entries = {}
local section_header = "Equal tunings"
if rat.eq(input_mos.equave, 3) then
section_header = section_header .. " in steps of edt"
elseif rat.eq(input_mos.equave, rat.new(3,2)) then
section_header = section_header .. " in steps of edf"
elseif not rat.eq(input_mos.equave, 2) then
section_header = string.format("%s in steps of ed%s", section_header, rat.as_ratio(input_mos.equave))
end
local section_entries = {
{string.format("<b>%s</b>", section_header)},
}
for i = 1, #step_ratios do
for i = 1, #step_ratios do
local step_ratio = step_ratios[i]
local step_ratio = step_ratios[i]
Line 443: Line 448:
table.insert(section_entries, { caption, text })
table.insert(section_entries, { caption, text })
end
end
 
local section_header = "Equal tunings"
return section_entries
if rat.eq(input_mos.equave, 3) then
section_header = section_header .. " in steps of edt"
elseif rat.eq(input_mos.equave, rat.new(3,2)) then
section_header = section_header .. " in steps of edf"
elseif not rat.eq(input_mos.equave, 2) then
section_header = string.format("%s in steps of ed%s", section_header, rat.as_ratio(input_mos.equave))
end
local section = { {string.format("<b>%s</b>", section_header)} }
p.concatenate_tables(section, section_entries)
return section
end
end