build
This commit is contained in:
parent
61e81a4e60
commit
77fd516b15
12 changed files with 2073 additions and 1490 deletions
3
docs/dist/euclid.js
vendored
3
docs/dist/euclid.js
vendored
|
|
@ -1,6 +1,7 @@
|
|||
import {Pattern, timeCat} from "../_snowpack/link/strudel.js";
|
||||
import bjork from "../_snowpack/pkg/bjork.js";
|
||||
import {rotate} from "../_snowpack/link/util.js";
|
||||
import Fraction from "../_snowpack/pkg/fractionjs.js";
|
||||
const euclid = (pulses, steps, rotation = 0) => {
|
||||
const b = bjork(steps, pulses);
|
||||
if (rotation) {
|
||||
|
|
@ -15,6 +16,6 @@ Pattern.prototype.euclidLegato = function(pulses, steps, rotation = 0) {
|
|||
const bin_pat = euclid(pulses, steps, rotation);
|
||||
const firstOne = bin_pat.indexOf(1);
|
||||
const gapless = rotate(bin_pat, firstOne).join("").split("1").slice(1).map((s) => [s.length + 1, true]);
|
||||
return this.struct(timeCat(...gapless)).late(firstOne / steps);
|
||||
return this.struct(timeCat(...gapless)).late(Fraction(firstOne).div(steps));
|
||||
};
|
||||
export default euclid;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue