added functions to control the timeharp from matlab