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: Feature Request/Suggestion: Random by album (Read 5178 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Feature Request/Suggestion: Random by album

Would it be possible to implement a play mode that is random by album?

what i mean is that it would randomly pick the first track of an album, play the whoel album, then randomly pick the first track of a different album, then play the whole album, etc.

i suppose this might be able to be accomplished by a sort string, but im not 100% sure about that.

Feature Request/Suggestion: Random by album

Reply #1
open album list
add all music to playlist
playlist / sort by track numbers
crop first tracks
play with shuffle
Music is my first love.

Feature Request/Suggestion: Random by album

Reply #2
Quote
open album list
add all music to playlist
playlist / sort by track numbers
crop first tracks
play with shuffle

? So then it only plays the first track of every album? What's the use of that? That's not what he wants...

Feature Request/Suggestion: Random by album

Reply #3
ok, sorry

use album list
tree: [%album%]
sorting: nothing

album is in "random" order
send all  to playlist and play...
Music is my first love.

Feature Request/Suggestion: Random by album

Reply #4
You can do it with a sorting string.  Search the forums I've posted it before.

Feature Request/Suggestion: Random by album

Reply #5
Bushwack, I don't see how that would be possible.  A formatting string won't do it.  The formatting has nothing to do with the play order.  It would be easy to randomly shuffle tracks within individual albums, but I can't see a way to randomize whole albums (while keeping the albums congruent).

Feature Request/Suggestion: Random by album

Reply #6
Quote
Bushwack, I don't see how that would be possible.  A formatting string won't do it.  The formatting has nothing to do with the play order.  It would be easy to randomly shuffle tracks within individual albums, but I can't see a way to randomize whole albums (while keeping the albums congruent).

Turn off shuffle, and play playlist (sorted in random albums first, then tracknumber) beginning to end. It would just be more difficult skipping to next album..
.

Feature Request/Suggestion: Random by album

Reply #7
And how would one sort by "random albums"?

Feature Request/Suggestion: Random by album

Reply #8
Quote
And how would one sort by "random albums"?

Someone made some foobar hashing titformatting thing you use it with %album% could sort by it.

Or you could make your own hashing thing, it would have to be number based.

edit: ah ok it wouldnt be random then.. oh well maybe not then.
.

Feature Request/Suggestion: Random by album

Reply #9
Hashing would not be random.  At all.

edit:  I see you realized that before I posted. 

Feature Request/Suggestion: Random by album

Reply #10
I already suggested adding both %__system_time% (note that this var would have to stay the say through the whole hashing/sorting process) as global variable and $CRC32 function because the hacked "hashing" function is very slow. This way you would be able to do random play by whatever.

Feature Request/Suggestion: Random by album

Reply #11
Indeed, that would work.  (even crc16 would be sufficient for these purposes)

edit:  I think saving the state of the %_system_time% variable (actually, I think a function call would be much more appropriate) would be a major problem, though.  The formatting is done one "track" at a time.  You can't pass it a dozen "tracks" and have it format them all.

Feature Request/Suggestion: Random by album

Reply #12
Quote
Indeed, that would work. (even crc16 would be sufficient for these purposes)

Well, not quite, with crc16 you would run into collisions after about 265 files with crc32 this number would be closer to 65,536. (this is known as the "birthday paradox") But I'm being too picky... heh

Feature Request/Suggestion: Random by album

Reply #13
Meh.  You're probably right.  crc16 would be a bit small.

Feature Request/Suggestion: Random by album

Reply #14
Quote
edit: I think saving the state of the %_system_time% variable (actually, I think a function call would be much more appropriate) would be a major problem, though. The formatting is done one "track" at a time. You can't pass it a dozen "tracks" and have it format them all.

You don't need to, what you do need is defining some kind of "global" variable that just keeps value and doesn't act  as a pointer eg.
$putsG(X, %__system_time%)
would keep X at the value all the time (unless user changes the value), I don't know if this is easy with foobar's API given it does use every function/variable on track by track basis.

Feature Request/Suggestion: Random by album

Reply #15
Sorry I didn't give more info before I was on my way to work, I'm at work now so I have lots of time 


You can find a hashing function I made in this thread.  If you modify that (so it fits on one line) and end it with $get(HASH)%tracknumber%, you can use it to sort your playlist by the hash value of the album.  Curi0us_George is correct to argue that it's not random, but nothing on a computer is really "random".  By changing the initialisation value (don't use $rand like I suggested in the other thread, I'm not sure what I was thinking with that) I find the results to be as random as the "random" used in mp3 players (I haven't done as test or mathimatical proofs or anything though).

The down side to this is the hashing is very slow  As suggested some kind of bulit in hashing function would probably help alot, or else maybe someone knows a super fast hashing algo. that gives decent results.

PS global variables would kickass, I can think of a hundered different things you could use them for.

Feature Request/Suggestion: Random by album

Reply #16
Hmm.  I suppose if Peter wanted to, he could implement global variables.  But he'd need some sort of way to initialize them only once, so that they wouldn't be reinitialized every time the format functions were called.

Feature Request/Suggestion: Random by album

Reply #17
Quote
But he'd need some sort of way to initialize them only once, so that they wouldn't be reinitialized every time the format functions were called.

Yep finding the smart way to do it is the interesting part... I was thinking of implementing a new screen in [Title formatting] call it [Globals] (or whatever) they are initialized when user presses the apply button on the screen or when foobar loads and their values can be accessed anywhere in the program i.e. title formatting, search, order etc.

Feature Request/Suggestion: Random by album

Reply #18
it would almost be like adding a whole scripting language to foobar, rather than just "title formatting"

altho its almost to that point now.