Module:ED intro: Difference between revisions
Added back edc (equal divisions of cent value) |
mNo edit summary |
||
| Line 49: | Line 49: | ||
-- Exactly or about? Round to 3 DPs | -- Exactly or about? Round to 3 DPs | ||
local | local equave_in_cents = math.log(3) * 1200 | ||
local edstep_size = equave_in_cents / math.log(2) / ed | |||
local edstep_size_rounded = utils._round(edstep_size, 3) | local edstep_size_rounded = utils._round(edstep_size, 3) | ||
local is_exact = edstep_size - edstep_size_rounded == 0 | local is_exact = edstep_size - edstep_size_rounded == 0 | ||
| Line 76: | Line 77: | ||
-- Exactly or about? Round to 3 DPs | -- Exactly or about? Round to 3 DPs | ||
local | local equave_in_cents = math.log(3/2) * 1200 | ||
local edstep_size = equave_in_cents / math.log(2) / ed | |||
local edstep_size_rounded = utils._round(edstep_size, 3) | local edstep_size_rounded = utils._round(edstep_size, 3) | ||
local is_exact = edstep_size - edstep_size_rounded == 0 | local is_exact = edstep_size - edstep_size_rounded == 0 | ||
| Line 104: | Line 106: | ||
-- Exactly or about? Round to 3 DPs | -- Exactly or about? Round to 3 DPs | ||
local | local equave_in_cents = math.log(harmonic) * 1200 | ||
local edstep_size = equave_in_cents / math.log(2) / ed | |||
local edstep_size_rounded = utils._round(edstep_size, 3) | local edstep_size_rounded = utils._round(edstep_size, 3) | ||
local is_exact = edstep_size - edstep_size_rounded == 0 | local is_exact = edstep_size - edstep_size_rounded == 0 | ||
| Line 134: | Line 137: | ||
-- Exactly or about? Round to 3 DPs | -- Exactly or about? Round to 3 DPs | ||
local | local equave_in_cents = rat.cents(ratio) | ||
local edstep_size = equave_in_cents / ed | |||
local edstep_size_rounded = utils._round(edstep_size, 3) | local edstep_size_rounded = utils._round(edstep_size, 3) | ||
local is_exact = edstep_size - edstep_size_rounded == 0 | local is_exact = edstep_size - edstep_size_rounded == 0 | ||