thebeat
thebeat copied to clipboard
Fix rounding terminology and consistency
When onsets of a sequence do exactly match the samples, a warning is given about rounding the onsets, and:
- The warning (and documentation) says "[...] were rounded off to the neirest integer ceiling." (which btw now gets underlined as being a typo of "nearest")
- The actual code uses
start_pos = int(start_pos)
, which rounds down (i.e. takes the floor, not ceiling) - The suggested
round_onsets()
function usesnp.round
, which rounds to the closest integer (i.e., floor or ceiling, depending on the actual value).
This should be made consistent, both in code as well as in the warning's text and docs. I'm not sure what the most obvious best one is, flooring or rounding; there's probably some argument to be made for both. My intuition says that flooring might have better mathematical properties, but I might be wrong. I do think ceiling makes the least sense of all three options.