mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-25 12:38:35 +00:00
export patternify helpers
This commit is contained in:
parent
0396c3f475
commit
16e2c97e0c
@ -708,8 +708,8 @@ class Pattern {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_zoom(s, e) {
|
_zoom(s, e) {
|
||||||
e = Fraction(e)
|
e = Fraction(e);
|
||||||
s = Fraction(s)
|
s = Fraction(s);
|
||||||
const d = e.sub(s);
|
const d = e.sub(s);
|
||||||
return this.withQuerySpan((span) => span.withCycle((t) => t.mul(d).add(s)))
|
return this.withQuerySpan((span) => span.withCycle((t) => t.mul(d).add(s)))
|
||||||
.withEventSpan((span) => span.withCycle((t) => t.sub(s).div(d)))
|
.withEventSpan((span) => span.withCycle((t) => t.sub(s).div(d)))
|
||||||
@ -1202,11 +1202,11 @@ Pattern.prototype.chunkBack = function (...args) {
|
|||||||
Pattern.prototype.zoom = function (...args) {
|
Pattern.prototype.zoom = function (...args) {
|
||||||
args = args.map(reify);
|
args = args.map(reify);
|
||||||
return patternify2(Pattern.prototype._zoom)(...args, this);
|
return patternify2(Pattern.prototype._zoom)(...args, this);
|
||||||
}
|
};
|
||||||
Pattern.prototype.compress = function (...args) {
|
Pattern.prototype.compress = function (...args) {
|
||||||
args = args.map(reify);
|
args = args.map(reify);
|
||||||
return patternify2(Pattern.prototype._compress)(...args, this);
|
return patternify2(Pattern.prototype._compress)(...args, this);
|
||||||
}
|
};
|
||||||
|
|
||||||
// call this after all Patter.prototype.define calls have been executed! (right before evaluate)
|
// call this after all Patter.prototype.define calls have been executed! (right before evaluate)
|
||||||
Pattern.prototype.bootstrap = function () {
|
Pattern.prototype.bootstrap = function () {
|
||||||
@ -1310,4 +1310,7 @@ export {
|
|||||||
timeCat,
|
timeCat,
|
||||||
union,
|
union,
|
||||||
when,
|
when,
|
||||||
|
patternify2,
|
||||||
|
patternify3,
|
||||||
|
patternify4,
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user