I agree, being able to have the frequency that a song is played back depend on the song rating would be a great feature.
Perhaps a Smart Playlist feature could be added that uses the Song Rating and some new configuration settings to select a portion of the music for a Now Playing playlist. The Smart Playlist could be made from any selected folder, artist, album, etc. from the context menu. A percentage of the total selected songs would be selected into the Now Playing list using the song ratings to weight the frequency of selection.
The Smart Playlist configuration settings could include the following:
- Percentage of selected music to randomize into the Smart Playlist: 20% (a larger percentage will reduce the effect of the weighting)
- Assumed rating for unrated tracks: 6
- Weight factor: 80 (1 to 99)
Then for each rating, a frequency percentage is calculated as follows:
rating_10_percent = 100;
rating_9_percent = rating_10_percent x weight_factor%
rating_8_percent = rating_9_percent x weight_factor%
rating_7_percent = rating_8_percent x weight_factor%
rating_6_percent = rating_7_percent x weight_factor%
rating_5_percent = rating_6_percent x weight_factor%
rating_4_percent = rating_5_percent x weight_factor%
rating_3_percent = rating_4_percent x weight_factor%
rating_2_percent = rating_3_percent x weight_factor%
rating_1_percent = rating_2_percent x weight_factor%
So if a weight factor of 80% is used, the percentage that tracks of rated 10 through 1 would have a percent frequency of 100%, 80%, 64%, 51.2%, 41%, 32.8%, 26.2%, 21%, 16.8% and %13.4.
A simple algorithm could be used to select the tracks into a Now Playing list using these configuration settings. Tracks could be selected at random until the list contains the desired number of tracks. As the tracks are randomly selected some of them randomly skipped based on the percent frequency of the track. So with the above settings, if a track of rating 6 is randomly selected, it will have a 41% chance of being included. If the randomly selected track has a rating of 10, then it will have a 100% chance of being included.