public void BuildHelpers(Track[] tracks, int barIndex)
{
for (int i = 0; i < tracks.Length; i++)
{
var t = tracks[i];
FastList<FastDictionary<int, BarHelpers>> h;
if (!Helpers.ContainsKey(t.Index))
{
h = new FastList<FastDictionary<int, BarHelpers>>();
for (int s = 0; s < t.Staves.Count; s++)
{
h.Add(new FastDictionary<int, BarHelpers>());
}
Helpers[t.Index] = h;
}
else
{
h = Helpers[t.Index];
}
for (int s = 0; s < t.Staves.Count; s++)
{
if (!h[s].ContainsKey(barIndex))
{
h[s][barIndex] = new BarHelpers(t.Staves[s].Bars[barIndex]);
}
}
}
}