Module:MOS degrees: Difference between revisions

Ganaram inukshuk (talk | contribs)
m Table is functional, but formatting is missing; added TODO in comments (on line 310)
Ganaram inukshuk (talk | contribs)
Cent values are rounded to 1 decimal place now
Line 274: Line 274:
-- plus the augmented root, then going up x+y-1 more gens reaches each
-- plus the augmented root, then going up x+y-1 more gens reaches each
-- augmented degree. Same is true for going down to get minor/dim degrees.
-- augmented degree. Same is true for going down to get minor/dim degrees.
local asc_chain_length = (input_mos.nL + input_mos.ns) * 2
local asc_chain_length = input_mos.nL * 2 + input_mos.ns
local des_chain_length = (input_mos.nL + input_mos.ns) * 2
local des_chain_length = input_mos.nL * 2 + input_mos.ns
-- Get the genchains
-- Get the genchains
Line 331: Line 331:
local estep_count = ((j - 1) * esteps_per_bright_gen) % esteps_per_period + (i - 1) * esteps_per_period
local estep_count = ((j - 1) * esteps_per_bright_gen) % esteps_per_period + (i - 1) * esteps_per_period
-- Find the cent value
-- Find the cent value, rounded
local cent_value = et.cents(et_for_mos, estep_count)
local cent_value = et.cents(et_for_mos, estep_count)
cent_value = utils._round_dec(cent_value, 1)
-- Add the row
-- Add the row
Line 338: Line 339:
result = result .. "| " .. degree_name .. "\n"
result = result .. "| " .. degree_name .. "\n"
result = result .. "| " .. estep_count .. "\n"
result = result .. "| " .. estep_count .. "\n"
result = result .. "| " .. cent_value  .. "\n"
result = result .. "| " .. cent_value  .. "¢\n"
result = result .. "| " .. note_name  .. "\n"
result = result .. "| " .. note_name  .. "\n"
end
end
Line 374: Line 375:
-- Find the cent value
-- Find the cent value
local cent_value = et.cents(et_for_mos, estep_count)
local cent_value = et.cents(et_for_mos, estep_count)
cent_value = utils._round_dec(cent_value, 1)
-- Add the row
-- Add the row
Line 379: Line 381:
result = result .. "| " .. degree_name .. "\n"
result = result .. "| " .. degree_name .. "\n"
result = result .. "| " .. estep_count .. "\n"
result = result .. "| " .. estep_count .. "\n"
result = result .. "| " .. cent_value  .. "\n"
result = result .. "| " .. cent_value  .. "¢\n"
result = result .. "| " .. note_name  .. "\n"
result = result .. "| " .. note_name  .. "\n"
end
end