Algorithmic Beat Mapping in Unity: Outro

Jesse
Giant Scam
Published in
2 min readFeb 27, 2018

Github Repo

This public repo is yours to clone and experiment with. While you’re welcome to contribute, I don’t plan to maintain this code sample long-term. If you get a chance to use it in a project, please give me a shout!

https://github.com/jesse-scam/algorithmic-beat-mapping-unity

What’s Next?

Once you are reliably and accurately detecting beats in your audio files, there are a few things you can experiment with to fit the algorithm to your particular use case:

  1. Running the spectral flux algorithm on different sub-ranges of the frequency spectrum. I give you a hint on how to do this in Real-time Audio Analysis Using the Unity API.
  2. Finding the threshold sensitivity time frame and multiplier that work best for your use case.
  3. Getting deeper with Threads to speed up the preprocessing analysis. It takes about 8 seconds for a 5 minute song on my machine.

What you choose to do with the detected beats is what makes each use case unique. Once you have all the peaks in all the frequency ranges you care about, how do you determine which groupings of beats give you the best gameplay? This is completely up to you for what fits your type of game best, but you should now have all of the data to start experimenting!

Outro

I started this article as self-documentation to reference as I experimented with algorithmic beat mapping. I had never intended to include algorithmic mapping in Chop It, but the engineering challenge seemed interesting so I gave it a shot. After many dead ends and finding a general lack of understanding about how to do something like this in Unity, I wanted to share what I learned with the game dev community.

Shout outs:

Dylan Fitterer (https://twitter.com/dylanfitterer) for nailing this down years ago with Audioshield and inspiring me to take a stab at it.

Jashan Chittesh (https://twitter.com/jashan) for great conversation around VR rhythm games and for truly innovating in the genre with Holodance.

Dr. Eric Carr for proofreading my posts and helping me gain a much deeper and clearer understanding of the audio side of things!

Mario at Bad Logic Games (http://www.badlogicgames.com) for writing an amazing article about onset detection. You made this article series possible!

Tanner Netterville (https://twitter.com/rennat) for starting to work on art for Chop It so I don’t sit around for 2 more months writing blogs about algorithmic beat mapping.

Charlie Winsmore (https://www.twitch.tv/charliewinsmore) for helping me create the smallest gaming company with the best name of all time.

Everyone else that listened to me rant about this at a bar or over lunch for the past 2 months. You are saints.

Please don’t hesitate to reach out to us at scambot@giantscam.com or on Twitter at https://twitter.com/giantscam. Show us what you’re making!

Until next time!

Join our Mailing List: https://goo.gl/forms/3TApneFymVSVgjsZ2

--

--

Jesse
Giant Scam

Lead Developer / Co-Founder of Giant Scam Industries