Module:Infobox MOS: Difference between revisions
mNo edit summary |
Simplified equal tunings helper function |
||
| Line 481: | Line 481: | ||
-- 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(5,3)) | ||
local bright_gen = mos.bright_gen(input_mos) | local bright_gen = mos.bright_gen(input_mos) | ||
local step_ratios = { | local step_ratios = { | ||
| Line 500: | Line 495: | ||
{ 4, 1 }, | { 4, 1 }, | ||
{ 1, 0 } | { 1, 0 } | ||
} | } | ||
| Line 531: | Line 514: | ||
local step_ratio = step_ratios[i] | local step_ratio = step_ratios[i] | ||
local ed = mos.mos_to_et(input_mos, step_ratio) | |||
local ed = | |||
local ed_as_string = et.as_string(ed) | local ed_as_string = et.as_string(ed) | ||
local | local gen_in_steps = mos.bright_gen_to_et_steps(input_mos, step_ratio) .. "\\" .. ed.size | ||
local gen_in_cents = mos.bright_gen_to_cents(input_mos, step_ratio) | |||
local gen_in_cents = | |||
local caption = string.format("[[%s]] (L:s = %d:%d)", | local caption = string.format("[[%s]] (L:s = %d:%d)", tamnams.lookup_step_ratio(step_ratio), step_ratio[1], step_ratio[2]) | ||
local text = string.format("[[%s | %s]] (%.1f¢)", ed_as_string, gen_in_steps, gen_in_cents) | local text = string.format("[[%s | %s]] (%.1f¢)", ed_as_string, gen_in_steps, gen_in_cents) | ||