mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 05:38:35 +00:00
format
This commit is contained in:
parent
2348023b22
commit
d2a9b9b750
@ -3122,12 +3122,15 @@ Pattern.prototype.xfade = function (pos, b) {
|
||||
* @example
|
||||
* s("sd").beat("4:12", 16)
|
||||
*/
|
||||
const __beat = join => (t, div, pat) => {
|
||||
const __beat = (join) => (t, div, pat) => {
|
||||
t = Fraction(t).mod(div);
|
||||
div = Fraction(div);
|
||||
const b = t.div(div);
|
||||
const e = t.add(1).div(div);
|
||||
return join(pat.fmap(x => pure(x)._compress(b,e)));
|
||||
}
|
||||
return join(pat.fmap((x) => pure(x)._compress(b, e)));
|
||||
};
|
||||
|
||||
export const {beat} = register(['beat'], __beat(x => x.innerJoin()));
|
||||
export const { beat } = register(
|
||||
['beat'],
|
||||
__beat((x) => x.innerJoin()),
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user