This page covers:
- What are Keypresses
- Keypress features
- Common issues with Keypresses
What are Keypresses
Keypresses are extra pieces of geometry that sit above keys on the Piano in order to display which keys are currently held down. They are comparatively simple; just displaying a given material with some quick fade-in/fade-out optional animation.
Keypress features
Coverage modes
(Advanced) Effects > Keypresses > Behaviour, "Keypress coverage" section
Coverage mode causes Keypresses to use different geometry when overlaying a piano key:
Clean
wraps around the top of piano keysInset
is completely flat, and has a borderFull
wraps around the full piano key
If using a stock 2D layout, Clean
and Full
will likely look the exact same.
Animation modes
(Advanced) Effects > Keypresses > Behaviour, "Animation" section
In order to soften the attack and decay of note events (and make short events more visible), Keypresses can fade in and out with a configurable animation. These animation toggles are independent to each other and can be stacked.
Warning
Do not turn off all 3 animation toggles! This will stop Keypresses from fading in at all, and functionally make them invisible.
Fade alpha
animates the Keypress opacity, and is by far the best optionFade horizontal
animates the geometry growing outwards from the centre in the X-axisFade vertical
animates the geometry growing downwards from the top of the key in the Y-axis
Note
Fade horizontal
and Fade vertical
are somewhat vestigial. In the very first iteration of Keysight, Keypresses animated with Fade vertical
and it looked awful. When updating those, I kept in the option for other animation modes, but I think it would take a really niche usecase to make them actually look good.
Lifetime
(Advanced) Effects > Keypresses > Behaviour, "Animation" section
Lifetime options for Keypresses specify the amount of time taken to fade in and out with the given animation. Typically this should be kept very short, but non-zero, in order to cleanly display which keys are held and not have "left over" Keypresses hanging around for a long time after the key is released.
The Automatic keypress lifetime toggle, when enabled, will use the time taken for Piano keys to animate as the lifetime for Keypresses fading in and out. This means the lifetime becomes shorter for higher-velocity notes. This mode is not recommended, as the variable lifetime looks a little strange and it's slower than is comfortable (without also adjusting Piano key animation speed).
Fade over lifetime
(Advanced) Effects > Keypresses > Behaviour, "Animation" section
This graph controls the animation pacing over the lifetime of the Keypress. When a Keypress spawns, it evaluates this graph from left to right. When it is released, it evaluates from right to left.
Warning
While this is implemented as a graph, do not use flat values! This will functionally remove any animation. The only intended edit on this graph is the curve property to change the way the animation "feels". A single -1.0
to 1.0
slider controlling curve direction and amount would have been immune to accidental animation breakage, but it also would have been less intuitive to use.
Common issues with Keypresses
Keypresses turning invisible
If Keypresses are enabled but are not visible, ensure that:
- At least one animation mode is selected
- The fade-over-lifetime graph is moving from
0.00
to1.00
- The material is not invisible (i.e.
Transparent
with0.00
opacity or something silly)
Flickering Keypresses
In all default presets, Keypresses are set to use no lighting channels at all. Flickering Keypresses occurs when Keypresses are being illuminated by a Scene Light, and more than one Scene Light exists in the preset. This can be fixed by making Keypresses have 0.00
lifetime (and snap in and out of existence instantly). While instant, they use standard materials that can be properly illuminated by multiple Scene Lights.
Info
This is a really weird one. Keypresses use a special variant of full materials that can support semi-transparency (usually impossible on "lit" surfaces), and as such, use Surface ForwardShading
internally. This material mode can only support one directional light source, such as those from Scene Lights. Giving it more than one source of directional lighting will cause the material to randomly switch between available directional lighting sources, causing flicker.
The more you know!
Stretched material
This is a very niche edge case, but due to Materials being "stamped" downwards in the Z-axis, it is possible to see stretched textures on Keypresses using Full
coverage mode:
The only way to show texture without stretching would be to use Reflections as the source for emissive texture inside of self-emissive colour (and ensure 0.00
normal strength on Reflections). This does cause its own weirdness with warped edges instead, but it might look a little nicer. Alternatively, just use Clean
coverage mode.