A couple weeks ago was another splendid game jam, this time held at the art institute in Portland, organized by the excellent PIGSquad (Portland Indie Game Squad). I was in the mood to learn a bunch of new technologies, and to experiment with audio visual synchronization, which I intend to use heavily in a lot of my upcoming games. The audio program I’m using is called Renoise, and the graphics framework I’m using is called Cinder.
I have been trying my hand at music production with Renoise, a modern take on an audio tracker (similar to MilkyTracker, FastTracker, etc.) which are a favorite with programmers trying to synchronize audio and visuals. Songs are essentially programmed, and in Renoise’s case, the song information is encoded in a handy XML file. You can see what the program looks like below:
I hope to make an update in the future to look at how to decode a Renoise file and use it for audio synchronization inside your game, but I recommend this excellent presentation by Soledad Penades called Using (and abusing) Renoise as a demosequencer.
Very fortunately, Spamtron was also in attendance at the MayhemJam. Coincidentally, he happens to do do some of his work using Renoise, and was very excited in the audio synchronization tool I was writing, and graciously agreed to help write some music for me to test out the tool, though I wasn’t able to integrate it with the gameplay with the time we had left in the jam. His primary gamejam entry also relied on strong audio visual synchronization (it was a very common theme this time!). Josh, the lead programmer for the team was interested in writing a FPS in unity and leveraging some FFTs and beat detection algorithms. You can take a look at their excellent entry here.
I planned on keeping my entry to a very manageable size. Honestly, I had a very simple idea for gameplay, and my intent was to focus on the tools. I planned on taking the Renoise parser away from the game jam so I wanted to spend significant time on that (I ended up spending a day and by the end it was fully functional). I also wanted to try my hand at a new interesting library. I’ve been following Cinder for quite some time; I find creative coding frameworks such as Cinder and Processing very interesting, and Cinder in particular is written in C++ and I feel is capable of producing reasonably high quality graphics in real time (without too much effort that is). It uses OpenGL for rendering, and compiles on windows, mac, and iOS. I hoped to get an iOS version of my game working, but after running into a number of XCode issues I was already tired enough and didn’t want to mess with it.
In addition to the XCode issues, I believe Cinder also has a bug in the audio playback; specifically I wasn’t able to loop an audio file for playback. There seems to be known issues reported on the forums, but no real fix mentioned. So instead of messing with Cinder’s audio, I ported over my OpenAL + ALUT code from my own engine, which worked excellently. However, once I added OpenAL, then mac and iOS support became a real chore. This is something I’d naturally like to address, but it was out of the scope for the jam.
Overall, Cinder was very straightforward and easy to use. I’m a bit of a control freak when it comes to owning the main loop, which Cinder takes away from you in favor of allowing you to implement some initialization, update and draw callbacks. However once you subscribe to the programming model, there are a lot of convenient tools in the framework. Audio was easy to program despite the audio looping bug. And the XML parser for Renoise files was surprisingly straightforward to write. Oddly, the most difficult aspect of the framework was getting text on the screen. My custom fonts weren’t loading, and even when using default fonts they display with an opaque background (I couldn’t figure out how to set the opacity very quickly, so I left it alone). Game logic was extremely simple, so in all, the only significant programming effort went into the audio synchronization code.
In the end, while gameplay took a back seat on this one, I was very excited to write a nice Renoise parser and audio synchronization tool, as well as get some practice with the Cinder framework and audio production. Stay tuned for more slick audio/visual synchronization demos!
© 2018 Halogenica | Stumblr by Eleven Themes