A key of a mechanical piano is struck gently. The same key is then struck again, but much harder this time. In the second case:
The sound detected will be louder and its pitch remains the same.
The loudness or softness of a sound is determined by the amplitude of the sound wave. In this case, the amplitude of the sound wave depends upon the force with which the key is hit. When the key is struck gently, we hear a soft sound because the sound wave produced has a lesser amplitude. When the key is stuck harder, the sound wave produced is of a higher amplitude, and hence, we hear a louder sound.
The pitch of the sound depends on the frequency of the sound wave. On a piano, the frequency is changed by changing the key that is being struck. Since the same key is being struck the second time, there will be no change in its frequency. Hence, its pitch remains the same.
Hence, the sound detected will be louder, and its pitch remains the same