Files
strudel/examples/changetempowitharrows.js
2025-09-27 23:12:09 +02:00

12 lines
406 B
JavaScript

let mytempo = 0
window.onkeydown = (e) => {
if (e.key === 'ArrowLeft') { mytempo -= 1; console.log(mytempo); }
if (e.key === 'ArrowRight') { mytempo += 1; console.log(mytempo); }
}
const addmytempo = register('addmytempo', (pat) => pat.withValue((v) => {
if (v.cps !== undefined) return { ...v, cps: v.cps + (mytempo / 60) };
else return v;
}));
note("c d e f").cps(100 / 60).addmytempo()