rename range > listRange and remove from exports

This commit is contained in:
alex 2022-04-12 16:54:27 +01:00
parent 7c10d171f6
commit e75d8048fe

View file

@ -8,7 +8,7 @@ const flatten = (arr) => [].concat(...arr);
const id = (a) => a; const id = (a) => a;
const range = (min, max) => Array.from({ length: max - min + 1 }, (_, i) => i + min); const listRange = (min, max) => Array.from({ length: max - min + 1 }, (_, i) => i + min);
export function curry(func, overload) { export function curry(func, overload) {
const fn = function curried(...args) { const fn = function curried(...args) {
@ -822,7 +822,7 @@ class Pattern {
} }
stutWith(times, time, func) { stutWith(times, time, func) {
return stack(...range(0, times - 1).map((i) => func(this.late(i * time), i))); return stack(...listRange(0, times - 1).map((i) => func(this.late(i * time), i)));
} }
stut(times, feedback, time) { stut(times, feedback, time) {
@ -831,7 +831,7 @@ class Pattern {
// these might change with: https://github.com/tidalcycles/Tidal/issues/902 // these might change with: https://github.com/tidalcycles/Tidal/issues/902
_echoWith(times, time, func) { _echoWith(times, time, func) {
return stack(...range(0, times - 1).map((i) => func(this.late(i * time), i))); return stack(...listRange(0, times - 1).map((i) => func(this.late(i * time), i)));
} }
_echo(times, time, feedback) { _echo(times, time, feedback) {
@ -839,7 +839,7 @@ class Pattern {
} }
iter(times, back = false) { iter(times, back = false) {
return slowcat(...range(0, times - 1).map((i) => (back ? this.late(i / times) : this.early(i / times)))); return slowcat(...listRange(0, times - 1).map((i) => (back ? this.late(i / times) : this.early(i / times))));
} }
// known as iter' in tidalcycles // known as iter' in tidalcycles
@ -1271,7 +1271,6 @@ export {
invert, invert,
inv, inv,
id, id,
range,
echo, echo,
iter, iter,
iterBack, iterBack,