Module:MOS degrees: Difference between revisions
No edit summary |
No edit summary |
||
| Line 125: | Line 125: | ||
local esteps_per_bright_gen = bright_gen['L'] * step_ratio[1] + bright_gen['s'] * step_ratio[2] | local esteps_per_bright_gen = bright_gen['L'] * step_ratio[1] + bright_gen['s'] * step_ratio[2] | ||
local esteps_per_dark_gen = esteps_per_period - esteps_per_bright_gen | local esteps_per_dark_gen = esteps_per_period - esteps_per_bright_gen | ||
-- How many decimal places to round to? | |||
local round = 1 | |||
-- Calculate the entries for each row | -- Calculate the entries for each row | ||
local rows = {} | local rows = {} | ||
for i = 1, periods_per_equave do | for i = 1, periods_per_equave do | ||
-- Add | -- Add step/cent values for ascending chain | ||
for j = 1, asc_chain_length do | for j = 1, asc_chain_length do | ||
| Line 136: | Line 139: | ||
-- Find the cent value, rounded | -- Find the cent value, rounded | ||
local cent_value = et.cents(et_for_mos, estep_count) | local cent_value = utils._round_dec(et.cents(et_for_mos, estep_count), round) | ||
-- Add the row | -- Add the row | ||
| Line 151: | Line 153: | ||
end | end | ||
-- Add | -- Add step/cent values for ascending chain | ||
for j = des_chain_length, stop_value, -1 do | for j = des_chain_length, stop_value, -1 do | ||
| Line 158: | Line 160: | ||
-- Find the cent value | -- Find the cent value | ||
local cent_value = et.cents(et_for_mos, estep_count) | local cent_value = utils._round_dec(et.cents(et_for_mos, estep_count), round) | ||
cent_value = utils._round_dec( | |||
-- If the cent value is 0, say it's for the equave instead | |||
if cent_value == 0 then | |||
cent_value = utils._round_dec(rat.cents(input_mos.equave), round) | |||
end | |||
-- Add the row | -- Add the row | ||