Piano player


#1

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.


GM Tower Midi to Keyboard strokes converter?
Regarding Piano Macros
#2

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.


#3

What special character is that?


#4

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


#5

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:


#6

Why even add GMT support?


#7

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


#8

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


#9

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.


#10

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


#11

@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:


#12

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.


#13

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.


#14

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?


#15

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.


#16

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


#17

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


#18

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:


TU Pianer & Sheet Music Pack
#19

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:


#20

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: