Module:Harmonic entropy: Difference between revisions

ArrowHead294 (talk | contribs)
m Fix at +1.01
ArrowHead294 (talk | contribs)
Try this out
Line 12: Line 12:
return math.sqrt(rat.benedetti_height(ratio))
return math.sqrt(rat.benedetti_height(ratio))
end
end
deviation = deviation or 17.22635157248405
deviation = deviation or 0.01
ratios = ratios
ratios = ratios
or limits.integer_limit(200, function(ratio)
or limits.integer_limit(200, function(ratio)
if math.abs(rat.cents(ratio) - c) > 3 * deviation then
if math.abs(ratio * 2^(c / 1200)) > 3 * deviation then
return 1 / 0
return 1 / 0
end
end
Line 26: Line 26:


local function weighted_gaussian(ratio)
local function weighted_gaussian(ratio)
return gaussian(rat.cents(ratio) - c) / norm(ratio)
return gaussian(ratio * 2^(c / 1200)) / norm(ratio)
end
end