mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 13:48:40 +00:00
make polyrhythm alias of stack #211
This commit is contained in:
parent
e4913dfb73
commit
c786d77b07
@ -1404,6 +1404,10 @@ export function stack(...pats) {
|
||||
return new Pattern(query);
|
||||
}
|
||||
|
||||
// aliases
|
||||
const polyrhythm = stack;
|
||||
const pr = stack;
|
||||
|
||||
/** Concatenation: combines a list of patterns, switching between them successively, one per cycle:
|
||||
*
|
||||
* synonyms: {@link cat}
|
||||
@ -1550,28 +1554,6 @@ export function pm(...args) {
|
||||
polymeter(...args);
|
||||
}
|
||||
|
||||
/*
|
||||
* Plays the given items at the same time, within the same length:
|
||||
* @param {...any} items - The items to play
|
||||
* @return {Pattern}
|
||||
* @example
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function polyrhythm(...xs) {
|
||||
const seqs = xs.map((a) => sequence(a));
|
||||
|
||||
if (seqs.length == 0) {
|
||||
return silence;
|
||||
}
|
||||
return stack(...seqs);
|
||||
}
|
||||
|
||||
// alias
|
||||
export function pr(args) {
|
||||
polyrhythm(args);
|
||||
}
|
||||
|
||||
export const add = curry((a, pat) => pat.add(a));
|
||||
export const chop = curry((a, pat) => pat.chop(a));
|
||||
export const chunk = curry((a, pat) => pat.chunk(a));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user