I did this as a demo for a project that I wrote last year implementing OpenAL in the Source (http://goo.gl/X3Dq8) engine. I wish that I knew there was interest in the way that it was done, because I would have posted the code.
Basically, I developed a system that had a set of tags called "conditions" that could be met. Each condition had an expression that would be used to evaluate to a boolean regarding if it was an active or inactive condition.
I set up a basic meta file which described the songs that the system should know about, and each audio sample had to be explained separately. It basically was a list of samples, what conditions they occur during, and what type of transition was needed for it to enter and exit the piece (hard or fade were the only options at the time).
So, for example - I used this track for all of the demoes in the system: http://goo.gl/WqJFK
So, in my test case I had the entire track playing without the drums. I defined a condition for 'combat' as well as 'sneaking'. Sneaking was 'combat' when there was no immediate danger. When enemies were nearby, it would hard transition the drums into the track at the proper beat timing. It seemed like it was a pretty good way to do it, as long as long as the conditions were done effectively (mine were pretty basic).
Just thought I'd maybe provide some ideas regarding how this might work in practice. :)
I did this as a demo for a project that I wrote last year implementing OpenAL in the Source (http://goo.gl/X3Dq8) engine. I wish that I knew there was interest in the way that it was done, because I would have posted the code.
Basically, I developed a system that had a set of tags called "conditions" that could be met. Each condition had an expression that would be used to evaluate to a boolean regarding if it was an active or inactive condition.
I set up a basic meta file which described the songs that the system should know about, and each audio sample had to be explained separately. It basically was a list of samples, what conditions they occur during, and what type of transition was needed for it to enter and exit the piece (hard or fade were the only options at the time).
So, for example - I used this track for all of the demoes in the system: http://goo.gl/WqJFK
So, in my test case I had the entire track playing without the drums. I defined a condition for 'combat' as well as 'sneaking'. Sneaking was 'combat' when there was no immediate danger. When enemies were nearby, it would hard transition the drums into the track at the proper beat timing. It seemed like it was a pretty good way to do it, as long as long as the conditions were done effectively (mine were pretty basic).
Just thought I'd maybe provide some ideas regarding how this might work in practice. :)