Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Shuffle (folders) repeats before playing entire library (Read 2841 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Shuffle (folders) repeats before playing entire library

I have Foobar set to play using "shuffle (folders)" for the order. However, several times it has repeated a folder that it already played, before reaching the end of the library. I thought shuffle was supposed to play all the way through a library before repeating, as opposed to the random order of play?
If that is the way it is supposed to work, any ideas on what the problem could be? Is there something in the preferences that effects this?
Thanks for the help.

Re: Shuffle (folders) repeats before playing entire library

Reply #1
Are you manually stopping and restarting playback when in 'Shuffle (folders)' mode?

Re: Shuffle (folders) repeats before playing entire library

Reply #2
Yes. I close all programs and shutdown my laptop at the end of the day.

Re: Shuffle (folders) repeats before playing entire library

Reply #3
My suggestion would be throw all your folders into a playlist > select all > sort > randomize. Fb2k will remember what you last played on that playlist the next day and it will just keep running down your list, using regular playback order of course.

Re: Shuffle (folders) repeats before playing entire library

Reply #4
Interesting suggestion. I'll try it. I hope I can randomize by folder. This is classical music, and mixing up the tracks is not the best way to listen to a symphony.  ;)
Regarding shuffling: I see now that it creates a new sorted list each time it is restarted. That explains the repeat of a folder that played last week. Is there any way to keep it from creating a new list on each startup?

Re: Shuffle (folders) repeats before playing entire library

Reply #5
Is there any way to keep it from creating a new list on each startup?
No, not to the best of my knowledge. From the FAQ:

Shuffle modes keep an internal randomized list of tracks in your playlist and play tracks according to their order in that list, so you don't get repetitions until all tracks in your playlist have been played. Shuffle's randomized track lists for each playlist are re-created on foobar2000 restart or when starting/advancing playback with another shuffle mode.

If you are using Album List (DUI) you could add a new View (Preferences -> Media Library -> Album List):
Code: [Select]
$crc32($directory_path(%path%)) | %album artist% - %album% | [%discnumber% - ]%tracknumber% - %title%
Activate the new view in Album List and send All Music to a new playlist. Start playing from top (Playback order = Default).
This is neither random nor shuffle playback, but you have a specially sorted playlist that plays all tracks in one folder in sequential order and after that it jumps to the next, 'unknown' folder. foobar2000 should remember the position from day to day.
A more sparse version might do as well:
Code: [Select]
$crc32($directory_path(%path%)) | [%discnumber% - ]%tracknumber% - %title%
or even
Code: [Select]
$crc32($directory_path(%path%)) | [%discnumber% - ]%tracknumber%
When you have reached the end of the above 'frozen' playlist, you can create differently sorted playlists by adding one ore more chars to the crc32 function:
Code: [Select]
$crc32(A $directory_path(%path%)) ...
$crc32(X $directory_path(%path%)) ...
$crc32(wow $directory_path(%path%)) ...
$crc32(mother-in-law $directory_path(%path%)) ...
Enjoy.

Re: Shuffle (folders) repeats before playing entire library

Reply #6
Thanks much. I don't understand those commands but it worked when I created the new view. This should be an incentive to start trying to understand those commands.
One problem is that within a folder, it sometimes lists them out of track order. I think this happens when there are different album artists. Would using this have it ignore the album artist and just sort in track order: $crc32($directory_path(%path%)) | %album% | [%discnumber% - ]%tracknumber% - %title%

Re: Shuffle (folders) repeats before playing entire library

Reply #7
A couple of questions:

I suppose that putting your laptop in either sleep or hibernation state is totally out of the question?

How do you organize your collection? What are you having in an arbitrary folder?
How do you tag your classical music files?
Are you using tags consistently? (Proper tagging is imperative to utilize the full potential of foobar2000.)

I really hope that I can make the crc32 hack useable for you, but I need some answers.

Re: Shuffle (folders) repeats before playing entire library

Reply #8
Correct. it's my work laptop and i take it home every night. Even my home computer I reboot occasionally just to clean out everything and get a fresh boot.
My folders are organised as follows: My Music\Classical\Composer\album or cd name\track number and name. Where a particular work is on 2 CDs (for example a long symphony), I moved everything into one folder and numbered the tracks accordingly.
I tag them using MP3tag, and I try my best to do everything consistently. For a single composer it's easy. For compilations or collections it can be a little more difficult, but I try to get the individual composer on each track.
I did notice that when using the view that you provided, it sorted the tracks in album artist alphabetical order first, and then track order. If there was no tag for album artist, it sorted by artist. This is no problem when the artist is the same on all tracks -- it just sorts by track number. However when there are multiple artists, it scrambles the track order.

If possible, I would like to have it sort by folder first, and then by track number only.

Re: Shuffle (folders) repeats before playing entire library

Reply #9
Holy crap!
While I was composing my answer, I was thrown off of the board. Well, new message board, new rules.
I'll start all over tomorrow, but don't expect to much.

Re: Shuffle (folders) repeats before playing entire library

Reply #10
Check your message drafts?

Re: Shuffle (folders) repeats before playing entire library

Reply #11
Yes. As empty as my wallet.
I have enabled automatic saving of drafts.
Thank you for the interest.

Edit. Strange. Now I see the draft. I wonder where I looked before.

Re: Shuffle (folders) repeats before playing entire library

Reply #12
I did notice that when using the view that you provided, it sorted the tracks in album artist alphabetical order first, and then track order. If there was no tag for album artist, it sorted by artist. This is no problem when the artist is the same on all tracks -- it just sorts by track number. However when there are multiple artists, it scrambles the track order.
I'm not sure that I understand what you mean. Are you referring to artist and album artist in your playlist? In the new view in Album List there should be no visible signs of artists or album artists? (You have of course activated the new view in Album List?)
As a side note: If a compilation are having more than one artist, people often tag Album Artist with 'Various Artists' and then populate the Artist tag with the actual artist for the given track.

You organise your music with one album per folder (if I have understood you correctly). That's perfect for our purpose.
But how do you number your tracks for a given album or folder? I'm afraid that strict sequential numbering is a must.
If you are having two symphonies on one album in one folder, each symphony consisting of three movements, the track numbers should be from 1 to 6, not 1,2,3 and 1,2,3.
Caveat: I am not at all suggesting that you make any changes to your tagging system. I'm just trying to explain how the crc32 hack is working.
I have generated a playlist with +5000 albums using the crc32 view. It seems to be okay with no sorting problems.

Album List doesn't use the sort settings as defined in the Shell Integration in the Preferences. It sorts according to the nodes you define in its settings in Preferences.
In Album List you define a node with a vertical bar: |.
Code: [Select]
$crc32($directory_path(%path%)) | [%discnumber% - ]%tracknumber% - %title%
A one disc album might show up like this in Album List
Code: [Select]
342732 (4)
 |_01 - Track One
 |_02 - Track Two
 |_03 - Track Three
 |_04 - Track Four

A two disc album might show up like this in Album List
Code: [Select]
88534881 (6) 
 |_1-01 - Disc One Track One
 |_1-02 - Disc One Track Two
 |_1-03 - Disc One Track Three
 |_2-01 - Disc Two Track One
 |_2-02 - Disc Two Track Two
 |_2-03 - Disc Two Track Three

or

88534881 (6)
 |_1-01 - Disc One Track One
 |_1-02 - Disc One Track Two
 |_1-03 - Disc One Track Three
 |_2-04 - Disc Two Track One
 |_2-05 - Disc Two Track Two
 |_2-06 - Disc Two Track Three
Quote
If possible, I would like to have it sort by folder first, and then by track number only.
Yes. It is also what I am trying to accomplish. But I presume that it is okay to use possible disc numbers as well. For the benefit of Mahler's Third. Or Bruckner. Or maybe even Havergal Brian's Gothic Symphony ...

Re: Shuffle (folders) repeats before playing entire library

Reply #13
Thanks for staying with me on this. I'm a newbie, so I don't know what node, crc, or shell integration are. I'll go through the wiki to see if I can find definitions for all of these.
As for numbering, yes all tracks are sequential, starting with 01, 02, ...etc. I usually didn't do anything with the disc number, so it may not be accurate if i combined a 2-disc work into one folder. I'll have to go back and check.
I am using the new view. Here is an example of a disc  that came out in the wrong order. Symphony #5 is tracks 9-12, The Nutcracker is 1-8, but as you can see, Nutcracker 3 is first, then the symphony, then the rest of the Nutcracker tracks. Also in the view, only the album, track, title/track artist, and duration are showing. However when I copied it and pasted it below, you can see that a lot more is showing.

Leonard Bernstein - [Peter Tchaikovsky - Panorama (Disc 1) CD1 #08] Nutcracker Suite - 3. Danse des fleurs. Tempo di valse
Leonard Bernstein - [Peter Tchaikovsky - Panorama (Disc 1) CD1 #09] Symphony No. 5 - 1. Andante - Allegro con anima
Leonard Bernstein - [Peter Tchaikovsky - Panorama (Disc 1) CD1 #10] Symphony No. 5 - 2. Andante cantabile, con alcuna licenza - Moderato con anima - Andante mosso - Allegro non
Leonard Bernstein - [Peter Tchaikovsky - Panorama (Disc 1) CD1 #11] Symphony No. 5 - 3. Valse. Allegro moderato
Leonard Bernstein - [Peter Tchaikovsky - Panorama (Disc 1) CD1 #12] Symphony No. 5 - 4. Finale. Andante maesoso - Allegro vivace - Molto vivace - Moderato assai e molto maestoso
Mstislav Rostropovich - [Peter Tchaikovsky - Panorama (Disc 1) CD1 #01] Nutcracker Suite - 1. Overture minature. Allegro guisto
Mstislav Rostropovich - [Peter Tchaikovsky - Panorama (Disc 1) CD1 #02] Nutcracker Suite - 2a. Marche. Tempo di marcia viva
Mstislav Rostropovich - [Peter Tchaikovsky - Panorama (Disc 1) CD1 #03] Nutcracker Suite - 2b. Danse de la fée. Andante non troppo
Mstislav Rostropovich - [Peter Tchaikovsky - Panorama (Disc 1) CD1 #04] Nutcracker Suite - 2c. Danse russe (trépak). Tempo di trepak, molto vivace
Mstislav Rostropovich - [Peter Tchaikovsky - Panorama (Disc 1) CD1 #05] Nutcracker Suite - 2d. Danse arabe. Allegretto
Mstislav Rostropovich - [Peter Tchaikovsky - Panorama (Disc 1) CD1 #06] Nutcracker Suite - 2e. Danse chinoise. Allegro moderato
Mstislav Rostropovich - [Peter Tchaikovsky - Panorama (Disc 1) CD1 #07] Nutcracker Suite - 2f. Danse des mirlitons. Moderato assai


Re: Shuffle (folders) repeats before playing entire library

Reply #14
Just found a mistake in my tags. The artist for dance 3 was tagged as Bernstein, not Rostropovich. Fixed it.

Re: Shuffle (folders) repeats before playing entire library

Reply #15
Just found a mistake in my tags. The artist for dance 3 was tagged as Bernstein, not Rostropovich. Fixed it.
Big grin. I found the mistake as well and wrote some now deleted lines about it (offline).
I simply couldn't understand that Rostropovich handed over the baton to Bernstein when they reached 'Danse des fleurs'.

There is a sorting issue, obviously. But if you look closer at your list in reply #13 it is a perfectly sorted alphabetical list. Leonard first, then Mstislav.
Consider this: If each line in the list started with discnumber (if present) and tracknumber (always present), everything would be nice. How did you generate the list?

It would be of great help if you published a screenshot of the main window of your foobar2000.
How do you name your classical music files? With consequence, I'm sure, but please give an example.

In foobar2000 choose in the main menu File -> Preferences -> Shell Integration. What value is listed in Sort incoming files by:?

Quote from: im5049
Thanks for staying with me on this.
No problem.
If we can get rid of the sorting issue, we have come a big step forward, I'm sure.
Please do not waste time on educating yourself in crc32 or node. Not for now, at least.

Re: Shuffle (folders) repeats before playing entire library

Reply #16
Attached is a screenshot of a portion of the list that I created using your suggested command.
In shell integration it sorts incoming files by %path_sort%
Hope this helps.

Re: Shuffle (folders) repeats before playing entire library

Reply #17
Well, I thought the screenshot would be attached. However I get the following error message even though the file is only 152kb. "Foobar screenshot.jpg : The post data is missing. This error could be caused by trying to submit a file larger than allowed by the server"

Re: Shuffle (folders) repeats before playing entire library

Reply #18
Well, I thought the screenshot would be attached. However I get the following error message even though the file is only 152kb. "Foobar screenshot.jpg : The post data is missing. This error could be caused by trying to submit a file larger than allowed by the server"
The limit is far above 200 KB, namely 40 MB. Something else went wrong. Maybe your file was never uploaded to HA's server?
See the remarks below the typing area in the editor. I have used the selecting them function to include screendumps in this post.

The screendump to the left is of an almost pristine foobar2000. Note the crc32 numbers in Album List to the left and the correctly sorted tracks in albums 'sorted in arbitrary order' in the Playlist View.

I use this file name pattern:

F:\Music\Rhythmic\%album artist%\%album%\[%discnumber%]%tracknumber% - %title% e.g.
F:\Music\Rhythmic\Annie Ross\Gypsy\08 - Let Me Entertain You.mp3 (Typically letting foobar2000 do all the work including renaming files).

The online Title Formatting Reference has a lot of useful information, also on the use of square brackets as in [%discnumber%].

I've made a few changes to the Playlist View. See the second screenshot.

You forgot to answer this: How do you name your music files?

Re: Shuffle (folders) repeats before playing entire library

Reply #19
I did use the "selecting them.' I also tried drag and drop. same error message. oh well.
I use the same file naming system, except for classical music I use composer instead of album artist.
I'll have to check your screenshots to see if I can spot any differences, but it may not be for a few days. Got to pay attention to that day job you know.  ::)

Re: Shuffle (folders) repeats before playing entire library

Reply #20
I take it as a fact, that your file names are always named with track number first (or disc number + track number).
I'm a bit mystified, sorry. It really would be nice with that screendump (primarily to have a look at Playlist View).
The image file wasn't open in another program while you tried to attach it to the message?

Re: Shuffle (folders) repeats before playing entire library

Reply #21
Nope. I used Irfanview, saved it as a jpg file, and tried to add it to my reply. Didn't work.

Re: Shuffle (folders) repeats before playing entire library

Reply #22
I always use Irfanview for that kind of job as well. *Sigh*. I have no good ideas at hand.
You could try a dedicated image server, imgur.com being one possibility. It's free but you need to create an account.
Afterwards copy and insert the link to the file via the 'Insert an image' icon in the HA message editor.

Re: Shuffle (folders) repeats before playing entire library

Reply #23
It might have worked this time, after a reboot.

Re: Shuffle (folders) repeats before playing entire library

Reply #24
Thank you for the screendump. I have recreated your (standard) layout in a portable installation of foobar2000. Everything seems to be okay here when using:
Code: [Select]
$crc32($directory_path(%path%)) | [%discnumber% - ]%tracknumber%
The Grammy Champion album is a mess, admittedly; but I can't see any logical pattern.

Repetition: To have the files display in the correct order, their names should at least begin with the tracknumber when it's a single disc album and discnumber followed by tracknumber when it's a multi-disc album.

You can use the view "by folder structure" in Library -> Album List to examine the Grammy Champion album's file names (use grammy champion as a filter).

You may also want to open the Grammy Champion album in Mp3tag to ensure that the contents of the track number tag match the file names.

As a side note: It may be necessary to manually update the informations in foobar2000 when making changes to tags in Mp3tag. In foobar2000 right click on the album (or whatever) in question, choose Properties and click on the Tool button bottom left. Choose Reload info. (foobar2000 is more than capable as a tag editor, by the way.)

I am more or less giving up by now, I must admit ...

Edit. If you make any changes to tags and/or file names it may be necessary to delete the Classical Shuffled playlist and create a new.