add flux function

This commit is contained in:
Lu[ke] Wilson
2025-08-29 15:35:41 +01:00
parent b54139376e
commit e2cdce5ac9
+24
View File
@@ -2337,6 +2337,17 @@ export const { juxBy, juxby } = register(['juxBy', 'juxby'], function (by, func,
return stack(left, right).setSteps(__steps ? lcm(left._steps, right._steps) : undefined);
});
/**
* Like juxBy, except it flips the ears each cycle.
* @name fluxBy
* @synonyms fluxby
* @example
* s("bd lt [~ ht] mt cp ~ bd hh").fluxBy(".8", rev)
*/
export const { fluxBy, fluxby } = register(['fluxBy', 'fluxby'], function (by, func, pat) {
return slowcat(pat._juxBy(by, func, pat), pat._juxBy(-by, func, pat));
});
/**
* The jux function creates strange stereo effects, by applying a function to a pattern, but only in the right-hand channel.
* @example
@@ -2350,6 +2361,19 @@ export const jux = register('jux', function (func, pat) {
return pat._juxBy(1, func, pat);
});
/**
* Like jux, but flips the ears each cycle.
* @example
* s("bd lt [~ ht] mt cp ~ bd hh").flux(rev)
* @example
* s("bd lt [~ ht] mt cp ~ bd hh").flux(press)
* @example
* s("bd lt [~ ht] mt cp ~ bd hh").flux(iter(4))
*/
export const flux = register('flux', function (func, pat) {
return pat._fluxBy(1, func, pat);
});
/**
* Superimpose and offset multiple times, applying the given function each time.
* @name echoWith