mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 13:48:40 +00:00
Add stepBind, and some toplevel aliases for binds and withValue (#1241)
* Add toplevel withValue function * add stepBind, and add toplevel aliases for this and other binds
This commit is contained in:
parent
c5de21ef61
commit
55c226cda6
@ -1491,6 +1491,14 @@ function _sequenceCount(x) {
|
|||||||
export const mask = curry((a, b) => reify(b).mask(a));
|
export const mask = curry((a, b) => reify(b).mask(a));
|
||||||
export const struct = curry((a, b) => reify(b).struct(a));
|
export const struct = curry((a, b) => reify(b).struct(a));
|
||||||
export const superimpose = curry((a, b) => reify(b).superimpose(...a));
|
export const superimpose = curry((a, b) => reify(b).superimpose(...a));
|
||||||
|
export const withValue = curry((a, b) => reify(b).withValue(a));
|
||||||
|
|
||||||
|
export const bind = curry((a, b) => reify(b).bind(a));
|
||||||
|
export const innerBind = curry((a, b) => reify(b).innerBind(a));
|
||||||
|
export const outerBind = curry((a, b) => reify(b).outerBind(a));
|
||||||
|
export const squeezeBind = curry((a, b) => reify(b).squeezeBind(a));
|
||||||
|
export const stepBind = curry((a, b) => reify(b).stepBind(a));
|
||||||
|
export const polyBind = curry((a, b) => reify(b).polyBind(a));
|
||||||
|
|
||||||
// operators
|
// operators
|
||||||
export const set = curry((a, b) => reify(b).set(a));
|
export const set = curry((a, b) => reify(b).set(a));
|
||||||
@ -2539,6 +2547,10 @@ Pattern.prototype.stepJoin = function () {
|
|||||||
return new Pattern(q, first_t);
|
return new Pattern(q, first_t);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Pattern.prototype.stepBind = function (func) {
|
||||||
|
return this.fmap(func).stepJoin();
|
||||||
|
};
|
||||||
|
|
||||||
export function _retime(timedHaps) {
|
export function _retime(timedHaps) {
|
||||||
const occupied_perc = timedHaps.filter((t, pat) => pat.hasTactus).reduce((a, b) => a.add(b), Fraction(0));
|
const occupied_perc = timedHaps.filter((t, pat) => pat.hasTactus).reduce((a, b) => a.add(b), Fraction(0));
|
||||||
const occupied_tactus = removeUndefineds(timedHaps.map((t, pat) => pat.tactus)).reduce(
|
const occupied_tactus = removeUndefineds(timedHaps.map((t, pat) => pat.tactus)).reduce(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user