make velocity a regular value prop
This commit is contained in:
parent
7d01764a30
commit
1d92ee76b9
9 changed files with 317 additions and 26 deletions
|
|
@ -187,7 +187,8 @@ export function pianoroll({
|
|||
color = isActive ? active : inactive;
|
||||
ctx.fillStyle = fillCurrent ? color : 'transparent';
|
||||
ctx.strokeStyle = color;
|
||||
ctx.globalAlpha = event.context.velocity ?? event.value?.gain ?? 1;
|
||||
const { velocity = 1, gain = 1 } = event.value || {};
|
||||
ctx.globalAlpha = velocity * gain;
|
||||
const timeProgress = (event.whole.begin - (flipTime ? to : from)) / timeExtent;
|
||||
const timePx = scale(timeProgress, ...timeRange);
|
||||
let durationPx = scale(event.duration / timeExtent, 0, timeAxis);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue