support multiple animationFrames

+ break out spiral draw logic
This commit is contained in:
Felix Roos 2024-03-15 09:49:00 +01:00
parent a8712fd8ce
commit 6dce9d5deb
3 changed files with 58 additions and 54 deletions

View file

@ -30,7 +30,7 @@ const getValue = (e) => {
};
Pattern.prototype.pianoroll = function (options = {}) {
let { cycles = 4, playhead = 0.5, overscan = 1, hideNegative = false, ctx } = options;
let { cycles = 4, playhead = 0.5, overscan = 1, hideNegative = false, ctx, id } = options;
let from = -cycles * playhead;
let to = cycles * (1 - playhead);
@ -50,6 +50,7 @@ Pattern.prototype.pianoroll = function (options = {}) {
from: from - overscan,
to: to + overscan,
ctx,
id,
},
);
return this;