by Cayenne » 08 Dec 2015, 01:47
by hondagx35 » 15 Dec 2015, 23:18
In the second (more interesting) mode, ashuffle will wait until the last song in the queue has finished playing, at which point it will add another song to the queue. In this creates a 'stream of music' where songs will be continuously played, at random, to infinity. Additionally, since ashuffle only adds one song at a time, and only adds that song once the last song in the playlist has finished playing, you still retain control over your queue. This way, you can add some song you want to hear to the queue, and the random songs will simply continue afterwards.
Additionally, ashuffle uses mpd's idle functionality so it won't drain cpu polling to check if the current song has advanced.
To use the second mode, run ashuffle without the --only argument.
Currently ashuffle is using a fairly unique algorithm for shuffling songs. Most applications fall into two camps: true random shuffle, and 'random list' shuffle. With true random shuffle, no restrictions are placed on what songs can be selected for play. It's possible that a single song could be played two or even three times in a row because songs are just being draw out of a hat. With 'random list' shuffle, songs to be shuffled are organized into a list of songs behind the scenes. This list is then scrambled, and then played like a normal playlist. Using this method songs won't be played twice in a row, but the once the playlist has been played it will either loop (playing the same random set again), or be re-scrambled and played again, so it can still get repetitive. Also, since there's no chance that a song can be played again, it won't feel very random, especially when listening for a long time. I often start noticing song order once the random-list wraps around.
ashuffle's approach is an attempt at a happy medium between these two approaches. Essentially, it keeps two lists of songs, a 'pool' of the songs it's shuffling, and a 'window' which is a short, ordered, playlist of songs. When the program starts, ashuffle builds the window randomly by taking songs out of the pool, and adding them to the window. When a new random song is added to the MPD queue, the 'top' song of the window, is taken off, added to the queue, and then put back into the pool. Then another song is added to the window so that the next request can be fulfilled.
by Cayenne » 21 Dec 2015, 15:49
by hondagx35 » 21 Dec 2015, 17:16
But mainly my question is this: Where does the random-ness come from?
by blibble » 24 Oct 2016, 22:13
by hondagx35 » 25 Oct 2016, 17:21
by blibble » 25 Oct 2016, 17:25
by KHatfull » 26 Oct 2016, 05:16
by vulpespersona » 12 Nov 2016, 23:42