private IEnumerable<Pitch> GetPitchesUnderConsideration(PitchResult pitchResult) { return ChromesthesiaConfig.LightMaximumSamplesToUse <= 0 ? pitchResult.Pitches : pitchResult.Pitches .OrderByDescending(pitch => pitch.amplitude) .Take(ChromesthesiaConfig.LightMaximumSamplesToUse); }
public Light BuildLightFrom(PitchResult pitchResult) { builder.Reset(); if (pitchResult.TotalAmplitude <= 0.01f) //TODO Add a configurable threshold { return builder.Build(); } foreach (var pitch in GetPitchesUnderConsideration(pitchResult)) { builder.AddPitch(pitch, pitchResult.TotalAmplitude); } return builder.Build(); }
public PitchResultSummary(PitchResult leftResult, PitchResult rightResult) { this.leftResult = leftResult; this.rightResult = rightResult; time = DateTime.Now.TimeOfDay; }