1
\$\begingroup\$

I would like to dynamically "build" a song in my game by adding/removing instrument layers. This is normally possible exporting each instrument layer as a separate track, but this method is not so efficient for memory (it's like having multiple songs). I've started to use FMOD recently, so I would like to know if there is a method to save a song with multiple instrument tracks, for example, in an internal format, so that I can manipulate which instrument is going to play by code.

EDIT: An example from my game: I have a character that can transform to different forms. Imagine that the player has an aggressive melee form: I want that the main theme changes accordingly with the current player form. In my example, when the player is in the melee form, I want to add an electric guitar. If I change to a "bird" form, it would be nice to have a marimba instead of the guitar. Note that the rest of the main theme remain exactly the same. I know that I can export different songs, each one tailored for each player form, but I was wondering if it is possible to do something "better". When you save a song as a project file, you have more information than the actual music. Take FMOD Designer, for example: FMOD Designer screenshot

Here we have all the information about layers, instruments etc. so that is possible to mute an instrument, for example. What I want to achieve is to make one song, containing all the instruments(guitar,marimba in the example), so that I can mute/un-mute them by code. Is there a way to have such a format loaded by FMOD c++ API?

\$\endgroup\$
  • \$\begingroup\$ What is your idea of internal format? What would be the ideal scenario? With every feature you add to your game, you use memory. With an enhanced feature, like audio that changes as different triggers happen in your game, additionally memory is required. Have you tried to incorporate this. Do you currently an example of this in your game? \$\endgroup\$ – Shroeder Oct 27 '14 at 16:04
  • \$\begingroup\$ Question updated. \$\endgroup\$ – Andrea Tucci Oct 28 '14 at 9:40
1
\$\begingroup\$

Here is a video of how you can achieve multiple tracks using FMOD : https://www.youtube.com/watch?v=GZJrCF6DwF0, There is a long series of tutorials that should guide you further than that even. Hopefully you will find this useful.

\$\endgroup\$
  • \$\begingroup\$ That's great, thank you. However, how can I trigger an event from the code? In the video example, how can I trigger the "enter the door" event from c++? In the youtube video, when an event is triggered (or you modify certain properties, like the "position" bar), the layers change: for example the engine sound becomes louder. This is exactly what I need, because the track is the same, but you have more "configurations" encoded. \$\endgroup\$ – Andrea Tucci Nov 3 '14 at 15:30
  • 1
    \$\begingroup\$ Have you tried looking back a couple videos? This is a string of tutorials that should show you from start to finish how to implement dynamic sound tracks. If not please post something a bit more specific on what you are trying or have tried. That way you might get a few people to chime in on a solution or two. \$\endgroup\$ – Shroeder Nov 3 '14 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.