Module:Infobox MOS: Difference between revisions
mNo edit summary |
Attempted to simplify equal tunings section by dropping prefix (similar to scale tree on nonoctave mos pages) |
||
| Line 276: | Line 276: | ||
-- Produces simple equal tunings | -- Produces simple equal tunings | ||
function p.equal_tunings(input_mos) | function p.equal_tunings(input_mos) | ||
local input_mos = input_mos or mos.new(5, 2) | local input_mos = input_mos or mos.new(5, 2, rat.new(9,4)) | ||
local bright_gen = mos.bright_gen(input_mos) | local bright_gen = mos.bright_gen(input_mos) | ||
| Line 319: | Line 319: | ||
local ed_as_string = et.as_string(ed) | local ed_as_string = et.as_string(ed) | ||
local gen_in_steps = et.backslash_display( | local ed_no_prefix = et.new(ed_size, input_mos.equave, "") | ||
local ed_as_string_no_prefix = et.as_string(ed_no_prefix) | |||
local gen_in_steps = et.backslash_display(ed_no_prefix, gen_size) | |||
local gen_in_cents = et.cents(ed, gen_size) | local gen_in_cents = et.cents(ed, gen_size) | ||
| Line 327: | Line 330: | ||
table.insert(equal_tunings, { caption, text }) | table.insert(equal_tunings, { caption, text }) | ||
end | end | ||
return equal_tunings | |||
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 | |||
return { section_header, equal_tunings } | |||
end | end | ||
| Line 355: | Line 368: | ||
table.insert(sections, {related_scales_header, related_scales_section}) | table.insert(sections, {related_scales_header, related_scales_section}) | ||
local | local equal_tunings = p.equal_tunings(tuning_parsed) | ||
table.insert(sections, equal_tunings) | |||
table.insert(sections, | |||
local adjacent_links = p.adjacent_links(tuning_parsed) | local adjacent_links = p.adjacent_links(tuning_parsed) | ||