0
0

Hi,

I’m trying to find the most efficient way of doing the following:

I have an event with one Binary Parameter and two sound layers. If the parameter is 0, then one sound plays. If the parameter is 1, then two sounds play. When two sounds play, I’d like to be able to delay the second sound by a certain amount of time.

Here’s what I’ve done so far to get this behavior: I’ve created an event with two layers and two parameters. The Binary Parameter, which is fed by the game, and a second parameter, Time, which is moved with a velocity. I’ve set up my second sound so it starts with the appropriate delay based on the Time Parameter. Then, in my Binary Parameter, I’ve added volume automation so the sound is muted (but actually playing w/a volume of -inf) if the Binary Parameter equals 0.

While this works, it doesn’t seem to be the most elegant (or efficient) solution as it always plays two sound layers and it uses Effect Automation.

Thanks!
Dave

• You must to post comments
0
0

[quote="dsteinwedel":f9sq7028]Hi,

I’m trying to find the most efficient way of doing the following:

I have an event with one Binary Parameter and two sound layers. If the parameter is 0, then one sound plays. If the parameter is 1, then two sounds play. When two sounds play, I’d like to be able to delay the second sound by a certain amount of time.
[/quote:f9sq7028]

When the binary parameter is 0 and one sound is played. Is it always the same sound? Or are you expecting some randomization (either sound one OR sound two)?

Should you only want one sound, you could get the behavior you want by:

1. Creating a volume effect envelope over layer 2 (to mute the second second when the binary parameter is > 0.5)

2. Applying an echo effect over layer 2. The echo would need no decay, or dry level. You could then create an envelope to control the amount of delay you want to apply to the second sound. You could use a 2nd parameter to control the amount of delay.

Note: this is a little hacky, and you will take a performance (memory) hit for the delay.

cheers,
Templar

• You must to post comments
0
0

I dont think using dsp effects would be an ‘efficient’ way around the problem.

Can you tell me why something like this wouldnt work unless i’ve misunderstood the problem?

[img:1c2u0y6s]http://www.fmod.org/files/delay.png[/img:1c2u0y6s]

If param = 0, it plays the first sound and the sustain point stops it from running into the 2nd set of sounds.

If param = 0.5 (ok you can make the range 0-2 and use 1.0 if you want, i just hacked this up )it triggers 2 sounds, one with a delay?

The param has a velocity of 0.1 but could be whatever you need. You said ‘but it ends up triggering both sounds at the same time’. I dont see how that would be possible with this setup.

• You must to post comments
0
0

Hey Brett,

Thanks for the response and bearing with me as I’m new to the Designer Tool.

I’ve tried a setup similar to your but am still not getting the behavior I’m looking for. For your setup to sound how I want it, the value of the binary parameter would need to control the start point of the playhead (in this case, if it’s True, the playhead starts running from .5 when the event is called). However when I give a parameter a velocity the playhead always starts running from 0. The idea is not to delay the entire event by X amount, it’s to offset the start of layer 2 from layer 1.

On the note of velocities–here’s an example I’m running at the moment.
[img:3a803jt7]http://i33.tinypic.com/fcqts1.jpg[/img:3a803jt7]
When I hit Play on this event, the playhead runs from left to right but I immediately hear Layer 2. I’m not sure why as the playhead doesn’t hit the sound definition until almost a second in.

-Dave

• You must to post comments
0
0

Ah, I see the confusion here. The problem is the GUI in designer. You’re hitting play and it keeps jumping back to 0.

This doesnt happen in the game.
If the programmer calls

getEvent(&event);
setParameter(0.5);
event->start();

It will start from 0.5, not 0.

The problem with fmod’s gui is that we changed it recently to always reset the cursor when you hit the play button, if the parameter has a velocity (it saves the user having to continually drag the cursor back to 0 each time).
If the parameter does not have a velocity, it will stay where you set it.

I think what we need is a shift key modifier maybe? Ie if you hold shift and hit play it doesnt reset the cursor? Then you can test your behaviour.

• You must to post comments
0
0

That would be fantastic!

Thanks,
Dave

• You must to post comments
0
0

Upon further review, it seems that my ‘hack’ isn’t actually getting me the intended behavior, as even with a forced timeline the second sound still starts playing as soon as the event is triggered.

The question still remains, how do I do what I want to do?

Thanks!
Dave

• You must to post comments
Showing 6 results