clean + comment

This commit is contained in:
Felix Roos 2024-01-21 01:29:31 +01:00
parent 0cfec3a7bd
commit 0695b4bee9

View File

@ -68,7 +68,12 @@ export function repl({
const toggle = () => scheduler.toggle();
const setCps = (cps) => scheduler.setCps(cps);
const setCpm = (cpm) => scheduler.setCps(cpm / 60);
const all = function (transform) {
allTransform = transform;
return silence;
};
// set pattern methods that use this repl via closure
const injectPatternMethods = () => {
Pattern.prototype.p = function (id) {
pPatterns[id] = this;
@ -77,11 +82,6 @@ export function repl({
Pattern.prototype.q = function (id) {
return silence;
};
const all = function (transform) {
allTransform = transform;
return silence;
};
try {
for (let i = 1; i < 10; ++i) {
Object.defineProperty(Pattern.prototype, `d${i}`, {
@ -101,7 +101,6 @@ export function repl({
} catch (err) {
console.warn('injectPatternMethods: error:', err);
}
evalScope({
all,
hush,