I love playing the piano and listening to music with piano in it. It is a difficult instrument to play but really beautiful when played properly. The way it works is complex compared with most instruments. There are 88 keys on the piano, each white key represents a note and each black key represents either a sharp or a flat depending on which key the music is written in. The white keys can also represent sharps or flats, depending on how the music is written.
When a key is pressed a hammer hits a string or multiple depending on how low or how high you want to play. The low notes have one string, the high ones have three and between them there are notes with two strings. The high notes need more strings, so that they can be heard clearly where the low notes need fewer as they are very loud on their own. As a key is pressed and the hammer hits the strings and a dampener is also lifted at the same time. The dampener goes down and stops the note once the key is released, this allows for control over how long the note is played for. In the the link beneath, is a video which shows how the hammers hit the strings and the dampeners are lifted as keys are pressed.
Below is a picture of a piano's pedals. Each pedal has a role to play in enhancing the quality of music produced, depending on the mood that is wanted.
The left pedal is the soft pedal, which makes the sound created when hitting a key, softer. It does this by shifting the hammers slightly to the side when pressed down, so that they don't hit as many strings as normal.
The right pedal is the sustaining pedal, which makes all the notes which have been played since it was pushed down, drag out longer. It does this by lifting all the dampeners in the piano off of their strings when pressed down.
On some piano's you get a middle pedal, depending on what type of piano it is. The middle pedal is the sostenuto pedal, responsible for capturing one note or a chord and dragging it out while the notes played after are unaffected. To do this the key or keys need to be pressed down at the same time that the pedal is pressed down.
I hope you were able to learn a little more about how a piano works and below is one of my favorite pieces on the piano, it is not me playing though. Enjoy!