Module:Harmonics in edo: Difference between revisions
No edit summary |
No edit summary |
||
| Line 7: | Line 7: | ||
local tabs = {'! | Error ([[cent|¢]]) '} | local tabs = {'! | Error ([[cent|¢]]) '} | ||
local tdeg = {'! | Steps'} | local tdeg = {'! | Steps'} | ||
local fmt_approx = string.format(' %%.%df', prec) | |||
local fmt_abs = string.format(' %%+.%df', prec) | local fmt_abs = string.format(' %%+.%df', prec) | ||
local fmt_rel = ' %+.0f' | local fmt_rel = ' %+.0f' | ||
| Line 14: | Line 15: | ||
ev = math.floor(v + .5) | ev = math.floor(v + .5) | ||
table.insert(todd, ' ' .. p .. '/' .. 2^math.floor(s) ) | table.insert(todd, ' ' .. p .. '/' .. 2^math.floor(s) ) | ||
table.insert(tapprox, string.format( | table.insert(tapprox, string.format(fmt_approx, 1200*(ev % edo)/edo) ) | ||
table.insert(tabs, string.format(fmt_abs, 1200 * (ev - v ) / edo)) | table.insert(tabs, string.format(fmt_abs, 1200 * (ev - v ) / edo)) | ||
table.insert(tdeg, ' ' .. ev % edo .. ' ') | table.insert(tdeg, ' ' .. ev % edo .. ' ') | ||