# A New Method for Detecting Onset and Offset for Singing in Real-Time and Offline Environments
## 4 Results and Discussion  
This section provides the results and the details of the procedure for evaluating the proposed algorithm. It should be mentioned that the accuracy of the real-time proposed algorithm is compared against a set of real-time and offline algorithms. The delay of the proposed algorithms in calculating each event depends on its parameters, as mentioned in Section 3. Delays of 230 and 46 ms are used for the Erkomaishvili and SVNote1 datasets, respectively. Since the other onset detection algorithms mentioned in Section 2.2 only estimate onsets but not offsets and transitions, only onsets need to be extracted to evaluate and compare the proposed algorithm with them. Therefore, two types of onset times were considered: (1) First, there are only those points in the pitch contour labeled as an onset. The green line illustrates these in Figure 8, and (2) the middle point between the start time of the transition and onset, illustrated by the pink lines in Figure 8, is considered as the new onset point. The reason for considering the second type is to align with the approach used for ground truth datasets' because this one does not consider that transitions occurs between notes. Therefore, they would probably select a point between the red and green lines in Figure 8 as the onset. Therefore, considering the middle point should result in just a minor deviation from the ground truths. Figure 8: An example illustrates the position of the onset point in the Erkomaishvili dataset (ground truth) compared to the onset, offset, and transition points indicated by the proposed algorithm. Panel (**a**) shows the pitch frequencies, and panel (**b**) depicts the slope contour according to panel (**a**). as shown in the rows for Pro Algorithm 1 in Tables 1 and 2. The bold numbers in these two tables highlight the performance of the best algorithm. Selecting the average of the onset and the start of the transition as the onset leads to an increase in the accuracy of the proposed algorithm by 3.4% on average for the Erkomaishvili dataset. However, the opposite is the case for the SVNote1 dataset, in which the accuracy of the onset identification decreased by 3.8%. The reason for these opposing results is that the annotator of the Erkomaishvili dataset considered onsets more closely to the middle, as depicted in Figure 8. However, the SVNote1 dataset's annotators mostly considered onsets after the proposed algorithm's onset point, as shown in Figure 4. Both approaches can be interpreted as correct, since the onset point is not universally agreed in a pitch contour, as mentioned above, but it is deemed to be valid over a range of points. To check the meaningfulness of the averages of the F-measure values of each onset detection algorithm, the \(p\)-values for ANOVA were calculated for all the F-measure values calculated for every single file. The ANOVA's \(p\)-values for both Tables 1 and 2 were less than 0.0001, which means a significant difference between the accuracy of all evaluated algorithms. As another result, the average and the standard deviation of the duration of the transitions are shown in Table 3. This table also provides the minimum (average minus standard deviation) and the maximum (average plus standard deviation) typical duration for the transitions. Therefore, the average transitions' duration in the datasets is almost the same. Overall, based on the results, the minimum and maximum duration of the transitions were approximately 16 and 98 ms. Therefore, since the proposed algorithm is based on the trajectory changes in a pitch contour and the transitions show these significant changes, the minimum delay required to find the onset, offset, and the transition is 16 ms and the maximum of 98 ms. However, most events should be found correctly, with the average transition duration being around 57 ms. This delay would be acceptable for most real-time music information retrieval applications. For example, Henkel and Widner's real-time score-following system [40] requires a delay of around 56 ms.