localize draw logic
This commit is contained in:
parent
d980c9ca4c
commit
1ac784dc7a
15 changed files with 397 additions and 308 deletions
|
|
@ -283,3 +283,13 @@ export function pianoroll({
|
|||
ctx.stroke();
|
||||
return this;
|
||||
}
|
||||
|
||||
Pattern.prototype.noteroll = function (options = { fold: 1 }) {
|
||||
return this.onPaint((ctx, time, haps, drawTime) => {
|
||||
let [lookbehind, lookahead] = drawTime;
|
||||
lookbehind = Math.abs(lookbehind);
|
||||
const cycles = lookahead + lookbehind;
|
||||
const playhead = lookbehind / cycles;
|
||||
pianoroll({ ctx, time, haps, ...options, cycles, playhead });
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue