0
0

Hi,

Still a newbie, so I apologize if I’m overlooking the obvious.

I’m struggling more with the FMOD manual. Love your tool btw, but I find the manual to be lacking when it comes to helping understand real world applications.

Currently I am trying to understand some of the sound definition parameters . Specifically playmodes (sequential, sequentialeventrestart, random, randomnorepeat etc.) and their relationship to waveform’s weight and play percentage. My questions…

For which playmodes are weight/play percentage relevant? For example, if the playmode is set to sequential, does lowering a waveform’s play percentage have any effect? Or would altering the play percentages only affect one of the random modes? And if so, which modes specifically?

Another example of my confusion…if I choose ‘Randomnorepeat’, but then also set one of the waveforms within the sound definition list to have a low percentage chance of being selected, how do these two settings affect one another, if they do at all?

In the properties reference guide, under ‘Weight’ the description reads "States the weighted chance of the waveform being selected for playback", and under ‘Play Percentage’ the description reads "States the percentile chance of the waveform being selected for playback". But I see nothing that describes the relationships between these parameters to play modes. If there are certain play modes when ‘playpercentage’ or ‘weight’ would be irrelevant, shouldn’t it be stated somewhere (or better yet, shouldn’t these percentages be ghosted and uneditable if a non relevant mode is selected?) Sorry, just very confused here.

I did a small test. I created an event that has a sound defintion with 4 waveforms in it. I set two of the 4 sounds to a 0% play percentage, expecting to never hear these two sounds. Yet I still hear them quite regularly (I selected several different playmodes). What am I doing wrong?

Also, another simple task I’m not seeing the simple solution to…

Suppose I wanted an event to only play occasionally. For example, whenever a character swings his sword, we want there to be a 25% chance we hear a vocal grunt, and 75% of the time he will be silent.

What is the best way to accomplish this?

Thanks for the insights!

  • You must to post comments
0
0

[quote="jcobb":e9ewn57c]Ben, is the shuffle unique per event instance, or is it shared across all instances of an event?
[/quote:e9ewn57c]

It’s unique per event instance.

Ben

  • You must to post comments
0
0

[quote="Flying Poo":2pmz0imc]Hi,

For which playmodes are weight/play percentage relevant? For example, if the playmode is set to sequential, does lowering a waveform’s play percentage have any effect? Or would altering the play percentages only affect one of the random modes? And if so, which modes specifically?

[/quote:2pmz0imc]

My experience is the weight/play percentages work (as you would expect) when the playmode is set to random and the maximum number of spawns is set to 1. There may be some issues when auditioning these weighting changes in Designer. We’ve found in a couple of instances, the project needed to be saved – then re-opened to produce the expected results. This is being investigated now, and I imagine there will be a fix soon.

[quote:2pmz0imc]
I did a small test. I created an event that has a sound defintion with 4 waveforms in it. I set two of the 4 sounds to a 0% play percentage, expecting to never hear these two sounds. Yet I still hear them quite regularly (I selected several different playmodes). What am I doing wrong?
[/quote:2pmz0imc]

See the point above…this could be the issue that required as reopen.

[quote:2pmz0imc]
Suppose I wanted an event to only play occasionally. For example, whenever a character swings his sword, we want there to be a 25% chance we hear a vocal grunt, and 75% of the time he will be silent.

What is the best way to accomplish this?
[/quote:2pmz0imc]

  1. Create an event with two layers
  2. Create 2 sound definitions.
  • Sound defintion one contains the sound (or sounds) of the swinging sword.
  • You can set the playmode to whatever.

  • Sound definition two contains, the grunt sound and a ‘Don’t play’ entry.

  • Set the playmode of this sound def to random.
  • Set the weight of the grunt sample to 34%. You should see the Play percentage of the grunt sample is now 25% and the dont play entry is 75%, which is what you wanted.
  1. On layer one, add an instance of sound def 1 (sword swing)
  2. One layer two, add an instance of sound def 2 (grunt)

When the event is triggered, you see that the swinging sound is always heard, the don’t play entry is played ~75% of the time, meaning the grunt is heard on 25% of the swings.

More Designer tuorials are on the way!

  • You must to post comments
0
0

I’m finding that although the shuffle works fine when auditioning it in Designer, when I add it to my code it produces the same sequence each time I run the game. I tried seeding the random number generator using srand with different values in case it was that (as our code uses a custom RNG), but that still doesn’t work.

I even tried creating a simple shuffle in the simple_event example, and that does exactly the same, even with an srand. Any ideas?

  • You must to post comments
0
0

[quote="Templar":2u94ax60][quote="Flying Poo":2u94ax60]Hi,

For which playmodes are weight/play percentage relevant? For example, if the playmode is set to sequential, does lowering a waveform’s play percentage have any effect? Or would altering the play percentages only affect one of the random modes? And if so, which modes specifically?

[/quote:2u94ax60]

My experience is the weight/play percentages work (as you would expect) when the playmode is set to random and the maximum number of spawns is set to 1.
[/quote:2u94ax60]

Weights only have an effect when the play mode is Random or RandomNoRepeat. We’ll look into hiding the Weight and Play Percentage columns when the play mode is not Random or RandomNoRepeat.

[quote="Templar":2u94ax60]
There may be some issues when auditioning these weighting changes in Designer. We’ve found in a couple of instances, the project needed to be saved – then re-opened to produce the expected results. This is being investigated now, and I imagine there will be a fix soon.
[/quote:2u94ax60]

Yes, this has been fixed. The fix will be in the next release of Designer.

[quote="Templar":2u94ax60]
[quote:2u94ax60]
I did a small test. I created an event that has a sound defintion with 4 waveforms in it. I set two of the 4 sounds to a 0% play percentage, expecting to never hear these two sounds. Yet I still hear them quite regularly (I selected several different playmodes). What am I doing wrong?
[/quote:2u94ax60]

See the point above…this could be the issue that required as reopen.
[/quote:2u94ax60]

Yes, this is the most likely cause. If it still doesn’t work for you in the next release of Designer, please let us know.

[quote="Templar":2u94ax60]
* Set the weight of the grunt sample to 34%. You should see the Play percentage of the grunt sample is now 25% and the dont play entry is 75%, which is what you wanted.
[/quote:2u94ax60]

Or you could set the weight of the grunt sample to 25% and set the weight of the ‘Don’t play’ entry to 75% (I find this easier to understand).

Ben

  • You must to post comments
0
0

We too are finding that RANDOM works but SHUFFLE does not in our code.

  • You must to post comments
0
0

Thanks both for the prompt replies. I’ll try the suggestions!

  • You must to post comments
0
0

I’m also finding that if I have an event that references a sound definition with multiple waves, and playback is set to random, the first time the event is called by the game, it will always play ‘randomly’ from the beginning of the definition list. Ie : it plays the same sound the first time every time (not random).

Am I doing something wrong?

  • You must to post comments
0
0

WoW! That as a very helpful post. This should be dissected further and put in to the manual as a meaningful example.

I have a question to continue this example. Suppose I want to continually play background music. Once one track (wave file) finishes FMOD will reandomly choose another track and play it.

Here is what I did (but doesn’t seem to work):

  1. I created a [i:2qdwjs4p]Stream from Disk[/i:2qdwjs4p] wave bank called [i:2qdwjs4p]Music[/i:2qdwjs4p].
    1a. I added five [i:2qdwjs4p]ogg[/i:2qdwjs4p] files to this bank.

  2. I created a sound definition folder called [i:2qdwjs4p]Music[/i:2qdwjs4p].
    2a. I added the [i:2qdwjs4p]ogg[/i:2qdwjs4p] files from the [i:2qdwjs4p]Music[/i:2qdwjs4p] wave bank.
    2b. I set the [i:2qdwjs4p]Spawn time[/i:2qdwjs4p] to [0,1].
    2c. I set the [i:2qdwjs4p]Maximum spawned sounds[/i:2qdwjs4p] to 1.
    2d. I set th [i:2qdwjs4p]Play mode[/i:2qdwjs4p] to [i:2qdwjs4p]Random[/i:2qdwjs4p].

  3. I created a 2D Event called [i:2qdwjs4p]Music[/i:2qdwjs4p]
    3a. I set [i:2qdwjs4p]Max playbacks[/i:2qdwjs4p] to 1.
    3b. I added the sound definition folder [i:2qdwjs4p]Music[/i:2qdwjs4p] to the event on [i:2qdwjs4p]Layer00[/i:2qdwjs4p].

When I run my application, it just repeats the same music track over and over again. I know I am missing something.
[i:2qdwjs4p]I am running the latest stable FMOD and Designer (downloaded today).[/i:2qdwjs4p]

  • You must to post comments
0
0

[quote="crouton":19kdcdvn]I’m finding that although the shuffle works fine when auditioning it in Designer, when I add it to my code it produces the same sequence each time I run the game. I tried seeding the random number generator using srand with different values in case it was that (as our code uses a custom RNG), but that still doesn’t work.

I even tried creating a simple shuffle in the simple_event example, and that does exactly the same, even with an srand. Any ideas?[/quote:19kdcdvn]

[quote="Van":19kdcdvn]We too are finding that RANDOM works but SHUFFLE does not in our code.[/quote:19kdcdvn]

