This is a fix for the formula from: https://en.xen.wiki/w/Color_notation#Converting_a_Ratio_to%2Ffrom_a_Color_Name. Adapted from a code comment I wrote in microtonal-utils/color.js.
Suppose we're converting an interval with stepspan S and magnitude M.
Our monzo is [a b c d e ...>, where a and b are unknown and c, d, e, ... are known.
Let X = stepspan([0 0 c d e ...>) = 16*c + 20*d + 24*e + ...
Y = magnitude([0 2(S-X) c d e ...>) = round((2(S-X) + c + d + e + ...) / 7)