mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 05:38:35 +00:00
working
This commit is contained in:
parent
1e3bbc57cc
commit
7b914e7f22
@ -3100,3 +3100,23 @@ export let xfade = (a, pos, b) => {
|
||||
Pattern.prototype.xfade = function (pos, b) {
|
||||
return xfade(this, pos, b);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* creates a structure pattern from divisions of a cycle
|
||||
* especially useful for creating rhythms
|
||||
* @name onSubCycle
|
||||
* @synonyms onSub, os
|
||||
* @example
|
||||
* s("bd").os("0:7:10", 16)
|
||||
* @example
|
||||
* s("sd").os("4:12", 16)
|
||||
*/
|
||||
export const {onSubCycle, onSub, os} = register(['onSubCycle', 'onSub', 'os'], (times, div, pat) => {
|
||||
if (typeof times === 'number') {
|
||||
times = [times]
|
||||
}
|
||||
return stack(
|
||||
...times.map(t => pat.pressBy(_mod(t, div)/div).duration(1/div))
|
||||
)}
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user