Getting sound to play over another sound

asiammyselfasiammyself Member Posts: 3
Hey guys,
First post here and so far gamesalad is pretty cool. I'm working on a piano currently and have run into a problem. I've tried trouble shooting but nothing seems to be working. Anyways the problem is I have a piano and it plays a note and then fades out after release. So if the user tries to hit it again before it fades out I have tried to play the same sound over it. So for example I hit the key it plays sound and I release. It starts fading but I hit it again before it fades out so it plays sound 2 which is the same sound but I just made a copy. Seems like in theory it would work but I keep getting this glitch when I try to do it.

Here is a download link to give you all an idea: http://www.2shared.com/file/ixt3jugc/piano.html works pretty well but try a quick double click and you'll see what I mean. Anyways any ideas?

Comments

  • asiammyselfasiammyself Member Posts: 3
    Sorry guys bad link. This one works I tested it: http://www.mediafire.com/?5hae7066r9p4o2m
  • CloudsClouds Member Posts: 1,599
    How are you achieving the release ?

    Individual piano keys are not polyphonic (pianos *keyboards* are) - so if you hit a real piano key once it sounds, but hitting the same note again (before the sustain/release has finished) kills off the sustain/release of the previous note.
  • asiammyselfasiammyself Member Posts: 3
    Well to trigger the sound I'm using an actor attribute so:
    when key is hit attribute equals 1. When attribute is 1 trigger sound.
    when released Interpolate attribute back to 0. (which fades note out)

    You do make a good point about the sustain of the previous note. I'm going to go ahead and try revise the behaviors and post what I get.
  • asiammyselfasiammyself Member Posts: 3
    I tried to revise the code and I still get a kinda of audio glitch going on when I do a quick double touch. here is the new file: http://www.mediafire.com/?ou1qjv6611aq686
    Whats going on?
  • CloudsClouds Member Posts: 1,599
    edited December 2011
    ...
  • asiammyselfasiammyself Member Posts: 3
    Sorry that was the same file messed with it some more seems like it is my interpolate that is messing things up. Without interpolate I don't get the glitch. Any ideas how to incorporate a fade out without getting the glitching I'm getting? In this file there is a rule when released with an interpolate and a change attribute. Change between them to see the problem with interpolate. http://www.mediafire.com/?9z5g7zt15z87spv
    I appreciate any ideas to get this working.
  • CloudsClouds Member Posts: 1,599
    @asiammyself

    What kind of glitch are you getting.
Sign In or Register to comment.