コード例 #1
0
 private IEnumerable<Pitch> GetPitchesUnderConsideration(PitchResult pitchResult)
 {
     return ChromesthesiaConfig.LightMaximumSamplesToUse <= 0
     ? pitchResult.Pitches
     : pitchResult.Pitches
     .OrderByDescending(pitch => pitch.amplitude)
     .Take(ChromesthesiaConfig.LightMaximumSamplesToUse);
 }
コード例 #2
0
        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();
        }
コード例 #3
0
 public PitchResultSummary(PitchResult leftResult, PitchResult rightResult)
 {
     this.leftResult = leftResult;
       this.rightResult = rightResult;
       time = DateTime.Now.TimeOfDay;
 }