Adaptive Music (seamless transitions)

  • <font face="Arial, Helvetica, sans-serif"><font size="6">Try it out!

    Adaptive Music in Construct 2</font>

    <font size="4">Sample CAPX</font>

    Here's an example for how to implement adaptive/interactive music in C2. I use the word adaptive instead of interactive, because I tend to think of interactive music to be something more generated on-the-fly. Adaptive music is what is more commonly done to seamlessly transition between multiple versions of a sound piece.

    I have 3 themes in this demo (A, B, and C) and moving the ball to each of them will trigger a different version of the track that is currently playing. There is also a "Bigger" button that switches each of those out for a more intense version of each. You could even go one step further and incorporate C2's audio effects into the mix for some really neat results.

    As-is, it works the same on every platform that I've tested it on (Chrome, Firefox, and IPad 2 Safari), and should do the same elsewhere. There is a workaround in place for the looping since looping audio isn't identical in each browser. Even with looping on, I sometimes get a gap even in Chrome (but not every playthrough). The method I've used isn't perfect time-wise, but works everywhere. You could also write your music pieces so the end of the audio hangs over/bleeds over into the start of the next iteration (I do it in Courier), but I wanted things to be clear and concise for this demo.

    I also admit to throwing the actual music together pretty quickly just to have it working. <img src="smileys/smiley17.gif" border="0" align="middle">

    The controls are simply Touch, Mouse, WASD, or Arrow Keys. Let me know what you think!

    <font size="6">Try it out!</font>

    </font>

  • That is quite good!

  • i like it, any chance for an example capx?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • i like it, any chance for an example capx?

    Absolutely. I wanted to hear back that it worked for people first. The only place I've seen it have issues is a slower phone, but seems fine everywhere else regardless of if it supports the web audio API or not.

    You'll see in my capx the shenanigans I did to make looping work correctly (close enough) without the web audio API <img src="smileys/smiley17.gif" border="0" align="middle">

    But, yeah. I'll put the capx up a little later today.

    EDIT - Okay, the capx is up. I also sped up the the transition a little bit in the preview. Enjoy! Adaptive Music capx

  • thanks for capx <img src="smileys/smiley4.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)