Skip to content

Commit

Permalink
Merge pull request #813 from tidalcycles/fix-multiple-repls
Browse files Browse the repository at this point in the history
fix: multiple repls
  • Loading branch information
felixroos authored Nov 17, 2023
2 parents 83561a0 + 0975224 commit dd8be65
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions packages/core/repl.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,22 @@ export function repl({
allTransform = transform;
return silence;
};

for (let i = 1; i < 10; ++i) {
Object.defineProperty(Pattern.prototype, `d${i}`, {
get() {
return this.p(i);
},
});
Object.defineProperty(Pattern.prototype, `p${i}`, {
get() {
return this.p(i);
},
});
Pattern.prototype[`q${i}`] = silence;
try {
for (let i = 1; i < 10; ++i) {
Object.defineProperty(Pattern.prototype, `d${i}`, {
get() {
return this.p(i);
},
});
Object.defineProperty(Pattern.prototype, `p${i}`, {
get() {
return this.p(i);
},
});
Pattern.prototype[`q${i}`] = silence;
}
} catch (err) {
// already defined..
}

const fit = register('fit', (pat) =>
Expand Down

0 comments on commit dd8be65

Please sign in to comment.