mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 13:38:40 +00:00
map pianoroll alpha to velocity
This commit is contained in:
parent
2441e70153
commit
8ebe44405e
@ -20,6 +20,7 @@ Pattern.prototype.pianoroll = function ({
|
|||||||
events.forEach((event) => {
|
events.forEach((event) => {
|
||||||
const isActive = event.whole.begin <= t && event.whole.end >= t;
|
const isActive = event.whole.begin <= t && event.whole.end >= t;
|
||||||
ctx.fillStyle = isActive ? active : inactive;
|
ctx.fillStyle = isActive ? active : inactive;
|
||||||
|
ctx.globalAlpha = event.context.velocity ?? 1;
|
||||||
const x = Math.round((event.whole.begin / timeframe) * w);
|
const x = Math.round((event.whole.begin / timeframe) * w);
|
||||||
const width = Math.round(((event.whole.end - 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);
|
const y = Math.round(h - ((Number(event.value) - minMidi) / midiRange) * h);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user