Best way to sync events w/ music?

Get help using Construct 2

Post » Sat Sep 29, 2012 9:38 pm

I'm wondering what the best way to sync events with music is. Normally I just use "compare time" or I constantly add n*dt to a value and use that but it would seem, every now and then and most likely due to load times or something, that the music and events get out of sync. I wait until all audio is pre-loaded before starting the game, though..so hm. Anything else I could be doing?
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sat Sep 29, 2012 9:45 pm

With audio support as it is, there's probably not much you can do. Perhaps there's something in the Web Audio API, but I'm not sure.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sun Sep 30, 2012 9:47 am

Are you looking for a one-time synced event, or for an event to happen multiple times in time with music?
B
14
S
1
G
2
Posts: 85
Reputation: 2,810

Post » Sun Sep 30, 2012 11:39 am

Hmm. I guess imagine Tom & Jerry and how the music is synced with their movements, just on a MUCH smaller scale.

Say there's a scene when the music smoothly transitions from happy to sad, and something in the game reflects that - or maybe a song is playing through the intro and it only goes to the title screen when the song 'kicks off' - all that has to be perfectly in sync or it will look bad / cause upcoming events to be out of sync as well.

Tracking down the milliseconds and executing the right event(s) based on that seems to be the only thing I can do, and it works pretty well provided there are no lag spikes / slow load times or something...but they are inevitable it seems.Tokinsom2012-09-30 11:40:10
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sun Sep 30, 2012 2:07 pm

Wouldn't be it cool, if there would be a midi-engine playing midi files and also trigger events based on the midi-file?!?

....just dreaming.....
B
42
S
19
G
12
Posts: 723
Reputation: 13,911


Return to How do I....?

Who is online

Users browsing this forum: jobel and 20 guests