This changes the assumption that an SMF object only refers to a single track when being written. ::end_track() is used within begin::write()/end_write() pairs to mark the start of a new SMF track.