added frequency rounding

This commit is contained in:
tyow 2026-01-30 16:59:33 -05:00
parent a09349e457
commit 207ce9cbec
2 changed files with 23 additions and 21 deletions

View file

@ -96,7 +96,9 @@ function xenOffset(xenScale, offset, index = 0) {
export const xen = register('xen', function (scaleNameOrRatios, pat) {
return pat.withHap((hap) => {
const scale = getXenScale(scaleNameOrRatios);
const frequency = xenOffset(scale, parseNumeral(hap.value));
let frequency = xenOffset(scale, parseNumeral(hap.value));
// 10 is somewhat arbitrary
frequency = parseFloat(frequency.toPrecision(10))
return hap.withValue(() => frequency);
});
});