public void UpdateFrequency(List <int> notes) { KeyboardLetterList list = keyboardData.letterList; int notesAvailable = 0; int notesInRange = 0; lowFreq = 0; highFreq = 0; foreach (string key in list.Keys) { list[key].frequency = 0; } foreach (int note in notes) { notesAvailable++; string perfKey = FFXIVKeybindDat.NoteByteToPerformanceKey((byte)note); if (list.ContainsKey(perfKey)) { notesInRange++; list[perfKey].frequency++; } else { if (note <= 0) { lowFreq++; } if (note >= 38) { highFreq++; } } } this.Text = string.Empty; if (notesAvailable == 0) { this.Text = "No notes playing on this track."; } else if (notesInRange == 0) { this.Text = "All notes out of range."; } this.Refresh(); }