to sum it all up
To sum it all up:
Map the position of the hammer with time when the piano key is pressed for t amount of time.
Any analytical method may be used exact solutions are not required but reasonable estimates. The main focus is using rigid bodies and linkages to simplify the mechanism to its most basic form.
Gravity is to be included but ignore all compressibility, flexural and friction effects.
Dimensions angles properties ect and a more detailed view (photos/videos) of the system can be given.