public void AddTempo(int tick, int tempo)
{
// bpm -> microsecond per quarter note
var tempoInUsq = (60000000 / tempo);
AddEvent(_midiFile.InfoTrack, tick,
BuildMetaMessage(0x51,
new[] { (byte)((tempoInUsq >> 16) & 0xFF), (byte)((tempoInUsq >> 8) & 0xFF), (byte)(tempoInUsq & 0xFF) }));
}