add a labelled interval annotation layer

        Args:
          temp_idx (float iterable): The temporal indices of invervals
          durations (float iterable): intervals durations
          labels (string iterable): interval labels
          values (int iterable): interval numeric values, if set to None, values are set to 0

        Kwargs:
          view (<DOM Element: view>): environment view used to display the spectrogram, if set to None, a new view is created

def add_interval_annotations(self, temp_idx, durations, labels, values=None, colourName='Purple', colour='#c832ff', name='', view=None, presentationName = None):
        """
        add a labelled interval annotation layer

        Args:
          temp_idx (float iterable): The temporal indices of invervals
          durations (float iterable): intervals durations
          labels (string iterable): interval labels
          values (int iterable): interval numeric values, if set to None, values are set to 0

        Kwargs:
          view (<DOM Element: view>): environment view used to display the spectrogram, if set to None, a new view is created

        """

        model = self.data.appendChild(self.doc.createElement('model'))
        imodel = self.nbdata
        for atname, atval in [('id', imodel + 1),
                              ('dataset', imodel),
                              ('name', name),
                              ('sampleRate', self.samplerate),
                              ('type', 'sparse'),
                              ('dimensions', '3'),
                              ('subtype', 'region'),
                              ('resolution', '1'),
                              ('notifyOnAdd', 'true'),
                              ('units', ''),
                              ('valueQuantization', '0')
                              ]:
            model.setAttribute(atname, str(atval))

        dataset = self.data.appendChild(SVDataset3D(self.doc, str(imodel), self.samplerate))
        if values is None:
            values = ([0] * len(temp_idx))
        dataset.set_data_from_iterable(map(int, np.array(temp_idx) * self.samplerate), values, map(int, np.array(durations) * self.samplerate), labels)
        

        # dataset = self.data.appendChild(self.doc.createElement('dataset'))
        # dataset.setAttribute('id', str(imodel))
        # dataset.setAttribute('dimensions', '3')
        self.nbdata+= 2
        
        valruler = self.__add_time_ruler()
        vallayer = self.__add_region_layer(imodel + 1, name)
        vallayer.setAttribute('colourName', colourName)
        vallayer.setAttribute('colour', colour)
        if presentationName:
            vallayer.setAttribute('presentationName', presentationName)        

        if view is None:
            view = self.__add_view()
        self.__add_layer_reference(view, valruler)
        self.__add_layer_reference(view, vallayer)

        # if values is None:
        #     values = ([0] * len(temp_idx))
        # for t, d, l, v in zip(temp_idx, durations, labels, values):
        #     point = dataset.appendChild(self.doc.createElement('point'))
        #     point.setAttribute('label', l)
        #     point.setAttribute('frame', str(int(t * self.samplerate)))
        #     point.setAttribute('duration', str(int(d * self.samplerate)))
        #     point.setAttribute('value', str(v))
        return view