How complex can you make the Music system?

SuperOwenSuperOwen Member Posts: 3
Hi! I'm brand new to GameSalad and I'm wondering about what I can do with the audio within the game - mainly, how complex you can make the music system? Are there any limitations when it comes to wanting to create complex music-based games?

The games I'll be wanting to make will be platformers with music at their core. When the player walks over pick-ups, coins, etc. can I bring in a melody line that is in time with the music? Can I add different effects such as reverb or a lowpass filter when I go into like a cave or underwater?

Kind of a big question I know, but any help would be much appreciated!
Cheers!
«1

Comments

  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    As complex as you want just as long as it doesnt take up too much ram and make you game slow
  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    edited December 2011
    You can add effects put when a actor jumps over a barrel you can certainly change the tune
  • CloudsClouds Member Posts: 1,599
    @SuperOwen

    There are no built in effects, you would need to bounce off a clean version + a version with reverb for the caves and a LP filter for the underwater parts.
  • SuperOwenSuperOwen Member Posts: 3
    Awesome, thanks for the info guys! So will I be able to bring in those other bounced versions on the fly? Would I be able to make it so when I go underwater the reverb bounce comes in and when I jump out it transitions nicely back into the original? What about the timed sound effects?
  • CloudsClouds Member Posts: 1,599
    The timed sound effects are possible - GS is polyphonic as are the platforms it runs on - and it has a timer built in (to several decimal places) so if you know your BPM you can have an attribute that forces the effects to only play at certain points (ie: you can make it quantize where you can play the audio).

    Sounds complex, but it's not really once you know the logic.

    As for cutting between differently effected bounces . . . . hmmm that might be possible, although not directly supported, I think the answer lies in chopping your song into small pieces (perhaps bars / half bars - or, depending on your tempo, even beats ?) - and have them play in sequence referenced to the game's clock - when you change scene > kill the reverb version > and jump over to the relevant 'block' of the non reverb version.

    Easily divisible tempos might help (120bpm comes to mind) - as would 4/4 timing.

    Or something to that effect, it's doable (I think) but GS is no Logic / ProTools !
  • CloudsClouds Member Posts: 1,599
    Hmmmmm . . . . . just tried some stuff (ignore most of above, I am over complicating it).

    It's really easy to move between (for example) a filtered (underwater) and dry (normal) version of the same piece of music - you simply have both playing and - depending on what you are doing you simply turn the volume of one up (while the other goes down).

    I just set up a little test, took a couple of minutes, grab a little block and pull it under water (the lower half of the screen) and the music loses all it's top end (filtered version gets turned up and the dry version gets turned down) - drag the poor little block out of the water and the volumes are swapped around again.

    Very simple to set up - and easy to control - and it's very effective too !
  • CloudsClouds Member Posts: 1,599
    edited December 2011
    @SuperOwen

    Here, I a made you a quick demo . . .

    As well as the filtering, I think the volume should drop the deeper you go underwater (again pretty simple to set up).

    Good luck with your project.

  • Rob2Rob2 Member Posts: 2,402
    edited December 2011
    Lovely little demo... just shows how important good audio can be.
  • morphinegamingmachinemorphinegamingmachine Member, PRO Posts: 449
    i thought u couldnt play two music files at the same time in game salad?
  • CloudsClouds Member Posts: 1,599
    > "i thought u couldnt play two music files at the same time in game salad?"

    You can't ! (but you can play numerous sounds at the same time).
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    At Tynan - nice effect.

    @SuperOwen If you use .ogg audio loops (so import as sounds) you can have a lot of layers and trigger things dynamically and in time. i.e have loops come in at certain time intervals so all the loops are in sync. Out GS game Honey Tribe does this:

  • SuperOwenSuperOwen Member Posts: 3
    Wow guys thanks for the help with this! And big thanks to Tynan for going out of your way to help, it really means a lot! :D
  • 3xL3xL Member Posts: 676
    hmm... for some reason when i try adjusting the audio through attributes and rules, it doesnt work on the device. but it does on the viewer on the mac..... wierd...
  • CloudsClouds Member Posts: 1,599
    @ SuperOwen

    > "Wow guys thanks for the help with this! And big thanks to Tynan for going out of your way to help, it really means a lot! :D"

    No problem, I am learning myself, attempting to answer other people's questions is a good way to learn - so thanks to you ! : ) as I now know you can do some pretty cool audio 'effects' based on the character's environment.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    @Tynan ... Any chance of getting a download of the demo from your video?
  • CloudsClouds Member Posts: 1,599
    edited February 2012
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    @Tynan ... Thanks mate, got it in the end! I was trying to switch using my trigger and forgot that the attribute was a boolean and therefore didn't have a value of 0 or 1. D'oh. However, I'm not sure I'm going to be able to implement it, having my 2 music files, 1 at normal and 1 filtered played as sounds adds like 40mb to the RAM!
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    So yeh @Tynan, it seems this will only be good for short loops like in your demo. I tried it with my music which is around 3 minutes long and each sound file now takes 40mb of RAM, so to play the 2 simultaneously takes around 80mb! Huge!
    No wonder when on importing GS asks if it is sounds or music and says if its over 30 seconds to use music!
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    "However, I'm not sure I'm going to be able to implement it, having my 2 music files, 1 at normal and 1 filtered played as sounds adds like 40mb to the RAM!"

    ??

    40MB (2 music tracks) isn't too much, iPhones/iPads have RAM in the gigabytes and typically hold hundreds of songs !? Or are you trying to keep below the 20MB threshold so people can download the app over a phone connection ?

    [EDIT: just read your second post . . . ]
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    No sorry i mean RAM not total game size! I think a 3GS will crash somewhere around 80-100mb RAM. Just the 2 sound tracks alone will almost crash the game on a 3GS, let alone everything else added. I do have a thread somewhere which has better amount of RAM totals where it will crash a game but would need to dig it up for better figures ... I just know 80mb RAM on 2 sound files is too much to have this feature implemented! Shame really but i can't justify it!
  • CloudsClouds Member Posts: 1,599
    "I think a 3GS will crash somewhere around 80-100mb RAM"

    Ah! Yes I see what you mean.

    I wonder if there is another way.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    edited February 2012
    Yeh its a subtle touch but its a nice feature i would like in my new game! Its those little things that if you get enough right of, can make a big difference overall.

    Im going to have a little play and see if i can come up with anything, if you chose to do the same, the audio length is on the main music so is a good 3 mins long! Its a shame GS doesn't let us play multiple music files.

    im wondering if i could maybe have a separate deeply muffled sound that i just play over the top to try and mask it. The object of my game is not to be in water so if you go in, will literally only last a couple of seconds.
  • CloudsClouds Member Posts: 1,599
    "Yeh its a subtle touch but its a nice feature i would like in my new game"

    Agreed.

    As the filtered version will have much less information in (you're essentially rolling off the top end) you may as well make it really low quality (like 32kbps) - so you have (example figures) a 10MB main track (unfiltered) and a 500kb muffled track - both the same length.

    Or as you say . . . just pull out a 4 bar loop from the main track and filter it to death and then stick it on loop, then cut to this when underwater.

    Or you could try some good old frequency modulation (keep the sweep of the frequency centred on 1 (pitch) and the sweep down and up equidistant and you will find you get your wobbly / crazy sound without the track losing sync . . . . hold on a minute let me knock up a demo, easier than explaining . . .

    "Its those little things that if you get enough right of, can make a big difference overall"

    +1,000
  • CloudsClouds Member Posts: 1,599
    Here you go, as an experiment it shows you what I mean, you could probably extract something a bit better out of the process by playing with the values of 'PITCH' . . . . it just uses one track, so easy on the memory, no switching between tracks or any behind the scenes trickery . . . and it sounds kinda' watery ! 8-X

    http://www.mediafire.com/?gsz7t01b3cz0o1n
  • CloudsClouds Member Posts: 1,599
    Or maybe simply drop the volume and mix in a short watery loop - but just keep the music loud enough to imply it's still there but underwater . . .

    Like this:

    http://www.mediafire.com/?x67cqs2w1y2c6sb
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    edited February 2012
    Haha I'm interested to see this demo because i literally have no idea what you're on about. haha.

    Yes i was using Audacity and using a filter to give that underwater feel. I then exported as mp3 and imported into GS and let that use its own compression method which gave me the 40mb per track. I then did the same but exported as ogg with a quality of 0 (the lowest), imported them but the same outcome size.

    So currently i have;

    Main track as normal playing as Music.
    When in water i interpolate the music volume down to 0.3 in 0.5 seconds
    I then play a bubbling/splashing underwater sound and also a chopped up 15 seconds of the main track, filtered with a ton of reverb.
    When not in water the sound effects stop and the music interpolates back to 1 in 0.2 seconds.
    This now using about 3mb RAM for sounds including my other sound effects i have in the game too :)

    Im quite happy with the result as you can still hear the main track but you get that filtered under water sound from the above effects. Like i said, literally you do not want to be in water in my game and when you are, it'll only last a couple of seconds.

    EDIT: Just see you've made the demos so i'll check them out now, cheers :)
  • CloudsClouds Member Posts: 1,599
    A splash noise on entering the water would help.
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    "Yes i was using Audacity and using a filter to give that underwater feel. I then exported as mp3 and imported into GS and let that use its own compression method which gave me the 40mb per track.

    You are compressing your audio on the way out of Audacity . . . and then compressing it again when importing it into GS, you gain nothing from the first compression process, you might as well export from Audacity as an uncompressed WAV/AIFF . . . . by compressing twice you only lose a little quality and gain nothing in memory savings.

    "filtered with a ton of reverb"

    Reverb drops off (is actually non-existent) under water, rather than increasing.

    "interpolates back to 1 in 0.2 seconds"

    If you interpolate it to 1.2 in 0.24 seconds you will get the same result but without GS's interpolate glitch . . . . audio volume can't go past 1, so it will be the same volume, doing this (1.2 in 0.24 seconds) simply places the interpolate glitch outside of your volume ramp.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    edited February 2012
    Ah yes, having now looked at the demos, the solution i came up with was what you had used in demo 2. Im pretty pleased with the results and had already had a splash noise on impact. Its pretty slick now and does add a little dimension :)

    I see regarding the compression etc, audio is not really one of my forte's, if it sounds alright is good for me :)

    Reverb ... I learn something new every day ... check that out! I just used it as it made the overall cut up filtered part more muffled, didn't really think about the technicalities of it, but now thinking about it, thats pretty logical.

    Nice tip on the interpolate part, whats this glitch as i have noticed one?
  • CloudsClouds Member Posts: 1,599
    edited February 2012
    "Nice tip on the interpolate part, whats this glitch as i have noticed one?"

    If you use interpolate to fade up anything that goes to 1 (alpha channel fade in or out / audio volume fade in or out . . . etc) then you will notice there is a glitch in the last part of the interpolation (it's actually the last 10%) - it essentially misses out the last 0.1 of the interpolation value . . . the result = smooth fades are ruined with a little jump at the end (the same goes for audio).

    So using interpolate (interpolating from 0 to 1) you think you are going to get . . .

    0
    0.1
    0.2
    0.3

    (cont . . )

    8.4
    8.5
    8.6
    8.7
    8.8
    8.9
    9.0
    9.1
    9.2
    9.3
    9.4
    9.5
    9.6
    9.7
    9.8
    9.9
    1



    But GS actually does this . . .

    0
    0.1
    0.2
    0.3

    (cont . . )

    8.4
    8.5
    8.6
    8.7
    8.8
    8.9
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1


    That is to say with interpolate there is no 9.0 to 1 !!! The first 90% is fine, but after 9.0 it just jumps to 1 !!

    Witness it for yourself:

    http://www.mediafire.com/?ziu9bt1ix6gw0eq

    Two squares . . . left hand side is interpolating the alpha channel from 0 to 1 over 5 seconds . . . . the right hand side is interpolating from 0 to 1.2 over 5.2 seconds . . . they both hit 100% opacity at the exact same time but the one on the right doesn't have the little glitch at the end (you might have to cover you hand over the one you are not watching).

    Using ease in / ease out (or any combination) makes the glitch worse (I won't explain why here, unless you want to be bored to death).

    So fading volume up go to 1.2 and multiply your fade time by 120%
    So fading volume down go to -0.2 and multiply your fade time by 120%
    So fading alpha channels up go to 1.2 and multiply your fade time by 120%
    So fading alpha channels down go to -0.2 and multiply your fade time by 120%
Sign In or Register to comment.