0
0

Perhaps the term "loop" is misleading for the purposes of this question.

I have a bunch of wavetables inside a sound definition that I want to behave like a randomized loop. So instead of the event just picking one wavetable each time the event is called, and looping that one wave file indefinitely, I would like at the end of the first loop for fmod to pick a new wavetable from the definition, and to repeat this process until the event is stopped.

The closest I can get to this is to use the "Spawn Time" pram in the sound definition. But because all the wavetables are different lengths, sometimes there will be small gaps and overlapping of wavetables. And basically what I want to ask of FMOD is "once you’ve finished playing this wavetable, can you please immediately play the next one until the event is untriggered."

Is there an easy way to get this effect?

Thanks,
North.

  • You must to post comments
0
0

[quote="Northerly":2rsikh2k]Perhaps the term "loop" is misleading for the purposes of this question.

I have a bunch of wavetables inside a sound definition that I want to behave like a randomized loop. So instead of the event just picking one wavetable each time the event is called, and looping that one wave file indefinitely, I would like at the end of the first loop for fmod to pick a new wavetable from the definition, and to repeat this process until the event is stopped.

The closest I can get to this is to use the "Spawn Time" pram in the sound definition. But because all the wavetables are different lengths, sometimes there will be small gaps and overlapping of wavetables. And basically what I want to ask of FMOD is "once you’ve finished playing this wavetable, can you please immediately play the next one until the event is untriggered."

Is there an easy way to get this effect?

Thanks,
North.[/quote:2rsikh2k]

You are really close, with the sound def containing multiple files and using spawning. Just make sure to:

1- set the min and max spawn time to 1 ms
2- set the max spawned sounds to 1
3- set the loop mode of the sound instance (properties) to one-shot
4- set the start mode of the sound instance (properties) to ‘wait for previous’

This should give you ‘random’ loops.

cheers,
Templar

  • You must to post comments
0
0

Ahh this works perfectly. Thanks very much!

  • You must to post comments
0
0

Is there a non-negligible CPU hit for trying to spawn a sound every millisecond?

  • You must to post comments
0
0

[quote="AnimusSonitus":3ndclilu]Is there a non-negligible CPU hit for trying to spawn a sound every millisecond?[/quote:3ndclilu]

The respawn isn’t checked every millisecond. FMOD will check the ‘Wait for previous’ condition and potential respawn once per update() – so it is not expensive.

cheers,
Templar

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.