Please, please help me...a game based on generating random sound files?

ShakespeareShakespeare Member, PRO Posts: 25
Hello everyone! So many great posts...what an inspiring community!

I'm new to this forum and about a month into the software and am desperately hoping you smart people can get me out of a bind. I've searched the threads and can't come up with a solution and there's no template offered for this. I'm at a dead-end after several frustrating weeks.

I want to create an exercise app like the ones at the link below but using sound files instead of lights.

http://www.exergamefitness.com/products/item.php?show=touch_wall

The app/game calls out a random number 1-40 and you respond by touching the designated number on the wall. I've seen the great youtube videos from t-shirt booth and others, but the randoms created are visual. I'm trying to do sound files only and the only visual would be a control interface (option for slow, medium, and fast, and time per session).

I really need your help, even if you only have a theory please, please chime in.

Thank you!!!!!!!!

Best Answers

Answers

  • artfishartfish Member, PRO Posts: 369
    edited April 2013
    @Shakespeare I checked out your link, but I'm confused on what your trying to do. I would like to help ;) I see that the game calls out a random number and you touch the space on the wall- how do the sound files fit in to the picture?
  • mounted88mounted88 Member Posts: 1,113
    @shakespeare so you want a wall of lights and each time one is pressed it plays a sound? Correct
  • ShakespeareShakespeare Member, PRO Posts: 25
    Sorry! No lights, there are numbers on the wall (the idea is similar in concept to what's at the link). It works like this: You select level, then number of rounds, game time, then start. The app starts sounding off numbers randomly between 1 and 40. Each time you hear a number you must touch the corresponding number written on the wall. It's a fitness program of sorts. So the app is randomly sounding numbers. No problem repeating any one number more than once, it just needs to be random and not in sequence. I hope this makes sense...

    THANK YOU so much for lending your expertise.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    It's not hard to make this. I'll see if I can provide a demo for you.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Here's the demo.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822
    Here's the demo.
    Cool ! Works really well ! :)>-
  • ShakespeareShakespeare Member, PRO Posts: 25
    Tatiang,

    Am DYING to see this demo! I noticed you did this in 20 minutes, indeed I have wasted weeks of my life cursing at myself instead of asking for help.

    Having a little difficulty opening - hitting the PC didn't help. I'm guessing it's because I'm on Windows so I will get access to a Mac. If this is the fix I am looking for I will be in touch to express some appreciation.

    Thank you for taking the time to help me.
  • artfishartfish Member, PRO Posts: 369
    @Tatiang. Nice- that's pretty much exactly how I would have done it. ;)
  • ShakespeareShakespeare Member, PRO Posts: 25
    edited April 2013
    I am so not worthy...

    thanks so much for the link to convert. Am still having some issues opening, the Windows version of GS (at least for me) has been glitchy at times. I'm weeks into this with a bruised ego so will find a Mac come Hell of High Water to look at it Thanks not only for your expertise, but helping so quickly. Am very grateful.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2013
    Here are screenshots of all of the rules so you can build it in Windows if need be.

    I didn't include the Score actor, but you could use DisplayText for a really simple score display if you like.

    image


    The square actor is just what it seems like... a square that you click/tap when you hear the right sound (e.g. tap the "1" square when you hear "1"):

    image


    The sound control actor is an off-screen actor that plays sounds based on the random number that is generated (see randomizer rules at bottom of this post). This shows the first rule of 6 (in my demo there are six squares and six sounds). Just copy it and change the right side of the equation to 2 and the sound file name to 2 (or whatever you decide to call the second sound), then to 3 for the next rule, etc.:

    image


    The randomizer is an off-screen actor that chooses a random sound every x seconds:

    image

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ShakespeareShakespeare Member, PRO Posts: 25
    TiaTang...I'm back! Hell and High Water is here and my new MacBook Air is now in hand!
  • ShakespeareShakespeare Member, PRO Posts: 25
    tatiang...this has been a great start. May I ask a question please? With the randomizer, can you offer insight into how to configure so when a single sound file plays, the second sound file begins only after the first sound file is finished? Currently when it begins it plays the next file on a timer, the conflict is that each following sound file is either slightly longer or slightly shorter than the previous one which makes it overlap after the first five or six play. Am grateful for any insight you might be able to offer.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2013
    I'm not sure about that. Music/sound isn't really my specialty. One workaround is to modify the sound files so that they are the same length (e.g. add a second of silence at the end of a 5 second sound while leaving a 6 second sound alone). Others may have better suggestions.

    Although this seems to indicate that there isn't really an easy way to do this: http://forums.gamesalad.com/discussion/55147

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ShakespeareShakespeare Member, PRO Posts: 25
    Understood. Thanks again for getting me turned in the right direction.
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    @Shakespeare From looking at the screenshot there is an 'every x seconds timer'.

    You can make x a real attribute which is the length of each audio clip. Let's call it game.soundDuration

    So if clip1 is 2.2 seconds add that info to your list of tracks to play.

    e.g when game random = 1

    Play sound clip1
    and change game.soundDuration to 2.2

    So now the next clip to play will only play after 2.2 seconds

    And if timers are a problem for some reason just make an integer attribute with a value of zero and use the following rule instead of a timer:

    when game.zero = game.time%game.soundDuration
    ... do stuff

    But yes, as @tatiang pointed out the easiest way is to just make every sound the same length! That might actually make the game nicer as it would have a steady rhythm.
  • ShakespeareShakespeare Member, PRO Posts: 25
    Thank you both so very much! Will let you know how it goes!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    One clarification, @HoneyTribeStudios. I meant that s/he could "pad' each sound with silence. So if the longest sound is 4.5 seconds long, each sound shorter than that would have silence added (e.g. 3.2 seconds of sound + 1.3 seconds of silence = 4.5 seconds).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • ShakespeareShakespeare Member, PRO Posts: 25
    I was able to upload all of the sound index, thanks to you both. One of the challenges I continue to encounter are sound file duration conflicts (overlap).

    HoneyTribeStudios,

    Your guidance seems to be exactly what I need to do and I've tried to work this but my feeble abilities keep getting in the way. I know this is probably basic stuff, but would it be too much to ask if you could dummy this down a bit please?
    @Shakespeare From looking at the screenshot there is an 'every x seconds timer'.

    You can make x a real attribute which is the length of each audio clip. Let's call it game.soundDuration

    So if clip1 is 2.2 seconds add that info to your list of tracks to play.

    e.g when game random = 1

    Play sound clip1
    and change game.soundDuration to 2.2

    So now the next clip to play will only play after 2.2 seconds

    Is the attribute added to each of the Rules for every sound file (Play Sound) or do I need to adjust the Randomizer? It looks like the actual rule for each sound and then add the duration for that particular sound (i.e. 2 seconds, 5 seconds, etc).

    Sorry, I got spoiled by tatiang with the visuals!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @HoneyTribeStudios is suggesting that you change the duration value each time you select a random sound. The timer has an attribute for the duration instead of a static value. So when sound clip1 gets played, you change attribute game.soundDuration to 2.2 and then the timer is already set to use game.soundDuration as the duration for the sound.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    Yes, as @Tatiang described is what I meant.

    So if you have 3 sounds clips and their durations are

    clip1: 2.2 seconds
    clip2: 4.0 seconds
    clip3: 5.3 seconds

    In your timer you have:
    Every game.soundDuration seconds change game.clipNumber to random(1,3)

    Then you make your rule

    When game.clipNumber = 1
    Play soundClip1
    Change game.soundDuration to 2.2

    otherwise

    When game.clipNumber = 2
    Play soundClip2
    Change game.soundDuration to 4.0

    otherwise

    When game.clipNumber = 3
    Play soundClip3
    Change game.soundDuration to 5.3

    etc

    And if timers give a you a problem you can replace with:
    when game.0 = game.time%game.soundDuration
    change game.clipNumber to random(1,3)

    Don't worry about not getting it right the first time. I'm sure that'll only make it more satisfying when you do get it working how you want. :)
  • ShakespeareShakespeare Member, PRO Posts: 25
    Thank you both for your help and also for being so patient. I have been trying to work this and I think I'm missing something that's probably obvious. On my version (10.3) there isn't an option for designations like game.soundDuration and game.clipNumber so I am attempting to enter this manually. Is this the correct path?
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    I had the same issues with my game that is announcer reactive. What I did is set a play sound Boolean. Put it as a condition in each sound. In each rule when the sound is active it changes the Boolean. This will lockout the others. In the rules I put an after timer with run to completion checked the time will be the length of the sound +.2 and in that timer put a change attribute to switch the Boolean back.
  • ShakespeareShakespeare Member, PRO Posts: 25
    Sorry for the delayed response, am still trying to work the problem. Thanks so much @FryingBaconStudios for your insight.

Sign In or Register to comment.