0
0

We’re trying to use the music system to have a piece of music playing which syncs up with "musicians" IN THE ENVIRONMENT, just hanging out in the game world. We have one background loop playing all the time, but want to have up to four additional layers of music playing, concurrently and in sync. We want to control volume and panning with parameters, to simulate distance and position relative to the player.

We thought the best way to do this would be to use concurrent cues, and it auditions fine in the FMOD Music Player, but then in game, they play sequentially!

So is the idea that only one flourish can be played over the background track in game? (i.e. the Music Player’s behavior is different from the actual runtime API) Or are we just calling this wrong?

We’re simply retrieving the cue id from the music system, then grabbing the prompt via the prepareCue function. We then use the prompt and call begin() all the while double checking the error codes.

Any other suggestions on a good way of putting together this sort of music system? We’re considering going back to events, but not sure what the best way to keep the various parts in sync would be…

  • You must to post comments
0
0

[quote="nedga055":r3fydyeq]We’re trying to use the music system to have a piece of music playing which syncs up with "musicians" IN THE ENVIRONMENT, just hanging out in the game world. We have one background loop playing all the time, but want to have up to four additional layers of music playing, concurrently and in sync. We want to control volume and panning with parameters, to simulate distance and position relative to the player.[/quote:r3fydyeq]
Currently it isn’t possible to control the volume/panning of individual themes via parameters; you can only control the music system as a whole. We do have a proposed feature in our tracker that would let you route themes to different event categories so you could control them individually, but this has not yet been scheduled. How soon would you need this capability?

[quote="nedga055":r3fydyeq]So is the idea that only one flourish can be played over the background track in game? (i.e. the Music Player’s behavior is different from the actual runtime API) Or are we just calling this wrong?

We’re simply retrieving the cue id from the music system, then grabbing the prompt via the prepareCue function. We then use the prompt and call begin() all the while double checking the error codes.[/quote:r3fydyeq]
You should be able to play more than one flourish over the background track. The fact that it works in Music Player but not in your game suggests that the problem may be related to the way you are triggering the cues. What you describe sounds correct, but could you try making a small test program that demonstrates the problem and send it to us at support@fmod.org?

  • You must to post comments
0
0

I guess ultimately the music system isn’t going to give us exactly what we’re looking for since we need positional sound. Due to some time constraints we may not be able to provide a test program, but if we get a chance, we’ll send it to you right away.

Presently, we’re working on a prototype that needs to be completed by next week and would need a more robust, permanent solution for the final product, but we’re not at that stage yet. So your proposed feature could come in handy at some point, but we’re not 100% sure of our timeline.

For the time being, we could try to use the event system. We did have our music cues working before as events through the event system, set up using the 3d mode. This way the sounds would fade in and out as our listener got closer or further away. The only problem was keeping them in sync with each other and with the background music. We tried playing four looping sound events with single wav in each and things stayed fairly in sync with the bg music. Once we added variations to the wav’s in the event(all the same length) things got further out of sync. Is there any chance taking this approach could give us the results we’re looking for? i.e. Can we in any way guarantee synchronization of sound events to a music track so we can take advantage of the 3d positional functionality of the event system?

Thanks for any help.

  • You must to post comments
0
0

[quote="nedga055":2pkztrks]Presently, we’re working on a prototype that needs to be completed by next week and would need a more robust, permanent solution for the final product, but we’re not at that stage yet. So your proposed feature could come in handy at some point, but we’re not 100% sure of our timeline.[/quote:2pkztrks]
We also have a proposed feature in our tracker that would let you set 3D positions on themes, but once again this hasn’t been scheduled.

[quote="nedga055":2pkztrks]Can we in any way guarantee synchronization of sound events to a music track so we can take advantage of the 3d positional functionality of the event system?[/quote:2pkztrks]
This is actually possible in a limited way with the event system:
[list=1:2pkztrks]
[:2pkztrks] Set up each loop (including the background loop) as a simple event with a single sound instance set to Oneshot and "Wait for previous"[/:m:2pkztrks]
[:2pkztrks] Set your sound definitions to have a spawn time of [1, 1] and Maximum spawned sounds of 2[/:m:2pkztrks]
[:2pkztrks] Make sure all your loops and variations are exactly the same length[/:m:2pkztrks]
[:2pkztrks] Set your wave bank to "Load into memory"[/:m:2pkztrks]
[:2pkztrks] In your game, start all the music layer events at the same time, and keep them playing all the time[/:m:2pkztrks]
[:2pkztrks] Use Event::setVolume and Event::set3DAttributes to control individual layers[/:m:2pkztrks][/list:o:2pkztrks]
Steps 1 and 2 will cause the event system to schedule playback so that the looping of each layer is done in a sample-accurate way. Since you start all the layers at the same time, and keep them playing all the time, they stay synchronised.

You may need to wrap all the Event::start calls for step 5 in a pair of System::lockDSP/unlockDSP calls to ensure all the events start at the same time.

An example project and main.cpp can be found at [url:2pkztrks]http://www.fmod.org/files/music_sync.zip[/url:2pkztrks].

  • You must to post comments
0
0

Great. This seems to provide us with the exact functionality we were looking for.

Appreciate the help! Thanks!

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.