function for converting timed intervals into a text grid