Piano player

Hello fellow Unitees,

I was playing around with the piano for a while and decided to see if I could make it play it self, so to speak.
So I made this quick program to see if it was possible, which it turns out to be.

I would like to share it in case other people would like to join in on the fun, maybe even give some input to improvements and stuff like that. For this purpose the program is open source here

If you want to check out the program it can be downloaded from my dropbox here.

A legacy version of the program is available. This version is the first iteration of the program and is not recommented for use and is only made available so that people can get a compiled version of the code on the Legacy branch on github.
You can find the legacy version here

Latest update: Version 2.0.1 (Sun. June 12th. 01:38 GMT+2)
Latest legacy update: Version 1.2.2 (Mon. May 30th. 20:12 GMT+2)

Legacy vs. Experimental:
Experimental is much more dynamic and customizable than legacy and more features in this direction is planned.
Experimental is smarter than legacy as it constructs the notes as theyā€™re added and informing the user of wrong syntax and illegal notes. In legacy the notes werenā€™t checked before you pressed play, and thus unexpected behaviour could happen while playing.
The source code for experimental is much easier to read and well documented (if I do say so myself) with a larger focus on user friendlyness and readabillity.
The experimental version is more like an API that you build a GUI on top of. This opens the possibillity for creative users to make custom GUIs for the program that fits their needs. The default GUI utilizes all features of the API, but many are completely optional.

NOTE: The latest update to the legacy version introduces a new save format. Saves from versions prior to version 1.2.2 WILL load in newer versions, however, saves made in 1.2.2+ will not work in versions prior to 1.2.2.

ANOTHER NOTE: The experimental version introduces yet a new save format. Again, this is compatible with earlier versions, but not the other way around.

YET ANOTHER NOTE: The experimental version is now the stable version and has been put on the master branch on github. Legacy version can be found on the Legacy branch.

Below is some useful info you most likely should read before using the software :wink:

How to use:

  1. Read Known issues and Important
  2. Paste the song you want to play in the text box
  3. Make sure the song is a appropriate format and does not contain special characters
  4. Make sure your in-game character is sitting by the piano
  5. Click play
  6. If the game window does not become the active window on its own, do so now

An example of a working input is as such:
A B C ABC [ABC] {ABC}

An example of invalid input is as such:
(x2) (x3) etc.
as described in Known issues.

Save file example and syntax
The notes used in the example are made by Kite and can be found here
Example file for legacy (v1.2.2)
Example file for experimenal (v2.0)

Planned features:
Suggestions?

Known issues:
Cannot play black keys.
(I have tried to overcome this issue with everything I could think of, no luck so far.
Iā€™ve tried to send capital letters and Iā€™ve tried emulating holding the shift key.
But it looks straight through my trixes. If anyone has any idea how to solve this issue, please tell me :> )

Does not support (x2) etc. tags. The workaround is to paste it for each iteration.

These issues may lead to the software crashing or the in game character leaving the piano (See ā€œImportantā€).

Important

Please see this reply regarding the use of macros in Tower Unite

The software will send keypresses to the game until it completes the sequence or the stop button is pressed.
This means that if you leave the piano prematurely it WILL continue to send keypresses!
Use the software at your own risk.

21 Likes

New update is out, introducing saving and loading of songs.

Save files are just plain text files, so you donā€™t even have to use the program to make loadable songs :smiley:

EDIT:

Another small update. This time finally fixing the bug where your in-game character would leave the piano when a special character was reached as a note.

6 Likes

What special character is that?

3 Likes

Well, it was a bug in the way I used the method to send the keypresses to the game. It was characters like %&/ etc.

1 Like

New update.
This is an exciting one :slight_smile:

This update introduces looping, so you can play a sheet over and over again without having to press play all the time :smiley: (hint: This is useful for drum beats)

Another feature that I have added. An attempt at GMT support.
I would like to stress that I have not tested the GMT support at all, it should work in theory, but I canā€™t make any promises.

To use it for GMT, simply change the Target from TU to GMT. That is all, everything should now work in GMT.
Remember to set it back to TU when youā€™re done playing in GMT :wink:

1 Like

Why even add GMT support?

1 Like

It was suggested by someone. So I thought, why not? :slight_smile:

1 Like

This looks like exactly what I was looking for. Thanks for sharing this!

2 Likes

Well, itā€™s more of GMod Playable Piano support, and there are still a good chunk of sandbox servers and stuff using it, so thatā€™s probably why.

3 Likes

could you link me to a converter, i canā€™t seem to get any to work properly, they all just seem to play notes at random, no matter what i import

1 Like

@Light08
Glad you like it :slight_smile:
The next version will have support for the spacebar on drums, something the current version doesnā€™t handle.
Maybe I should change the name at some point, itā€™s pretty much an instrument player at this point :grin:

@Nate214
I donā€™t know of any converters as I havenā€™t used one myself yet. But maybe check the piano lesson sharing thread :slight_smile:

2 Likes

Can you add key combinations to start, stop, and pause the song? That way if we want to do any of those things we donā€™t have to tab out or go to the piano player window and have it spazz out while spamming keys.

Also, it doesnā€™t seem to be able to play black keys.

1 Like

I will have a try at the key bindings. :slight_smile:

I thought I fixed it so it would use black keys. Iā€™ll have to look into that then.

2 Likes

Oh also the program doesnā€™t seem to auto focus on the game, could it have to do with the fact that iā€™m playing in windowed borderless?

1 Like

I have the same problem and I am looking into it.

It works fine if I use it on notepad, but the game refuses to go to focus, even in windowed mode.
So the code must work correctlyā€¦ Might be something with permissions or something.

2 Likes

Well just put something in this post if you figure it out <3

1 Like

Well, Iā€™m almost done with the keybinding system. That should make the problem less annoying :slight_smile:

1 Like

Ah, itā€™s interesting to see another piano player being made. Looks like youā€™ve got some interesting features in this one too. Great job!

@Matias Are you aware there is already a TU Pianer? 5 weeks ago Reimu uploaded it to her Dropbox.

Also, 1-2 weeks ago I went through the gmod tower piano notes thread and copied over every single song that I could find. The only songs that I donā€™t have from the entire 44 page thread are the songs that were saved as pictures. I also went through the TU piano notes thread here, but there were far less to get.

I have literally every song aside from that. And it took me hours to gather them all. If you want me to upload all 750 songs, like my post and ask. Iā€™ll send you a link. Iā€™m going to post a thread with all of the songs if you want them. But to use all of my songs on your piano player you would have to implement the timings. All of the notes are there though.

I even have Gwyn, Lord of Cinder :smile:

6 Likes

I was not aware of the other player, no. I had an idea I couldnā€™t be the only one thinking about it :grin:

It would be nice to have access to the songs, thatā€™ll give me some more material to test the program on :slight_smile:

2 Likes

Hehe, well thats okay, yours will be better in the long run. Reimuā€™s runs faster right now (since all of the sheet music is already setup), but yours will be a lot easier to use once you have more sheet music. :smiley:

Iā€™m writing up the thread now and will edit this post with a download link when itā€™s done. :thumbsup:

2 Likes