User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Most efficient way to create grid of squares that each play a different sound?

  1. #1
    No Products Registered

    Join Date
    Oct 2015
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Most efficient way to create grid of squares that each play a different sound?

    Hi there,
    I've created 6 rows, 24 columns long of identical square active objects.
    When the user clicks on one they play a sound.

    Being a coding novice I'm just copy and pasting in the event editor and then pointing to the new sound over and over.

    Currently this is a huge amount of code and I just wondered if there was a better way to do this?

    Is there a way to use just use one active object that is duplicated and has a different alterable value depending on where it's positioned and then
    this looks for a file name named correctly to tell it which sound to play?

    Thanks in advance.

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jun 2011
    Location
    East of Africa
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Most efficient way to create grid of squares that each play a different sound?

    Just create one active object with alterable value name like ID which will be programmatically created in a grid fashion when frame loads. You can then assign unique or random ID basing on objects positions which would allow you to play different sounds basing on ID

  3. #3
    No Products Registered

    Join Date
    Oct 2015
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for replying.

    That's just what I've been trying at the minute, I've been playing round and I've used loops to create the grid from one active object. And I've assigned Alterable values to each so they all have unique values.

    Any tips on how to code the sound file bit?

  4. #4
    Clicker Fusion 2.5 Developer

    Join Date
    Jun 2011
    Location
    East of Africa
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Most efficient way to create grid of squares that each play a different sound?

    I'll try to make you an example when i get to my pc

  5. #5
    No Products Registered

    Join Date
    Oct 2015
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's really kind of you, looking forward to it, thanks!

  6. #6
    No Products Registered

    Join Date
    Oct 2015
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you get a chance yet?

  7. #7
    Clicker Fusion 2.5 Developer

    Join Date
    Jun 2011
    Location
    East of Africa
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Most efficient way to create grid of squares that each play a different sound?

    Yes. But it wasn't easy as I thought. May be someone could help.

  8. #8
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This should be easy.
    Is the final design meant to be playing audio files from a specific directory/ location on the disk?

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    Create the squares in a nested fastloop like suggested above, and store the square's ID in alterable value A. Rename alterable value A to ID.
    When the user clicks on a square, run a fastloop named "Play sample " + str$(ID("Square")) 1 time.
    Then have On Loop conditions for each sample like this: On loop "Play sample 0" -> Play sample "Gong". On loop "Play sample 1" -> Play sample "Boing" etc.....

  10. #10
    No Products Registered

    Join Date
    Oct 2015
    Posts
    181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there, thanks for the suggestions.

    The idea was that this would be an app for my android device so the sounds would be internal I guess?

    Basically it's 6 rows, 24 columns long of a guitar fret board. So that'll be 144 different sound FX to represent the different notes on a guitar. Mianly making it so I can practice on my commute

    Because it's so many sound files I was hoping there was an easier way to code the file it looked for... as in if the object IDs were from 1-144 and my sounds were named 1.ogg - 144.ogg, would there be some way to hook this up more simply?

    Thanks for the help.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 0
    Last Post: 26th January 2015, 03:20 PM
  2. How do you play default ios sound, eg the notification sound.
    By assentec in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 14th July 2013, 06:33 AM
  3. Snap to a grid during game play?
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 23rd August 2009, 04:09 PM
  4. Making the grid (squares) invisible
    By RickyRombo in forum File Archive
    Replies: 3
    Last Post: 27th February 2009, 11:51 PM
  5. Play sound IMMEDIATELY after other sound finishes
    By LazyCoder in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 1st September 2007, 12:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •