コード例 #1
0
        public void TestReset()
        {
            var pattern      = BuildBinaryPattern();
            var matchResults = new MatchResultCollector();
            var matcher      = PatternMatcher.Create(pattern, new PatternMatcher.Settings {
                MaxMatchingTime = 0.25f
            }, matchResults);
            var sn = new SimpleSoundId("SN", "default", "*");
            var bs = new SimpleSoundId("BS", "default", "*");

            short i = 1;

            matcher.Tick(0f);
            var beat = new TimedBeatId(0, new BeatId(i++));

            matcher.AddBeat(bs, beat, Velocity.Medium);
            Assert.Single(matchResults.Matches);

            matcher.Tick(100f);

            matcher.Reset();
            matchResults.Matches.Clear();
            matchResults.Missed.Clear();
            matcher.Tick(0f);
            matcher.AddBeat(bs, beat, Velocity.Medium);
            Assert.Single(matchResults.Matches);
        }
コード例 #2
0
 public PlayAnalysisSession(Settings settings, Pattern pattern)
 {
     this.settings = settings;
     this.pattern  = pattern;
     playedBeats   = new PlayedBeatIds();
     this.matcher  = PatternMatcher.Create(pattern, new PatternMatcher.Settings(), this);
     timeUnitInMs  = pattern.Info.SuggestedBpm / 60000f;
 }