Tuesday, July 22, 2014

Piano Man

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 inside of the piano. The clock is the glowing thing halfway down the box. If you don't know much about redstone components then the rest won't make much since to you. That's ok, just move along to the next bit.


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.


This view from the top allows you to glimpse into the belly of the beast.


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). 


I built a glass walkway for people to go inside the machine and see the cogs in motion so to speak. I actually really like this picture, I think it turned out pretty cool looking. I am on the  walkway inside the ribbon cage.


This is the "processor" if you will. The current is always on, but it only pushes through to the other side when one of the red or green blocks is in front of it. The glass does not allow current to pass through it, so if there is glass, the note will not play and the key will stay in it's default position, which is up. If one of the red or green bits is in front of it, the current will travel through, sounding the note and causing the pistons to lower the key.

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.


Alright, here comes the player piano version 2. This one is also supposed to play "In the Hall of the Mountain King" but I never finished programming the song into it. The building and designing of this piano was a long and tedious process and, as usually happens, partway through the very last step I realized a better way to do it. I said to Rob, "Rob, I just thought of a way to do it better. Now I've got to build another one. He keeps asking me, "How many pianos is it that you've built now?" I've only built four, so calm down. Anyway, I didn't possess the fortitude to carry this one through to the end. Either way, let's see how it's supposed to work.


This one works by a string of delayed current that passes through blocks that play the note, press the key, and lift the last key. This one is vastly better than the last model for several reasons. It doesn't use pistons, so there's not that annoying clicking sound constantly interfering with the music. It doesn't have the same ribbon as last time that limited the song to 46 beats. It can also have varied delay between notes, allowing for near proper timing of the music. It doesn't cause as much lag either, because it doesn't have any sort of clock. When the button is pressed, the song plays through from beginning to end through the string of blocks which play notes and change which keys are pressed.

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.


Finally, we have the 4th and final piano. This player piano is better in every way, but could still improve. However, since I've been making pianos for two days straight, I think I need to move on to something else. I was told that pianos needed to be made out of wood, so I made this last one out of wood and it turned out really beautiful I think.  
 

Here is the replacement for the old ribbon style of song programming. This has a delayed current that runs through once when you push the button. As the current goes through, the blocks communicate to the main processor which note to play and the processor (for lack of a better term) takes care of the rest. This means that I don't have as many opportunities to mess up and the key being pressed will always match the note being played. Another great thing is that this one is designed to be easier to set the timing for. The last one caused some difficulties and the space was too busy and confined.

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.



Here is a video of the piano in action:


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!


Sunday, July 20, 2014

Achievement Unlocked: Awesome Minecraft Server

MineCraft is an amazing game. My friend Rob bought it for me on the computer and he even has his own server. I've been having a lot of fun playing on survival mode, but also, since I'm an admin on the server, I've been building some pretty cool things. The coolest thing I've built is the castle. I'm not an expert in castle terms, which I've recently discovered there are hundreds of. However, this castle has turrets, ramparts, archery windows and a bunch of other fancy things. There is a fountain in  the middle with a hidden cave below it.



Fans of this blog (if that's a thing) may notice a similarity between the castle courtyard with its fountain and trees and the town center of the upper district of Praelatus that I posted in my last few posts. I wanted to make something as beautiful as the Upper District and then decided to make a castle to have a place for it. I'm pretty happy I made the castle. I think it's awesome. Also, if you explore it, you can go in different places and climb ladders to all the tops of the towers and also into the archer rooms.

Then, for the 4th of July, I built a gigantic US flag on the top of the castle. Someone pointed out to me that I put too many stars on it. Sorry about that. I'm not sure how I messed it up, but the flag is down now so there's no worries. I also had fireworks shooting off every 5 minutes off the top of the tower and I had a big fancy fireworks show on the night of the 4th.



We'd love for you to join us if you have minecraft on your computer. We have a very small group of players right now. We have good plug-ins with currency and shops and the map is there for you to freely play survival wherever you want. It's a huge map, so you can hang near people or go out into a faraway wilderness. There is PvP except in the Spawn City and the area around it, which is large enough for several players to play there.

There is also an events world for special things, so that's worth looking at. We're open to input and ideas from anyone who would want to play on the server.

The address is mc.gamingshmaming.net

P.S. If you don't have minecraft but would still like to look at the map, you can go to gamingshmaming.net and click on the "Dynemap" tab to open up a map of the world. Or just click this link: 3D Map It will show you an overhead view, who's playing, what they're saying when they chat, and other things. You can also put your mouse on the right side of the screen and click on the green cube under where it says "World" and then you can see a really detailed 3D image of the surface of the map. You may have to zoom in, but you can see the castle and other neat things with this view.