<commit_before>var EventEmitter = require('events').EventEmitter;
var util = require('util');

StepSequence = function(resolutionInSixteenth)
{
  EventEmitter.call(this);
  this.content_ = [];
  this.modulo_ = 6 * resolutionInSixteenth;
}

util.inherits(StepSequence, EventEmitter);

StepSequence.prototype.tick = function(tickCount)
{
  if (this.content_.length > 0 && tickCount % this.modulo_ == 0)
  {
    this.emit("tick", this.content_[0]);
    this.content_ = this.content_.rotate(1);
  }
}

StepSequence.prototype.setResolution = function(resolutionInSixteenth)
{
  this.modulo_ = 6 * resolutionInSixteenth;
}

StepSequence.prototype.setContent = function(content)
{
  this.content_ = content;
}

StepSequence.prototype.getContent = function()
{
  return this.content_;
}

StepSequence.prototype.connect = function(target)
{
  if (target instanceof Function)
  {
    this.on("tick", target);
  }
  else
  {
    this.on("tick", function()
      {
        target.tick();<commit_msg>Got back to index based for playback<commit_after>var EventEmitter = require('events').EventEmitter;
var util = require('util');

StepSequence = function(resolutionInSixteenth)
{
  EventEmitter.call(this);
  this.content_ = [];
  this.modulo_ = 6 * resolutionInSixteenth;
  this.index_ = 0;
}

util.inherits(StepSequence, EventEmitter);

StepSequence.prototype.tick = function(tickCount)
{
  if (this.content_.length > 0 && tickCount % this.modulo_ == 0)
  {
    this.emit("tick", this.content_[this.index_]);
    this.index_ = (this.index_ + 1) % this.content_.length;
  }
}

StepSequence.prototype.setResolution = function(resolutionInSixteenth)
{
  this.modulo_ = 6 * resolutionInSixteenth;
}

StepSequence.prototype.setContent = function(content)
{
  this.content_ = content;
  if (this.content_.length > 0)
  {
    this.index_ = (this.index_ % this.content_.length);
  }
}

StepSequence.prototype.getContent = function()
{
  return this.content_;
}

StepSequence.prototype.connect = function(target)
{
  if (target instanceof Function)
  {
    this.on("tick", target);
  }
  else
  {
    this.on("tick", function()
      {
        target.tick();
{'fraction_non_alphanumeric': 0.1380439868975199, 'fraction_numerical': 0.006083294337856809, 'mean_word_length': 4.214634146341464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4180257', 'n_tokens_mistral': 718, 'n_tokens_neox': 700, 'n_words': 119}