public TuneInfo PickSoloLeaderNote(Bands bands, FrequencyChart chart, int harmonics = 1) { return(chart.OrderByDescending(k => k.Level) .Skip(harmonics - 1) .Select(k => bands.NoteByFreq(k.Frequency)) .First()); }
public string PickNoteWithVoting(Bands bands, FrequencyChart chart) { return(chart.OrderByDescending(k => k.Level) .Take(15) .Select(k => bands.NoteByFreq(k.Frequency)) .GroupBy(k => k.Note.NoteName) .Select(k => new { note = k.Key, count = k.Count() }) .OrderByDescending(k => k.count) .First().note); }
public string StringForBand(Bands bands, FrequencyChart freq, int noteCount = 1) { if (freq.Any()) { var nt = ""; for (int i = 0; i < noteCount; i++) { var maxFrequency = Math.Round(freq.OrderByDescending(k => k.Level).Skip(i).First().Frequency, 1); nt += bands.NoteByFreq(maxFrequency) + " (" + maxFrequency + ") "; } return(nt + "\n"); } else { return(" -(-) "); } }
private void LoadChartIn(FrequencyChart chart, int width, int height) { var pix = new int[width * height]; if (chart.Count != 0) { int bandWidth = (width / chart.Count) + 1; for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { var tx = x; var ty = height - y - 1; var inBand = (1 + chart [x / bandWidth].DBLevel / 120) > ((double)y / height); var res = (width * ty) + tx; pix [res] = inBand ? Color.Green : Color.Black; } } } _bmp = Bitmap.CreateBitmap(pix, width, height, Bitmap.Config.Argb8888); }
public void LoadChart(FrequencyChart chart) { _chart = chart; PostInvalidate(); }
public BlockInfo(double mainFrequency, FrequencyChart chart) : this(mainFrequency) { _chart = chart; }
public BlockInfo(double mainFrequency) { _mainFrequency = mainFrequency; _chart = null; }