Today I have more time to lose than you'll ever have
-
C++ piano bot.
Basically roaming around some servers and get people to believe I’m skilled at this -
Nice!
Do you have some technical details or source for us? Really interested in how you got it to play that specific song.
-
@Almost said:
Nice!
Do you have some technical details or source for us? Really interested in how you got it to play that specific song.
I have a few details to sort out regarding the midi files parsing, but I plan on releasing the sources :).
Technically, it’s pretty straightforward
The bot can parse midi files or piano sheets files into a queue of ‘notes’.A ‘note’ is made of three components:
-WinApi ScanCode
-Shift key status
-Delta timeThe Windows ScanCode is retrieved using the winApi’s MapVirtualKey function.
The shift key status indicates wether we are dealing with an ‘upper’ key or not, since winApi uses one scancode per ‘character’
The delta time is the time in micro seconds between a key press and the one before
The key inputs are sent through the winApi’s SendInput function.
When the delta time of a note is 0, it is packed and sent with the previous one.The process runs in background. You just have to join a server, launch the bot and sit all comfy while people believe you are a music whizz kid.
BTW the original song
-
Ah nice. I didn’t even think of mapping midi to key inputs.
Full disclosure: I did’t like Amelie.