private void NextNote()
{
if (LoopCount == -1)
{
var note = fsc.Notes[CurrentPosition++];
if (CurrentPosition >= fsc.Notes.Count) CurrentPosition = 0;
if (note.Filename != "NONE")
{
bool play;
if (note.Rand) play = (new Random().Next(16) < note.Prob);
else play = true;
float volume = (note.Volume / 1024.0f) * (fsc.MasterVolume / 1024.0f) * Volume;
var sound = LoadSound(note.Filename);
var instance = sound.CreateInstance();
instance.Volume = volume;
instance.Pan = (note.LRPan / 512.0f) - 1;
instance.Play();
SoundEffects.Add(instance);
}
LoopCount = (short)(note.Loop - 1);
}
else LoopCount--;
}