SOURCE-CODE CHECK
One event, at the beginning
The current MIDI writer takes the selected BPM, computes microseconds per quarter note as round(60,000,000 / BPM), and writes one FF 51 03 Set Tempo event at tick zero. Its event loop writes note-on and note-off messages; it does not insert another Set Tempo event. The exported file has a fixed tempo until another application edits it.