Module:Temperament data/Badness testing: Difference between revisions

CompactStar (talk | contribs)
No edit summary
CompactStar (talk | contribs)
No edit summary
Line 334: Line 334:
end
end
end
end
c = c/(#mapping * #mapping[1])
c = c/(#(mapping) * #(mapping[1]))
mw.logObject(c)
local te_generator = get_te_generator(subgroup, comma_matrix, generators)
local te_generator = get_te_generator(subgroup, comma_matrix, generators)
local te_tuning = matmul(te_generator, mapping)
local te_tuning = matmul(te_generator, mapping)
local e = 0.0
local e = 0.0
for i = 1, #(te_tuning[1]) do
for i = 1, #(te_tuning[1]) do
-- mw.logObject(te_tuning)
-- mw.logObject((te_tuning[1][i] * 1200) - ((math.log(subgroup[i])/math.log(2)) * 1200))
e = e + math.abs((te_tuning[1][i] * 1200) - ((math.log(subgroup[i])/math.log(2)) * 1200))
e = e + math.abs((te_tuning[1][i] * 1200) - ((math.log(subgroup[i])/math.log(2)) * 1200))
end
end
e = e/#(te_tuning[1])
e = e/#(te_tuning[1])
local usb = c * e
local usb = c * e
result = result .. "\n\nUSB: " .. u._round(usb, 7)
result = result .. "USB: " .. u._round(usb, 7)
return result
return result
end
end


return p
return p