stateLayerOpacity function

double stateLayerOpacity(
  1. KeyFaceMotion motion,
  2. KeyFaceSpec spec
)

State-layer opacity: the pressed layer replaces hover (M3 state layers). The pressed tint is snapped on in frame 1 by KeyPressMotion, which is the M3E frame-1 cue.

Implementation

double stateLayerOpacity(KeyFaceMotion motion, KeyFaceSpec spec) => math
    .max(
      spec.hoverOverlayOpacity * motion.hover.value,
      spec.pressedOverlayOpacity * motion.tint.value,
    )
    .clamp(0.0, 1.0);