Module:Ups and downs sharpness: Difference between revisions

Tristanbay (talk | contribs)
Fixed wrong notation issue hopefully
Tristanbay (talk | contribs)
changed rounding method
Line 22: Line 22:
for i = 1, sharp * 2 + 1 do
for i = 1, sharp * 2 + 1 do
tab = tab .. "|"
tab = tab .. "|"
if ((i - (sharp * math.floor(i / sharp))) / sharp) > math.floor(((i - (sharp * math.floor(i / sharp))) / sharp) + 0.5) then
if ((i - (sharp * math.floor(i / sharp))) / sharp) > math.ceil(((i - (sharp * math.floor(i / sharp))) / sharp) - 0.5) then
if (i - (sharp * math.floor(i / sharp))) % 5 == 4 then
if (i - (sharp * math.floor(i / sharp))) % 5 == 4 then
tab = tab .. "down quip "
tab = tab .. "down quip "
Line 45: Line 45:
end
end
end
end
if math.floor((i / sharp) + 0.5) == 1 then
if math.ceil((i / sharp) - 0.5) == 1 then
tab = tab .. "sharp "
tab = tab .. "sharp "
elseif math.floor((i / sharp) + 0.5) == 2 then
elseif math.ceil((i / sharp) - 0.5) == 2 then
tab = tab .. "doublesharp "
tab = tab .. "doublesharp "
end
end
Line 55: Line 55:
for i = 1, sharp * 2 + 1 do
for i = 1, sharp * 2 + 1 do
tab = tab .. "|"
tab = tab .. "|"
if ((i - (sharp * math.floor(i / sharp))) / sharp) > math.floor(((i - (sharp * math.floor(i / sharp))) / sharp) + 0.5) then
if ((i - (sharp * math.floor(i / sharp))) / sharp) > math.ceil(((i - (sharp * math.floor(i / sharp))) / sharp) - 0.5) then
if (i - (sharp * math.floor(i / sharp))) % 5 == 4 then
if (i - (sharp * math.floor(i / sharp))) % 5 == 4 then
tab = tab .. "up quid "
tab = tab .. "up quid "
Line 78: Line 78:
end
end
end
end
if math.floor((i / sharp) + 0.5) == 1 then
if math.ceil((i / sharp) - 0.5) == 1 then
tab = tab .. "flat "
tab = tab .. "flat "
elseif math.floor((i / sharp) + 0.5) == 2 then
elseif math.ceil((i / sharp) - 0.5) == 2 then
tab = tab .. "doubleflat "
tab = tab .. "doubleflat "
end
end