## 3 Experiments and Discussion
We decided to compare the different key detection approaches in terms of various sample selection options (Beginning, End, Beginning_End, Whole), regardless of the type of the sample's pitch-class representation. The outcome of this comparison is shown in Figure 14, which indicates that the most accurate way of determining the key was achieved when the analysis was performed on the whole piece. The exception to this was the approach using Temperley key-profiles, in which case the best results were observed for the analysis of the concatenation of fragments located at the beginning and the end of a given composition. There are scenarios when one may wish to evaluate the key in a real-time manner. In such cases, it is important to have an effective way of determining the key based on the shortest possible fragment of music. Figure 14 clearly shows that the key detection approach based on the signature of fifths gave the best results when the analysis was performed on the initial fragments of music. In order to confirm the high efficacy of the method utilizing the signature of fifths while dealing with short fragments of music, additional experiments were performed. Figure 15 illustrates the overall key-detection efficacies corresponding to the shortest initial fragments of music for which the key was indicated in all considered approaches. Algorithms using key-profiles indicate the key after analyzing any non-empty sample fragment (with at least one occurrence of any tone). In the case of the method utilizing the  
Figure 14: The key-finding efficacies obtained for various sample selection options, regardless of the type of the analyzed sample’s pitch-class representation (results for all the considered music pieces). Figure 15: The overall key-finding efficacies obtained for all the considered music pieces, corresponding to the shortest initial fragments of music for which the key was indicated in all the examined approaches, where \(R_{M}\)—the multiplicities of occurrences of individual pitch-classes, \(R_{D}\)—the aggregate durations of individual pitch-classes. signature of fifths, the decision can be made only after determining the main directed axis. This requires at least two tones, but in most cases a larger number is needed to determine the key. Figure 15 indicates that the method employing the signature of fifths leads to very good results, especially when the analyzed samples are represented using the aggregate durations of the pitch-classes. In this particular case, the results were the best (Figure 15). The results yield some overall conclusions regarding the specifics of particular key-finding approaches. We can confidently state the method based on the signature of fifths does not make hasty decisions; additionally, once the key is determined it is generally not prone to further changing. This is because of the way in which the main directed axis of the signature of fifths is determined. In contrast, methods based strictly on the key-profiles are more inclined towards changing their decisions. In order to make this clearer, let us inspect two preludes by [PERSON]. First, we will consider the beginning of Prelude No. 4, Op. 28, written in e-minor. The corresponding musical notation and the results of the key detection process obtained using different approaches (SF, K-K, T, A-S) are presented in Figure 16.  
As we can see, the key-finding method using the signature of fifths (SF) indicated the correct key (e-minor) after analysis of six notes, as in the case of the strictly correlational approach implementing Albrecht-Shanahan key-profiles. Due to the dominance of the note B in the initial fragment, the use of the strictly correlational method based on the Krumhansl-Kessler and Temperley profiles (K-K, T) led to the detection of the b-minor key. Detecting the key associated with a given fragment of music by relying only on the correlations of its pitch-class representation with the key-profiles is prone to less accurate decisions than detection using the signature of fifths.