|
23 | 23 |
|
24 | 24 | # 👾 Newest features |
25 | 25 |
|
| 26 | +## multiEval |
| 27 | + |
| 28 | +Evaluate a function for all the possible combinations of the arguments provided up to the least common multiple of the list lengths. A very powerful feature to quickly calculate long generative pieces out of a single function. |
| 29 | + |
| 30 | +```js |
| 31 | +// 3x the euclidean algorithm, like: |
| 32 | +// join(euclid(8, 5), euclid(8, 7), euclid(8, 3)) |
| 33 | +Util.multiEval(Algo.euclid, 8, [5, 7, 3]) |
| 34 | +// [ |
| 35 | +// 1, 0, 1, 1, 0, 1, 1, 0, |
| 36 | +// 1, 1, 1, 1, 1, 1, 1, 0, |
| 37 | +// 1, 0, 0, 1, 0, 0, 1, 0 |
| 38 | +// ] |
| 39 | + |
| 40 | +// 3x the spread function like: |
| 41 | +// join(spread(5, 0, 12), spread(3, 0, 24), spread(8, 0, 12), |
| 42 | +// spread(5, 0, 24), spread(3, 0, 12), spread(8, 0, 24)) |
| 43 | +Util.multiEval(Gen.spread, [5, 3, 8], 0, [12, 24]) |
| 44 | +// [ |
| 45 | +// 0, 2, 4, 7, 9, 0, 8, 16, 0, |
| 46 | +// 1, 3, 4, 6, 7, 9, 10, 0, 4, |
| 47 | +// 9, 14, 19, 0, 4, 8, 0, 3, 6, |
| 48 | +// 9, 12, 15, 18, 21 |
| 49 | +// ] |
| 50 | +``` |
| 51 | + |
26 | 52 | ## Binary & Spacing |
27 | 53 |
|
28 | 54 | Generative rhythmical patterns of 1's and 0's by converting a number to binary or using the integer value as spacing between onsets |
|
0 commit comments