From 8ebe44405ed671c3db60345b85c152f012767a43 Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Wed, 23 Mar 2022 20:09:32 +0100 Subject: [PATCH] map pianoroll alpha to velocity --- repl/src/pianoroll.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/repl/src/pianoroll.mjs b/repl/src/pianoroll.mjs index a7a385ee..094cc98b 100644 --- a/repl/src/pianoroll.mjs +++ b/repl/src/pianoroll.mjs @@ -20,6 +20,7 @@ Pattern.prototype.pianoroll = function ({ events.forEach((event) => { const isActive = event.whole.begin <= t && event.whole.end >= t; ctx.fillStyle = isActive ? active : inactive; + ctx.globalAlpha = event.context.velocity ?? 1; const x = Math.round((event.whole.begin / timeframe) * w); const width = Math.round(((event.whole.end - event.whole.begin) / timeframe) * w); const y = Math.round(h - ((Number(event.value) - minMidi) / midiRange) * h);