Module:ET: Difference between revisions

Plumtree (talk | contribs)
mNo edit summary
Plumtree (talk | contribs)
mNo edit summary
Line 51: Line 51:
function p.as_string(et)
function p.as_string(et)
return et.size .. et.suffix
return et.size .. et.suffix
end
-- convert steps to a proper ratio (except that it is a float approximation)
function p.backslash_ratio(et, steps)
if et.size == 0 then
return 1
end
return rat.as_float(et.equave) ^ (steps / et.size)
end
-- convert steps to cents
function p.cents(et, steps)
steps = steps or 1
return 1200 * steps / et.size * math.log(rat.as_float(et.equave)) / math.log(2)
end
end


return p
return p