Multiple Sounds At Once Issues
SnapFireStudios
Member Posts: 1,603
Hey,
For my upcoming game, Music Magic, I have to play up to 14 sounds at once. But the catch is, about .2 second later I have to play 14 sounds again... etc.
I have done some tests and see that GS just isn't up to handling this kind of sound producing. Are there any way around this? If I can't do this, iI'll have to forget about this idea, and I don't want to do that.
Any advice?
- Thomas
For my upcoming game, Music Magic, I have to play up to 14 sounds at once. But the catch is, about .2 second later I have to play 14 sounds again... etc.
I have done some tests and see that GS just isn't up to handling this kind of sound producing. Are there any way around this? If I can't do this, iI'll have to forget about this idea, and I don't want to do that.
Any advice?
- Thomas
Comments
@SnapFireStudios Hi, do you mean that the first 14 sounds (or some) are clipped by the second lot 0.2 of second later? You'll need to replicate the same sound i.e have more than one of each sound, so they can "overlap". It'll need a few Rules too, each of the sounds with an integer attribute, so they can be looped through the same set; if you see what I mean.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
So.. this is the same exact sound file being played at the same time by 14 actors, and then the sounds being player 14 more times by 14 more actors .2 seconds later, and again, etc.
So two of the same sounds not be played at the same time?
- Thomas
@HoneyTribeStudio Hi Shaz, even with Play to Completion checked, a touch pressed or any other trigger will still cause a Play Sound audio file to start from the beginning again... unless i'm misunderstanding something now....
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
There is a 14x14 grid, and I have an actor that goes across the scene with a move behavior. When it colides with the tile actors, they are supposed to make a sound, if they are toggled.
But just to test I made half of them toggled so that it has to play 7 sounds about every .2 seconds. These sounds last about 1.5 seconds for reverb. Anyway, at first no sounds were made at all, but when I slowed down the bar they started being made, but in a very buggy way. Also, the sound quality was very bad on the ones that did play.
Are there any ways to optimize this? I need to be able to use high tempos. Is it because it's done when it collides with the actor?
Thanks,
- Thomas
EDIT: I got it to play, but it slows down the bar with the move attribute when it gets to the layer. I have to have this bar moving at a steady rate across the screen at all times.
EDIT 2: If I check 'Play To Completion' it won't let me play the same sounds again .2 seconds later.. so I can't do that.
Hi @SnapFireStudios
EDIT: I was typing a comment while you were typing, but I've deleted my comment now.....I'll read your comment and be back now you've supplied more info!
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I'm going to do some testing, i'll get back to you.
- Thomas
Hi Thomas, You say you want sounds on collision, then you say you've given them a time constraint ("about every 0.2 seconds")
As far as I understand from your description then, have your sounds triggered when colliding, but delete that time constraint, in other words, the sounds will play straightaway when colliding, and you don't need any other rules/behaviours there....
Another thing to check: make sure the collision rules are in the tile actors, not in the moving actor.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Trigger sound A (which last 1.5 seconds) at 0:00. Keep 'play to completion' ticked.
Trigger sound A again at 0.02
Both occasions of sound A being played will be correct. The sound won't be cut off. Pretty sure that's how it woks in GS from memory.
Does using a move behavior and collisions keep accurate time? Not tried that but it sounds like a potentially unreliable way of doing it?
Why not just use time references that relate to the game.time?
As for the initial issue, is it a problem on the initial playing of sounds or every time? i.e did you have all the sounds play silently at the start of the scene to make sure they are loaded into RAM?
Then when they are all loaded in you can start triggering them in-game without any stuttering issues.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Also, the sounds are still extremely glitchy. I guess GS's sound system just isn't able to cope with many sounds played one after the next, especially not without affecting the speed of other thing, like a move behavior.
- Thomas
As for GS clipping the sound when it's repeated, that doesn't happen in my projects at all, and if sounds are getting cut off, it's probably due to the device running out of channels to play the sound and it's automatically killing the oldest sounds. That's just a guess, but that's how desktop sound devices have worked as long as I've used a computer (30-ish years) so I can't imagine anyone has reinvented the wheel for mobile.
So.. is GS not able to handle this? I know that it's not the device, because some other apps do a great job of it. (Like Beatwave)
Thanks for the help,
- Thomas
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Though if it's a ToneMatrix clone as @SnapFireStudios suggests, and the sounds are triggered by enabling each button, then that shouldn't count as the same Play Sound behavior, right? Because I have duplicates of the same rule on multiple objects and they don't cut each other off.
Just to avoid wasting time with guessing games.
But yeah, what @PixelMetal says sounds like a practical explanation.
As far as I can gather from @SnapFireStudios each tile has it's own Play Sound behaviour, so being individual actors, it doesn't matter that some might call up the same sound file from their individual Play Sound behaviour.
It sure would help more seeing the game file from @SnapFireStudios to be certain though.... ;-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
- Thomas
OK Thomas, best of luck in sorting it, but if not, you're welcome to send me a copy as you said, and I'll take a look for you and hopefully get it sorted.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
However, when I try to do different pitches according to y position, the notes play from bottom to top even though they are all being touched at the same time. The highest tile plays a fraction of a second before the the tile below that, and so on.
Does GS do rules in actors from top left to bottom right or something?
- Thomas
Then on the scene the actor at the bottom of the layers list has it's rules processed first. The actor at the top has it's rules processed last.
If overlapping or colliding with actor: Middle Bar, and attribute self.toggled is equal to 1, then play sound: TestSound.
Then the volume is one, and the pitch is self.position.y/100. This gives me a good low and high note range. But then when they collide and are toggled, the top pitched one plays first
@ HoneyTribeStudios all of my tiles are placed randomly and at different times, not necessarily from bottom to top or top to bottom. I have tested in different places in the grid also.
Thanks for all the advice,
- Thomas
Thanks for all your help everyone, hopefully now everything will work as planned.
- Thomas
Another work around. I have had similar troubles, the answer is to use a different kind of trigger. Using collision to trigger sounds only has maybe 3 or 4 polyphony and maybe 10 or so max polyphony when exported onto the device depending on the device. (in my tests anyway) In my project that has a billion snow flakes falling and I wanted a note triggered when each hit the ground I am using attribute self linear velocity >1 and having the snowflake bounce just a tiny bit when hitting the ground. Using this trigger yelds in hundreds of polyphony which is a big difference from 3 or 4 just by flipping out what triggers the sound. Hope this info helps others, there's always a workaround.