Module:Scale tree: Difference between revisions
m Trying to make the table less cluttered |
Made output less cluttered, used _round_dec for rounding instead |
||
| Line 85: | Line 85: | ||
-- Table headers | -- Table headers | ||
-- There are | -- There are 6 columns: | ||
-- - ED | -- - Steps of ED | ||
-- - Bright | -- - Bright and dark gens in cents | ||
-- - Step ratio and hardness | -- - Step ratio and hardness | ||
-- - Comments | -- - Comments | ||
result = '{| class="wikitable"\n' | result = '{| class="wikitable"\n' | ||
result = result .. '|+\n' | result = result .. '|+\n' | ||
result = result .. '! rowspan="2" |ED\n' | result = result .. '! rowspan="2" |Steps of ED\n' | ||
result = result .. '! colspan="2" | | result = result .. '! colspan="2" |Cents\n' | ||
result = result .. '! colspan="2" |Step ratio\n' | result = result .. '! colspan="2" |Step ratio\n' | ||
result = result .. '! rowspan="2" |Comments\n' | result = result .. '! rowspan="2" |Comments\n' | ||
result = result .. '|-\n' | result = result .. '|-\n' | ||
result = result .. '! | result = result .. '!Bright gen\n' | ||
result = result .. '! | result = result .. '!Dark gen\n' | ||
result = result .. '!L:s\n' | result = result .. '!L:s\n' | ||
result = result .. '!Hardness\n' | result = result .. '!Hardness\n' | ||
| Line 135: | Line 131: | ||
local l_s = "→ ∞" | local l_s = "→ ∞" | ||
if not (step_ratio[1] == 1 and step_ratio[2] == 0) then | if not (step_ratio[1] == 1 and step_ratio[2] == 0) then | ||
l_s = u. | l_s = u._round_dec(step_ratio[1] / step_ratio[2], 3) | ||
end | end | ||
| Line 141: | Line 137: | ||
result = result .. "|-\n" | result = result .. "|-\n" | ||
-- ET | -- Steps in ET | ||
result = result .. "|[[" .. ET.as_string(et) .. "]]\n" | result = result .. "|[[" .. ET.as_string(et) .. "|" .. generator_steps .. ET.backslash_modifier(et) .. "]]\n" | ||
-- Bright generator in | -- Bright generator in cents | ||
result = result .. "|" .. u._round_dec(math.log(rat.as_float(et.equave)^(generator_steps / et.size))/math.log(2) * 1200, 3) .. "\n" | |||
result = result .. "|" .. u. | |||
-- Dark generator in | -- Dark generator in cents | ||
result = result .. "|" .. u._round_dec(dark_generator_cents, 3) .. "\n" -- Round to 3 places | result = result .. "|" .. u._round_dec(dark_generator_cents, 3) .. "\n" -- Round to 3 places | ||