private void FlushBeatsBuffer() { while (playedBeatsBuffer.TryDequeue(out TimedEvent <Beat> beat)) { var id = playedBeats.New(beat); var timedBeat = new TimedBeatId(beat.Time, id); NewPlayedBeat?.Invoke(timedBeat, beat.Value.Sound); matcher.AddBeat(beat.Value.Sound, timedBeat, beat.Value.Velocity); } }