fix: tests

This commit is contained in:
Felix Roos 2023-07-08 16:14:25 +02:00
parent 27643f4a48
commit 2d08b31f9a
2 changed files with 67 additions and 0 deletions

View file

@ -2306,6 +2306,19 @@ export const { loopAt, loopat } = register(['loopAt', 'loopat'], function (facto
return _loopAt(factor, pat, 1);
});
// this function will be redefined in repl.mjs to use the correct cps value.
// It is still here to work in cases where repl.mjs is not used
export const fit = register('fit', (pat) =>
pat.withHap((hap) =>
hap.withValue((v) => ({
...v,
speed: 1 / hap.whole.duration,
unit: 'c',
})),
),
);
/**
* Makes the sample fit the given number of cycles and cps value, by
* changing the speed. Please note that at some point cps will be