Adaptive Music (seamless transitions)

Show us your completed creations made in Construct 2

Post » Thu Sep 05, 2013 11:24 pm

Try it out!

Adaptive Music in Construct 2


Sample CAPX


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.

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

Try it out!
C-72013-09-09 15:55:02
B
103
S
38
G
19
Posts: 962
Reputation: 17,986

Post » Mon Sep 09, 2013 11:31 am

That is quite good!
B
10
S
1
Posts: 54
Reputation: 958

Post » Mon Sep 09, 2013 12:06 pm

i like it, any chance for an example capx?
B
79
S
28
G
108
Posts: 194
Reputation: 59,906

Post » Mon Sep 09, 2013 3:04 pm

[QUOTE=totoe] i like it, any chance for an example capx?[/QUOTE]

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

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 capxC-72013-09-09 15:55:25
B
103
S
38
G
19
Posts: 962
Reputation: 17,986

Post » Tue Sep 10, 2013 2:26 pm

thanks for capx
B
79
S
28
G
108
Posts: 194
Reputation: 59,906


Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 1 guest