Today I have something I am very proud of. I don't remember what made me want to do this, but I decided to make a piano. Now, I'm on vacation from work so I've had a lot of time to do nothing but Minecraft. :D
As a result, I built 3 pianos yesterday and then today I built the zenith of my Minecraft pianos.
The first piano is one that any player can play around on. If they step on a key, it will play that note. I guess this was probably inspired by the floor piano at FAO Schwarz. Here's a great video of the employees playing Toccata and Fugue in D Minor by Johann Sebastian Bach on the floor piano: Floor Piano.
Minecraft has some limitations, but I'd like to see some people work together to try to play a song on my piano. :D
Here is the first one I built. At first it used pressure plates that you stepped on to press the keys. That was really ugly and made clicking noises whenever you stepped on or off of the pressure plates, so I changed it to where now there is a clock (a repeating pulse of "electricity") that checks if a player is on a key and then if they are it plays that note. Pretty simple, not too sophisticated, and it can cause some lag because of all the stuff under the hood. Not too bad, though.
Here is the second piano that I built yesterday. I wanted to make one of those player pianos that plays itself at the push of a button, so I built this. This one actually has the keys depress when the note is played, so it really looks authentic. This model is just one of the first iterations, however. The player pianos get better with each one. They keys work by being attached to sticky pistons which are kept fully extended until that key is played. The problem with this is that pistons are very noisy.
Now we're really getting in there. This player piano works by having a ribbon feed that tells the piano which key to play at what time. The red bits are the notes for the left hand and the green ones are for the right hand (if you were really playing on a piano).
... Ok, where was I? An ice cream truck came by and I had to go get some, for nostalgia's sake. Alright, back to the pianos.
This player piano and the one after it play "In the Hall of the Mountain King", which is a song I personally love and can play on the guitar (picking, you know. I can't actually play piano.) One of the problems with this piano is that the ribbon can only feed through at one speed, and that speed is slow. The ribbon is cycled through with the use of 25 pistons at each of the four corners. If I set the clock too fast, the pistons won't retract fast enough to get out of the way of the incoming blocks and the whole system will get blocked up (pun intended).
By the way, each vertical strip of the ribbon corresponds to a note on the piano, so the two red blocks on the right side of the picture will both play the F# below middle C, but will do it four beats apart. The left hand part seen in red alternates between F# and B on beats 1 and 3 as you can see by the red bit just a few blocks down the ribbon tunnel.
The problem with this design is that I had to program each block individually and also each note. This means that I could have mixed up some of the programming so that a different key is pressed than the one that you hear. Also it takes forever to make, which is not a good thing. Additionally, it can only play one song, and that song takes forever to put in. If I wanted to change the song, I'd have to rebuild the entire thing.
Probably the best thing about it, though, is that it's easy to put more songs into this piano. It takes significantly less time than the other two models, and I can have more than one song on the same piano. If I ever end up adding another song to this one, I'll probably make it so only one song can play at a time. Otherwise that would sound cacophonous. By the way, this piano plays a simple version of Fur Elise, which is another great song that I can also play on guitar.
This is the "processor". When the ribbon tells it what note to play, it plays the note, presses the key, then lifts the key after letting it stay down for a short time. On the last model, I had to do all of those on every beat. This is a vast improvement. It's also fun to watch this part of the piano when a song is playing.
Ok, we're at the last picture. This is a picture of the piano playing Fur Elise. It's not really something that comes across very well in a picture, but I wanted to show you what it looked like when a key was pressed. If you look to the right of the picture behind the piano, you can see the ribbon lit up. Judging from where the current is, the song is almost over. I did just the first part of the song, so it goes by pretty quickly. I could add more if I wanted.
And here is a video explanation for how it works in case you'd like to build your own or if you're just curious.
That's all folks! Thanks for reading!