Measure of similarity between two distributions - with variable starting point (wrap-around) I would like to compute the (dis)similarity between two distributions. The first represents tones sung by an experimental subject during a recording. There are different numbers of tones, each with different durations. This histogram shows how much time was spent at each pitch (in Hz) by one subject:

My second distribution always represents the theoretical profile of a major key, as described in the empirical pitch perception literature:

The two distributions are comparable/equivalent if one merely takes the log of the 1st distribution (to transform frequency into equally-spaced pitch as in the 2nd); and if one considers "time spent at each pitch" (y axis in the 1st distribution) to be equivalent to "saliency" or "fit" (y axis in the 2nd).
From browsing past CV questions, I thought I'd try the Kolmogorov-Smirnov distance, the Bhattacharyya distance (second implementation here), and the Kullback–Leibler divergence. I believe all 3 measures can deal with unequal sample sizes, however the Matlab/R packages I found to implement those seem to require different inputs from what I was expecting to be asked, namely two vectors of possibly different length.
Additionally, I'd need this measure of similarity to "wrap around" or "slide", in the sense of considering any of the points in the first histogram (along the x axis) as the "starting point", by rotation, just as the note C is always the starting point in the C-major key profile given in figure 2. This is probably not critical, as I can loop this manually (i.e. compare against all 12 keys for the 2nd distribution).

Here is what I would do in your situation. Whether it works for you depends on the format and quantity of your data, but I do think that it will yield the answer you're looking for if the data allows this method. The method is a regular Pearson's chi-squared test. The reason this choice makes sense is that music is arranged in time (it can be subdivided into countable notes rather than chaotic, arbitrary intervals of time) and you are using a 12 tone scale.
1. You have sung frequencies and the time in seconds for each frequency. You've already said that you can convert frequencies to tones. Do so. I assume you ignore octave since the picture of your theoretic distribution only contains one octave.
2.  Convert your sung data from continuous time to a count of standardized notes. You say the experimental subject was singing. Even if the subject was not using a metronome, you can probably impose a loose metre and use your subject-matter expertise to transcribe the melody. Put another way, if you took a subject's melody, you could probably write it in musical notation. If you did that, you would see not continuous times, but notes of finite duration. Find the smallest meaningful subdivision (probably a 16th? Maybe a 32nd?) in your subjects' melodies and then subdivide all of their other notes into that unit and count them. From now on, I'll refer to this standardized subdivision simply as the "units." You'll count how many units for each tone was sung, and also sum the total units sung by the subject. The data format for the subject should now be 13 variables. The first 12 contain values that are the number of units of each tone sung by the subject, and the 13th variable is the total number of units they sang. The crucial point here is that you're standardizing the melodies into a unit, the chosen subdivision, then counting how many of those units were sung in each tone.
*You could keep the data in time and subdivide the seconds into counts, but notes are better. The reason is that music is inherently structured into note durations, and note durations don't need to be rounded up or down. Moreover, if you're publishing or presenting this, notes are probably more easily understood by your audience since most of them will be musically inclined. There is natural structure here. Use it if you can.
3. Now, you have a theoretical distribution of a major scale. You didn't say what the units were, but you need to convert it into a probability mass function. In other words, what proportion of notes do you expect to be the tonic? the 2nd? The major 3rd? You should be able to make this conversion relatively easily if you've already got literature on the subject and an example distribution.
4. You now have a recipe for getting your answer. You already have the observed counts in each tone and their total count from what your subject sang. To get their expected counts, take your theoretical distribution of the major scale and multiply each note probability by the total number of notes sung by the subject. E.g. if the subject sung a total of 100 notes and your theoretical distribution says that 40% of their sung notes should be a C and only 5% should be a C#, then their expected count of C should be $100\times0.4=40$ C notes and the expected count of C# should be $100\times0.05=5$.
5. Treat your data as a one-way table with 12 categories (the tones), and perform Pearson's Chi-Squared test. There are multiple other tests you could try, but this is the most well-known.
The benefits I see of using the above methods are (1) you're using the natural structure of music and musical scales, (2) visualizations (histograms or others) of expected versus observed counts will be far clearer than trying to compare a plot of times and frequencies, (3) those visualizations of expected versus observed counts make the extent and type of differences between your theoretical distribution and subject's distribution very clear in a way that other methods do not allow (you can clearly see how much they differ and by which tones they differ), and (4) you're using a well-known and simple statistical method to check the significance of the difference.
The pitfalls of using this methods are (1) your data format may make it difficult, (2) transcribing the melody may be difficult depending on the technology or skill that you possess for this purpose and how long the recording is, (3) Pearson's chi-squared test assumes independence of events, which almost certainly is not strictly fulfilled here (keep in mind the same subject is singing multiple notes--the units are not independent. Whether this matters depends on exactly what you're trying to explain here), and (4) if the singing is short, you may not have enough units to achieve reliable results.
