make polyrhythm alias of stack #211

This commit is contained in:
Felix Roos 2022-09-17 23:38:42 +02:00
parent e4913dfb73
commit c786d77b07

View File

@ -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));