When I play events with the simple_event example, both random and shuffle play modes give the same sequence every time until I put an srand call in. Once I put the srand call in, they both give different sequences every time, as expected. Are you calling srand with a different seed each time? E.g. my srand call looks like:
[code:19kdcdvn]

include <time.h>

...

srand(time(0));

[/code:19kdcdvn]

[quote="ringmod":19kdcdvn]I’m also finding that if I have an event that references a sound definition with multiple waves, and playback is set to random, the first time the event is called by the game, it will always play ‘randomly’ from the beginning of the definition list. Ie : it plays the same sound the first time every time (not random).

Am I doing something wrong?[/quote:19kdcdvn]

I can’t reproduce this behaviour except by removing the call to srand. Are you calling srand in your game?

Hope this helps,
Ben

  • You must to post comments
0
0

Make sure the ‘Loop mode’ of sound def [b:1oo28itb]instance[/b:1oo28itb] (placed on the layer) is set to ‘Oneshot’. If it is set to looping, a new sound will never get the opportunity to spawn.

I’d also suggest the sound definition Playmode to ‘RandomNoRepeat’, this will give you a random song selection, but will not play the same song twice in a row.

cheers,
Templar

  • You must to post comments
0
0

Thanks very much for your prompt reply.. As for your comments, I’ll ask the programmers who I’m working with, I’m but a lowly sound engineer. :)

  • You must to post comments
0
0

Thanks Templar, that did it.

Also stumbled onto another quirk others should know:

If your [b:2npwuxui]bank[/b:2npwuxui] is set to [i:2npwuxui]stream from disk[/i:2npwuxui] don’t set the [i:2npwuxui]number of streams[/i:2npwuxui] to low (like one). It appears that FMOD stumbles it if can’t latch onto another stream in the same bank (i.e. a Music bank or something). I reset it back to the default 32 and it works fine.

  • You must to post comments
0
0

[quote="ben":f3b1xqlc]When I play events with the simple_event example, both random and shuffle play modes give the same sequence every time until I put an srand call in.[/quote:f3b1xqlc]
I was actually forcing the srand number to different values to test, but got the same sequence each time. Changing it to use srand(time(0)) in the simple_event example has the same result though. If it works for you, I (or my PC) must be doing something daft then. I’ll email my fdp/example code through just in case.

  • You must to post comments
0
0

Or you could use shuffle, which randomises the music in the sound definition, but you won’t hear one repeated until they’ve all played.

  • You must to post comments
0
0

[quote="crouton":1nxcmkuu]Or you could use shuffle, which randomises the music in the sound definition, but you won’t hear one repeated until they’ve all played.[/quote:1nxcmkuu]

I was wondering about that. [i:1nxcmkuu]When[/i:1nxcmkuu] is the bank shuffed? Is it just one time when FMOD starts? Every time the utilizing [i:1nxcmkuu]event[/i:1nxcmkuu] is started? When?

  • You must to post comments
0
0

[quote="Van":16c2npnp][quote="crouton":16c2npnp]Or you could use shuffle, which randomises the music in the sound definition, but you won’t hear one repeated until they’ve all played.[/quote:16c2npnp]

I was wondering about that. [i:16c2npnp]When[/i:16c2npnp] is the bank shuffed? Is it just one time when FMOD starts? Every time the utilizing [i:16c2npnp]event[/i:16c2npnp] is started? When?[/quote:16c2npnp]

The sound definition is shuffled when all the entries have played once. For example, if you had a sound definition with three entries (A, B and C), the playback logic might look like this:

[list=1:16c2npnp]
[:16c2npnp]Shuffle, giving order = {B, A, C}[/:m:16c2npnp]
[:16c2npnp]Play B[/:m:16c2npnp]
[:16c2npnp]Play A[/:m:16c2npnp]
[:16c2npnp]Play C[/:m:16c2npnp]
[:16c2npnp]Shuffle, giving order = {A, C, B}[/:m:16c2npnp]
[:16c2npnp]Play A[/:m:16c2npnp]
[:16c2npnp]Play C[/:m:16c2npnp]
[:16c2npnp]Play B[/:m:16c2npnp]
[:16c2npnp]Shuffle, giving order = {C, A, B}[/:m:16c2npnp]
[:16c2npnp]Etc…[/:m:16c2npnp][/list:o:16c2npnp]

Note that the shuffling algorithm prevents the last entry from the previous shuffle being the first entry in the current shuffle (e.g. {B, A, C} followed by {C, B, A}). This ensures that entries will never be played twice in a row.

Hope this helps,
Ben

  • You must to post comments
0
0

Ben, is the shuffle unique per event instance, or is it shared across all instances of an event?

-jason

  • You must to post comments
Showing 17 results
Your Answer

Please first to submit.