code: function (duration, settings) {
    // If there's no swing ratio, assume straight eighths
    var ratio = settings && settings.swingRatio ? settings.swingRatio : 1;
    return Math.round(ticksPerBeat * duration.value(ratio));
  }
docs: Given a note duration, return the time delta