Module:ED intro: Difference between revisions

Ganaram inukshuk (talk | contribs)
Added back edc (equal divisions of cent value)
Ganaram inukshuk (talk | contribs)
mNo edit summary
Line 49: Line 49:
-- Exactly or about? Round to 3 DPs
-- Exactly or about? Round to 3 DPs
local edstep_size = math.log(3) * 1200 / math.log(2) / ed
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 edstep_size = math.log(3/2) * 1200 / math.log(2) / ed
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 edstep_size = math.log(harmonic) * 1200 / math.log(2) / ed
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 edstep_size = rat.cents(ratio) / ed
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