Module:JI ratios in ED: Difference between revisions

Ganaram inukshuk (talk | contribs)
Added back unison (unison should always be part of the first column of the first row)
Ganaram inukshuk (talk | contribs)
Fixed non-2/1 equaves not having the keyword "just"
Line 37: Line 37:


function p.find_ratios_in_ed(input_et, primes, tenney_height, denominator_limit)
function p.find_ratios_in_ed(input_et, primes, tenney_height, denominator_limit)
local input_et = input_et or et.parse("12edo")
local input_et = input_et or et.parse("13ed9/4")
local primes = primes or { 2, 3, 5, 7 }
local primes = primes or { 2, 3, 5, 7 }
local tenney_height = tenney_height or 10
local tenney_height = tenney_height or 10
Line 78: Line 78:
-- Table headers
-- Table headers
local step_in_cents = et.cents(input_et, step)
local step_in_cents = (step / steps) * rat.cents(equave)
result = result .. string.format('| %d\n', step)
result = result .. string.format('| %d\n', step)
result = result .. string.format('| %.3f\n', step_in_cents)
result = result .. string.format('| %.3f\n', step_in_cents)