• Categories
    • Unread
    • Recent
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Today I have more time to lose than you'll ever have

    Scheduled Pinned Locked Moved General Computing
    4 Posts 2 Posters 574 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • theDaftDevT Offline
      theDaftDev
      last edited by theDaftDev

      C++ piano bot.
      Basically roaming around some servers and get people to believe I’m skilled at this

      https://www.youtube.com/watch?v=dY8zAmMWlyE

      1 Reply Last reply Reply Quote
      • AlmostA Offline
        Almost
        last edited by Almost

        Nice!

        Do you have some technical details or source for us? Really interested in how you got it to play that specific song.

        theDaftDevT 1 Reply Last reply Reply Quote
        • theDaftDevT Offline
          theDaftDev @Almost
          last edited by theDaftDev

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

          The 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

          https://www.youtube.com/watch?v=yYGpQSAf0Ac

          1 Reply Last reply Reply Quote
          • AlmostA Offline
            Almost
            last edited by

            Ah nice. I didn’t even think of mapping midi to key inputs.

            Full disclosure: I did’t like Amelie.

            1 Reply Last reply Reply Quote
            • 1 / 1
            • First post
              Last post
            Online Users