Raymond Hettinger <raymond.hettin...@gmail.com> added the comment: I don't think the standard library should go down this path.
Mark's disinclinations all make sense to me, but I'm also concerned that the API would be almost unusable in practical situations. Users would tend to know their input fraction and that they have a desire for "simplification", but it would be challenging for them to come with a surrounding interval that made sense. We could attempt to infer an interval from the input, but a user is likely to have a poorly specified idea of what they actually want. The operating principle here is, "refuse the temptation to guess". Here's a little exercise for the API. The 12 semitones in an octave are separated by a frequency ratio of 2**(1/12). For example, if A is 440 Hz, then A# is 440*2**(1/12) = 466.16 Hz. Note pairs sound the most harmonious when the ratio of their frequencies is a "near" a small fraction. Determine the small fraction for each of the twelve notes. For example, a perfect fifth has the frequency ratio of 2**(7/12) -> 1.498307 — it it "perfect" because it "close-enough" to the small integer ratio of 3 : 2. Notice the vague requirements of "near", "close-enough" and "small integer ratio". ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46780> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com