Search Unity

Creating a drumming game

Discussion in 'Getting Started' started by Jamand, Apr 9, 2021.

  1. Jamand

    Jamand

    Joined:
    Nov 10, 2014
    Posts:
    2
    Hello

    Apologies if this has been discussed before I am new to game development scripting, this forum and Unity.

    I am looking into creating a prototype of a game where you use keys on a standard computer keyboard as pieces of a drum kit in which you play along with a song( guitar hero drum kit type scenario). I understand how to create the drum sounds with designed keys and have created a dance dance revolution type prototype.

    The question i have is does anyone have advice on how to match up the key input drum noises with a real song? It would take an extreme amount of time to match up the correct position of a falling note on a screen to an audio file. Is there any programs where you can trace the exact time a key is pressed in relation to a song?. If so how could This could then be translated to Unity?

    Many thanks

    James
     
  2. Vryken

    Vryken

    Joined:
    Jan 23, 2018
    Posts:
    2,106
    I'm just throwing this as a random guess out there:

    If you want to map the inputs to the actual drum sounds in the song being played, then instead of mapping the inputs to play specific drum audio clips, you might want to do something like this:
    • Edit the audio file of the song and isolate the drums from everything else into its own audio track. I'm not too familiar with audio engineering, so I don't have the best idea of how that's actually done. I'm assuming you need a digital-audio workstation software such as FL Studio at the very least to do this, as I don't think Audacity or something similar has such a capability.

      If you're making the song yourself in a DAW, then this would be no problem.
    • Export the two separate audio tracks as their own audio files. One with just the drums, and the other with everything else in the song, then import both audio files into Unity.
    • Attach both audio clips to two AudioSources, and play them both at the same time to keep the drums & the rest of the song in sync.
    • In your gameplay logic, include a way to detect when the player hits and misses notes (you're likely already doing that anyway for a rhythm game).
    • When the player misses a note, mute the AudioSource that is playing just the drum track. When the player hits a note, un-mute that AudioSource.
     
    Last edited: Apr 9, 2021
  3. Jamand

    Jamand

    Joined:
    Nov 10, 2014
    Posts:
    2
    Thanks for the info! Will look into it all!
     
  4. stain2319

    stain2319

    Joined:
    Mar 2, 2020
    Posts:
    417