0 Favourites

How do I generate a sequence of sounds

  • 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.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • 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.

  • 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

  • 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

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
187 45,120
Yann's avatar
Yann
Unread hot topic
99 10,124
karshinkoff's avatar
karshinkoff
Unread hot topic
80 10,053
jonathanbencomo's avatar
jonathanbencomo