mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-30 16:33:19 -04:00
add flux function
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user