Module:MOS tunings: Difference between revisions

Ganaram inukshuk (talk | contribs)
No edit summary
Ganaram inukshuk (talk | contribs)
No edit summary
Line 82: Line 82:
if max_cents > 1200 then
if max_cents > 1200 then
local new_ratios = {}
local new_ratios = {}
local num_octaves_up = -1 + math.floor(max_cents / 1200)
local num_octaves_up = math.ceil(max_cents / 1200)
for j = 1, num_octaves_up do
for j = 2, num_octaves_up do
for i = 2, #ratios do
for i = 2, #ratios do
local num = ratios[i][1] * math.pow(2, j+1)
local num = ratios[i][1] * math.pow(2, j)
local den = ratios[i][2]
local den = ratios[i][2]