How do I generate a sequence of sounds

Get help using Construct 2

Post » Thu Apr 03, 2014 2:07 pm

I plan to create a music game and in this game player will have to repeat a sequence of notes in each step until complete the whole song. I would like an explanation on how to generate this sequence and how to compare it with the player sequence. Thanks.
B
74
S
13
G
4
Posts: 1,006
Reputation: 8,060

Post » Fri Apr 04, 2014 5:01 am

my first thought on this would be to associate each sound to be played with a series of numbers.. and making a variable for that.. so imagine

PlayNote = 0 (this is your global variable)

every 1.0 seconds

set value - Play note - Random (1,12)

then you'd have

system - Play Note = 1 Play Note 1 sound
once while true

system - Play Note = 2 Play Note 2 sound
once while true

etc..

This would of course just create a bunch of random sounds.. but you may get the idea.. you could manually set the order of what notes you want..

On start of layout

Play note 1 sound

Wait 1.0 second

Play note 5 sound

Wait 0.5 second

Play note 3 sound..

etc..


Also you might want to check out the midi plugin someone made (you'll find it under tutorials, just look up "midi"), but bear in mind its only known to work on web. I was unsuccessful getting it to work on iOS, but i'm not too savvy with it and didn't write the plugin.
B
59
S
9
G
1
Posts: 946
Reputation: 6,561

Post » Fri Apr 04, 2014 12:22 pm

@part12studios. Thanks for the suggestion

Racking my brain I got this solution:

Trigger Once: audio play 1 not looping from Sounds

Audio on 1 ended: wait 0.5 seconds
Trigger Once: Audio play 2 not looping from Sounds

Audio on 2 ended: wait 0.5 seconds
Trigger Once: Audio play 3 not looping from Sounds

etc
B
74
S
13
G
4
Posts: 1,006
Reputation: 8,060

Post » Fri Apr 04, 2014 2:54 pm

yea that sounds good. and i think if you look at the play options there is something in there that lets you know the sound is done playing..

yea if you go and add an event you'll see audio has an "On Ended" which could allow you to string sounds together based on sample length rather than time.. just an option to check into
B
59
S
9
G
1
Posts: 946
Reputation: 6,561

Post » Mon Apr 07, 2014 8:21 pm

Guys, I'm also thinking of this similar concept on sequencing audios, there's not much info and videos about this subject on C2. Would you care to share your capx so I can also have some initial idea of starting this project.

Thanks in advance.
B
47
S
14
G
20
Posts: 87
Reputation: 12,913


Return to How do I....?

Who is online

Users browsing this forum: jezjones24, MrQuickGame and 11 guests