addTempo method

dynamic addTempo({
  1. required int track,
  2. required num time,
  3. required int tempo,
})

Add notes to the MIDIFile object :param track: The track to which the tempo event is added. Note that in a format 1 file this parameter is ignored and the tempo is written to the tempo track :param time: The time (in beats) at which tempo event is placed :param tempo: The tempo, in Beats per Minute. Integer

Implementation

/// :param track: The track to which the tempo event  is added. Note that
///     in a format 1 file this parameter is ignored and the tempo is
///     written to the tempo track
/// :param time: The time (in beats) at which tempo event is placed
/// :param tempo: The tempo, in Beats per Minute. [Integer]

addTempo({required int track, required num time, required int tempo}) {
  if (this._header.numeric_format == 1) {
    track = 0;
  }

  this._tracks[track].addTempo(this._time_to_ticks(time), tempo,
      insertion_order: this._event_counter);
  this._event_counter += 1;
}