Module:Ups and downs sharpness: Difference between revisions

Tristanbay (talk | contribs)
Continued work on module, still not finished
Tristanbay (talk | contribs)
removed function for drops and lift calculation (still unfinished)
Line 6: Line 6:
local function sharp_n(edo)
local function sharp_n(edo)
return (7 * math.floor((edo * math.log(3) / math.log(2)) + 0.5)) - (11 * edo) -- mapping of augmented unison
return (7 * math.floor((edo * math.log(3) / math.log(2)) + 0.5)) - (11 * edo) -- mapping of augmented unison
end
-- calculate amount of steps for up/down
local function comma_n(edo)
if edo < 66 then
return 1
elseif edo == 129 then
return 3
else -- mapping of 81/80
return math.max((4 * math.floor((edo * math.log(3) / math.log(2)) + 0.5)) - math.floor((edo * math.log(5) / math.log(2)) + 0.5) - (4 * edo), 1)
end
end
end


Line 26: Line 15:
local tflat = "|-\n! Flat symbol"
local tflat = "|-\n! Flat symbol"
for i=1, sharp*2 do
for i=1, (sharp*2+1) do
if i % sharp == 0 then
if i % sharp == 0 then
table.insert(tlabel, "'''" .. i .. "'''")
table.insert(tlabel, "'''" .. i .. "'''")