add Pattern.id + use it for _punchcard and _spiral

This commit is contained in:
Felix Roos 2024-03-23 12:06:31 +01:00
parent 2cc92a2b93
commit 2857e816d2
4 changed files with 25 additions and 6 deletions

View file

@ -129,12 +129,17 @@ export function pianoroll({
colorizeInactive = 1,
fontFamily,
ctx,
id,
} = {}) {
const w = ctx.canvas.width;
const h = ctx.canvas.height;
let from = -cycles * playhead;
let to = cycles * (1 - playhead);
if (id) {
haps = haps.filter((hap) => hap.context.id === id);
}
if (timeframeProp) {
console.warn('timeframe is deprecated! use from/to instead');
from = 0;