On 08/18/2011 08:07 PM, abel.jerome@free.fr wrote:
Hi,
what about the game you've talked about ?)
I will working on the "3D-game" audio part the next two weeks. If I have time, I will write some notes about my recent tests.
a) you shouldn't dynamically create abstractions while dsp is running, as it slows down significantly.
I would have liked to hear it before... May be I missed a message.
most likely. not in this thread but the issue has been discussed several times.
How much is your "significantly" ? Do you have taken measures to see what happens whith 10 audio objects, 100 or 1000 ?
significantly means:
if dsp is on, and you dyamincally create 10 objects in one go (in zero logical time), then the dsp graph will be re-calculated 10 times.
if you turn dsp off, then dynamically create 10 objects as before, then no dsp graph will be evaluated until you turn dsp on again, summing up to exactly 1 time.
furthermore, it guarantees that the entire DSP graph is calculated and not only parts of it (because of buggy implementations)
b) do [; pd dsp 0; pd dsp 1( right after your creation to fix the dsp-graph
But audio clics may occur for all sounds, not just for the new one, right ?
no, this is wrong. (at least not, if you computer is fast enough to calculate the DSP-graph within the buffertime). however, you will have the same problem if you do any weird "cut" clicks.
Could we do whithout a [line~] object to turn on/off sounds smootly and avoid audio clics ?
If we handle all sounds with a [line~]: 1 - stop all sounds smoothly (10 msec) with a GLOBAL send message 2 - wait 10 msec 3 - dsp 0 4 - create the new audio abstractions 5 - dsp 1 6 - turn on all sounds smoothly (10 msec) with a GLOBAL send message
Does it sound good ?
no. or rather: depends on what you need; if you can live with a 20 ms inconsistency. for many applications though, this 20ms fadeout-fadein will be almost equally annoying as a click.
We have a 20 msec "hole" of sounds. I'm sure that it may be perceptible.
it _will_ be perceptible.
those clicks have been discussed a number of times on this list (please search the archives).
mgfasdr IOhannes