document function
This commit is contained in:
parent
6b5de5fec8
commit
d3edc62fc7
1 changed files with 2 additions and 3 deletions
|
|
@ -163,7 +163,6 @@ export const __chooseWith = (pat, xs) => {
|
||||||
|
|
||||||
return pat.range(0, xs.length).fmap((i) => {
|
return pat.range(0, xs.length).fmap((i) => {
|
||||||
const key = Math.min(Math.max(Math.floor(i), 0), xs.length - 1);
|
const key = Math.min(Math.max(Math.floor(i), 0), xs.length - 1);
|
||||||
console.log({ key });
|
|
||||||
return xs[key];
|
return xs[key];
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -173,6 +172,8 @@ export const __chooseWith = (pat, xs) => {
|
||||||
* @param {Pattern} pat
|
* @param {Pattern} pat
|
||||||
* @param {*} xs
|
* @param {*} xs
|
||||||
* @returns {Pattern}
|
* @returns {Pattern}
|
||||||
|
* @example
|
||||||
|
* note("c g g d f").s(chooseWith(slider(0, 0, 1), ["sawtooth", "triangle", "bd hh sd hh"]))
|
||||||
*/
|
*/
|
||||||
export const chooseWith = (pat, xs) => {
|
export const chooseWith = (pat, xs) => {
|
||||||
return __chooseWith(pat, xs).outerJoin();
|
return __chooseWith(pat, xs).outerJoin();
|
||||||
|
|
@ -184,8 +185,6 @@ export const chooseWith = (pat, xs) => {
|
||||||
* @param {Pattern} pat
|
* @param {Pattern} pat
|
||||||
* @param {*} xs
|
* @param {*} xs
|
||||||
* @returns {Pattern}
|
* @returns {Pattern}
|
||||||
* @example
|
|
||||||
* note("c g g d f").s(chooseInWith(slider(1, 0, 1), ["sawtooth", "triangle", "bd hh sd hh"]))
|
|
||||||
*/
|
*/
|
||||||
export const chooseInWith = (pat, xs) => {
|
export const chooseInWith = (pat, xs) => {
|
||||||
return __chooseWith(pat, xs).innerJoin();
|
return __chooseWith(pat, xs).innerJoin();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue