def get_segment_generator(segmentation):
    """Time-driven segment generator"""
    t = yield
    for segment in segmentation:
        T = segment.end
        while True:
            if T > t:
                t = yield
                continue
            t = yield T
            break
