public void StartAudio(OIMSPhraseGroup whichPhraseGroup = default(OIMSPhraseGroup), float when = 0.0f, float currentVolume = 1.0f) { parentPhraseGroup = whichPhraseGroup; currentLoopNumber = 0; skipToNextGroupFlag = false; //if the layers are synchronized then they have a single start and end point based on the longest single loop //if NOT - then the layers are independent with multiple loop lengths, with overlaps dependent on their pickup notes, and reverb tails float longestStartOffset = 0.0f; //first we need to figure out the longest pickup time foreach (OIMSLayer musicLayer in musicLayers) { if (musicLayer.pickUpTime > longestStartOffset) { longestStartOffset = musicLayer.pickUpTime; } } foreach (OIMSLayer musicLayer in musicLayers) { //float timeToStart = longestPickupTime + Time.time - musicLayer.pickUpTime; musicLayer.StartAudio(this, when, currentVolume); } }
private void ExaminePhrases(OIMSPhraseGroup musicPhraseGroup) { if (musicPhraseGroup.randomize) { for (int x = 0; x <= musicPhraseGroup.numberOfRepeats; x++) { //pick a random phrase //then loop the phrase if needed } } else { foreach (OIMSPhrase musicPhrase in musicPhraseGroup.musicPhrases) { //phrases can loop if (musicPhrase.loopHowManyTimes > 1) { for (int x = 1; x <= musicPhrase.loopHowManyTimes; x++) { ExamineLayers(musicPhrase); } } else { ExamineLayers(musicPhrase); } } } }
public void StartAndFadeInAudio(OIMSPhraseGroup whichPhraseGroup = default(OIMSPhraseGroup), float when = 0.0f) { parentPhraseGroup = whichPhraseGroup; currentLoopNumber = 0; foreach (OIMSLayer musicLayer in musicLayers) { //float timeToStart = longestPickupTime + Time.time - musicLayer.pickUpTime; musicLayer.StartAndFadeInAudio(this, when); } }