Professional Documents
Culture Documents
Let The Music Speak: An Analysis Report On Shuffle Algorithm of Music Players That Can Enhance Music Listening Experience
Let The Music Speak: An Analysis Report On Shuffle Algorithm of Music Players That Can Enhance Music Listening Experience
Akshay Syal
Btech Student
VIT Vellore
Bhopal, India
akshaysyal19@gmail.com
Abstract— The shuffling algorithm of most music players or puts all the elements into a hat; it continually determines the
music streaming services although work well and produce next element by randomly drawing an element from the hat
random list of songs but many users complain about the until no elements remain.
shuffling algorithm playing a few songs from the same artist
right after each other. Now there is nothing wrong about the The algorithm effectively puts all the elements into a hat;
current shuffling algorithms like the Fisher-Yates algorithm, it it continually determines the next element by randomly
shuffles well and produce random results but what the users drawing an element from the hat until no elements remain. The
really want is a playlist in which songs of same artist are algorithm produces an unbiased permutation: every
distributed across the whole playlist. The algorithm proposed in permutation is equally likely. The modern version of the
this paper produces an even less random playlist but the output algorithm is efficient: it takes time proportional to the number
playlist will feel “more random” to the users. of items being shuffled and shuffles them in place. Time
Complexity of this algorithm is O(n).
Keywords— Shuffling algorithm, Fisher-Yates Algorithm,
Gambler’s Fallacy -- To shuffle an array a of n elements (indices 0..n-1):
for i from n−1 downto 1 do
I. INTRODUCTION
One of the most common features implemented in a music j ← random integer such that 0 ≤ j ≤ i
player is shuffle. Many users of music player apps or music exchange a[j] and a[i]
streaming services complain about the shuffling algorithm
saying that the player plays a few songs from the same artist III. PROPOSED WORK
right after each other. Fisher-Yates shuffle(a well-known After considering users’ expectations and previous works
shuffling algorithm) is used to generate a perfectly random it was concluded that people don’t like perfect randomness.
shuffling of a playlist. However, perfectly random means that
the following two orders are equally likely to occur (different Shuffle is hard for music players because what people
colours represent different artists). understand as random and what random actually means are
two different things. The difficulty comes in matching user
expectations. Users will say their expectation is songs
randomly selected, but there are many things they don't want
from a random selection. There is nothing really wrong with
your outline for randomly shuffling a playlist, other than it
doesn't really meet users’ expectations of shuffle.
Many people don’t want to listen songs by the same artist • Users don't want to hear the same song multiple times
playing two or three times within a short time period. But if in a row.
they just heard a song from a particular artist, that doesn’t • Users don't want to the same artist/album played
mean that the next song will be more likely from a different consecutively or too close together.
artist in a perfectly random order. Hence people don’t like
perfect randomness. • Users want to hear 1-2 songs from every artist/genre in
their collection before repeats occur.
• Random sequences that match established patterns are
II. EXISTING WORK viewed as not random and disliked. This would be
A. Fisher-Yates shuffle things like playing track 2 from albums A, B, C then
playing track 3 from those albums, or playing track 1
The Fisher–Yates shuffle is an algorithm for generating from A, track 2 from B, track 3 from C. This would
a random permutation of a finite sequence—in plain terms, also be if songs followed a rock, country, rap, pop
the algorithm shuffles the sequence. The algorithm effectively cycle or songs played in alphabetical order.
REFERENCES