Old 13th November 2012, 23:11   #1
Psycho-Spud
Junior Member
 
Join Date: Nov 2012
Posts: 1
Randomn Play

Hope I'm not repeating an idea already suggested... I wish there was a mechanism allowing me to weight the songs in random play. I have some songs on my playlist that seem to come up too often. I don't want to delete them, just reduce the number of times they play. Perhaps a range of one through five?
Psycho-Spud is offline   Reply With Quote
Old 14th November 2012, 19:44   #2
MrSinatra
Forum King
 
MrSinatra's Avatar
 
Join Date: Dec 2004
Location: WKPS, State College
Posts: 5,535
Send a message via AIM to MrSinatra
pretty sure this has been requested but the suggestion is sound.

the way i envision it would be by using ratings. winamp currently does 0-5 stars, and the ratings already go into the files/DB or only the DB (the default).

a "smart" random would then let the user assign a percentage of playtime per hour to the rating. for me it would it would look something like this:

0 stars = 0%
1 star = 0%
2 = 0%
3 = 25%
4 = 33%
5 = 42%

and the beauty of this is each user could weight it the way they like. this makes ratings MUCH more powerful and useful.

the trick would be in the time calculations. the length of each track would have to be taken into account, b/c you could have a 5 star 13 second track, and a 3 star 10min track. ergo the percentages must apply to total time per hour, not total # of rated tracks scheduled per hour.

in addition, other factors should be taken into account, such as playcount. you would want everything within a rating to play once before something was repeated. playcounts are currently in the DB only. you could also add other rules, like "albumartist spread" so that tracks by the same artist are spread out, regardless of the rating.

once you had all that, you could set up a scheduler to program different smartviews (by the hour for a week), and then you'd basically have a solution thats broadcaster level worthy.

PENN STATE Radio or http://www.LION-Radio.org/
--
BUG #1 = Winamp skips short tracks
Wish #1 = Multiple Column Sorting
Wish #2 = Add TCMP/Compilation editing
MrSinatra is offline   Reply With Quote
Old 14th November 2012, 21:17   #3
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,638
Hi Psycho-Spud,

There is an option in General Preferences - Playlist, that lets you adjust the "Shuffle Morph Rate". It is supposed to effect the randomness of random playback. Have you tried it?

MrSinatra's idea has merit, especially for those running a radio show. But I would prefer an independent system. I don't use ratings in my collection because all my songs would be rated 4 or 5 stars (I don't add songs I don't like).

Winamp Pro v5.666.3516 fully-patched - Komodo X Touchscreen v1.0 by Victhor skin
Windows 10 Home 64-bit v1809 desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 14th November 2012, 21:23   #4
MrSinatra
Forum King
 
MrSinatra's Avatar
 
Join Date: Dec 2004
Location: WKPS, State College
Posts: 5,535
Send a message via AIM to MrSinatra
Quote:
Originally Posted by Aminifu View Post
MrSinatra's idea has merit, especially for those running a radio show. But I would prefer an independent system. I don't use ratings in my collection because all my songs would be rated 4 or 5 stars (I don't add songs I don't like).
define "independent" system?

as for ratings, if you already don't use them, then thats a way you could use them, to determine percentages.

in my system, 1 means i hate/dislike it, 2 means neutral, 3 means its worth hearing, 4 means i like it, 5 means i love it. my random mixes may or may not include 3/4 star stuff, but likely never 1/2 star stuff. but it would be up to the user.

you could do 5 levels of like if you want, it would be up to you. whats the problem?

PENN STATE Radio or http://www.LION-Radio.org/
--
BUG #1 = Winamp skips short tracks
Wish #1 = Multiple Column Sorting
Wish #2 = Add TCMP/Compilation editing
MrSinatra is offline   Reply With Quote
Old 14th November 2012, 22:26   #5
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,638
Quote:
Originally Posted by MrSinatra View Post
define "independent" system?

as for ratings, if you already don't use them, then thats a way you could use them, to determine percentages.
A system not tied to ratings was the implication. And I agree that its generally not useful to object to something and not offer an alternative.

But you have a point. Normally I would use rating stars the same way you do. So having everything 4 or 5 would not lead to much randomness. I'm not above using tags slightly differently from their intended purpose, so I could do as you suggest for my personal use.

Winamp Pro v5.666.3516 fully-patched - Komodo X Touchscreen v1.0 by Victhor skin
Windows 10 Home 64-bit v1809 desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 24th November 2012, 19:06   #6
pasemes
Junior Member
 
Join Date: Nov 2012
Posts: 2
Really looking forward for this too!!!

I'm looking for that for years now. For me what MrSinatra stated is just perfect!

Aminifu said that he only has what he likes in his library, but I don't think that's the same for many (most?) people. Since the availability of broadband internet people don't get only a single track from an album or an artist. I particularly get at least the whole album, and many times when a hear and like a couple of tracks from an artist I get his whole discography.

Another scenario (and that's my case too) is for people which has digitized (mp3) vinyl collections. Again, in this scenario, since you get whole albuns, there are many tracks you don't like too much.

Combined these aspects with the fact that many (again, most?) people like hear to their library in random mode, then this feature would really be welcome!

Question: is there an specific place to post these kind of requests other than this forum?

Bye,
pasemes is offline   Reply With Quote
Old 25th November 2012, 20:24   #7
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,638
Quote:
Originally Posted by pasemes View Post
Question: is there an specific place to post these kind of requests other than this forum?
No, this is the place. Unfortunately, most of these requests are not acted on.

Winamp Pro v5.666.3516 fully-patched - Komodo X Touchscreen v1.0 by Victhor skin
Windows 10 Home 64-bit v1809 desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 22nd May 2013, 18:31   #8
Crashguard303
Member
 
Crashguard303's Avatar
 
Join Date: Oct 2008
Location: Dortmund, NRW
Posts: 60
what does work

At the moment, I do what MrSinatra wrote in is first answer:
I generate a smart list as a filter (using rating=x and lastplay < [x hours ago]),
allowing:
5stars tracks to be played every 24 hours,
4stars tracks to be played every 48 hours etc...

It does also work with non-rated tracks, if you just use lastplay information.
Every day I start winamp, the smart view is updated,
giving me tracks which "are allowed to be played" for this day's playlist.
The playlist itself then can be played randomly.

Working on a project dealing with bioinformatics,
I found a behaviour which describes what MrSinatra wrote above:
The weighted R.-wheel-selection:

1. Imagine, you have a playlist with 5 tracks and their playcount info (the list needn't be sorted):
1=Track A: 0 times
2=Track B: 1 time
3=Track C: 3 times
4=Track D: 9 times
5=Track E: 19 times

2. Use an internal playlist and add 1 to each playcount value (this will prevent possible division by zero errors in next step), giving:
1=A: 1
2=B: 2
3=C: 4
4=D: 10
5=E: 20

3. Now use the inverse values,
giving fitness values (high values = high chance to be played) (X)
and calculate the overall fitness sum, too:
1=A: 1/1 = 1.00 (fitness: 1.00 etc)
2=B: 1/2 = 0.50
3=C: 1/4 = 0.25
4=D: 1/10 = 0.10
5=E: 1/20 = 0.05
Fitness sum: 1.9

(X)=Note before adding:
Fitness values of tracks which have already been played in this run, must be set to 0.
(1 run: play all tracks of a playlist for one time)
Or: remove this entry from the "internal" tracks-left-to-be-played-list.
I'm pretty sure WinAmp's internal random play does store postions of the list, which have already been played so far
or does use an internal tracks-left-to-be-played-list.
-> If the internal list was played completely, it must content/allow all tracks again.

4. Now generate a RANDOM POSITION (in playlist) between 1...5 (playlist length)
-> let's assume position 3
and a RANDOM float value (target fitness) between 0...1.9 (fitness sum)
-> let's assume 1.75

5. Start at random position (here: 3), add fitness value at current position.
Change position (spin wheel) and keep adding values at current position
until target fitness (here: 1.75) is exceeded:
3=C +0.25 -> 0.25
4=D +0.10 -> 0.30
5=E +0.05 -> 0.35
1=A +1.00 -> 1.35
2=B +0.50 -> 1.85 Exceeded!

Wheel stopped at position 2,
-> Track B won this round.

Repeat steps 1-5 for all tracks in the list,
then start over.

-> Key behaviour is:
the more often a single track was played IN RELATION TO ALL OTHER TRACKS,
the lower is the chance it will be played and vice versa.

You could also use the difference of time between a track was played to now (in seconds) as a fitness value instead.

The sum of all energies is zero.

Last edited by Crashguard303; 22nd May 2013 at 19:09. Reason: more info
Crashguard303 is offline   Reply With Quote
Old 22nd May 2013, 23:06   #9
pasemes
Junior Member
 
Join Date: Nov 2012
Posts: 2
Crashguard, thanks for the response. I wasn't aware of the smart view. I've implemented the filter that you suggested (using rating=x and lastplay < [x hours ago]).

Just as a full example, here is my filter: (rating = "5" AND lastplay < [1 week ago]) OR (rating = "4" AND lastplay < [1 month ago]) OR (rating = "3" AND lastplay < [3 months ago]) OR (rating = "2" AND lastplay < [6 months ago]) OR (rating = "1" AND lastplay < [1 year ago]) OR (rating ISEMPTY). Please, notice the parentheses it is important for precedence.

I also would like to add that, although this approach is similar to what was asked by MrSinatra, it is no quite the same. As I could understand the smart view is only generated/updated once you open winamp or when you change from/to other list. So, once you loaded the (smart) list the player will go through all of its items randomly and regardless of the items rating. Of course, if your list musics are balanced by rating (more items of the higher rating) then, in a reasonable long session, you tend to hear more of the higher rating which is the desired result (as stated by MrSinatra). However, in a relative short session, you run the risk of only hearing low rating items, since the player will play the playlist randomly (regardless of the rating).

Anyway, the Crash's trick was a HUGE improvement of what I had until now. Thanks! Finally, Crash, I was curious about how to implement the algorithm that you have described.
pasemes is offline   Reply With Quote
Old 23rd May 2013, 18:53   #10
Crashguard303
Member
 
Crashguard303's Avatar
 
Join Date: Oct 2008
Location: Dortmund, NRW
Posts: 60
filter

@pasemes:
Glad to hear that it worked for you

Quote:
Please, notice the parentheses it is important for precedence.
Yes, this is needed to connect each rating with it's playcount.
Otherwise, the ORs won't work correctly.


What does wonder me (I'm a former electronic technician) is,
that the comparisons don't need to be put in parentheses, too.
I thought, that:
(rating="5" AND lastplay<[1 week ago]) OR ... must look like this:
((rating="5") AND (lastplay<[1 week ago])) OR ... to be on the safe side.


Another thing for your filter - You can also use:
& instead of AND,
| instead of OR to get shorter expressions.

Quote:
As I could understand the smart view is only generated/updated once you open winamp or when you change from/to other list.
A "refresh" button would be nice.
What is working for me to update the library query result:
clicking into the search field, pressing space, then backspace again.
But this is a little bit goofy.

Quote:
Crash, I was curious about how to implement the algorithm that you have described.
I'm curious, too
To my understanding of programming, this won't be a big deal,
as there is already an internal list (array):
  1. storing tracks which have been played so far on random play
    until all tracks are marked as played,
    or:
  2. initially a copy of the playlist,
    then randomly played items are removed from this list
    until it is empty.
This makes sure that each track of the playlist will be played one time only.
When the list was played completely
and "repeat" turned is on,
this array / internal list is reset.
Jumping to the remaining tracks will have to be modified/extended.
But then (if track rating isn't used only for play-preference / random-weighting),
storing lastplay/playcount statistics must be turned on, by all means.
As far as I know, a part of these statistics is optional.

The sum of all energies is zero.

Last edited by Crashguard303; 23rd May 2013 at 19:14. Reason: more info
Crashguard303 is offline   Reply With Quote
Old 23rd May 2013, 19:31   #11
Crashguard303
Member
 
Crashguard303's Avatar
 
Join Date: Oct 2008
Location: Dortmund, NRW
Posts: 60
Another idea

What is even easier to implement:
  1. Get a random track(= entry) number in playlist (prospective jump position).
  2. Before playing this track:
    Generate a random integer number between 1 and 5.
    IF this random number is <= the rating of the chosen track:
    -> play this track
    ELSE
    -> get another random track number (GO TO Step 1. again)
This will give:
a chance of 1:1 for 5-star-rated tracks,
a chance of 1:5 for 1-star-rated tracks.

Just as I said above, this "strategy" will only influence the random "jumping",
nothing more.


Instead of:
generating a random integer value 1...5 and compare it with the current_track_rating,
you could also:
generate a random integer value 0...track_playcount and compare it with min_playcount
or:
generate a random integer value 0...(track_playcount-min_playcount) and compare it with (max_playcount-min_playcount),
giving a higher chance for tracks which have been played not this often.

The sum of all energies is zero.

Last edited by Crashguard303; 23rd May 2013 at 20:10. Reason: More info
Crashguard303 is offline   Reply With Quote
Old 23rd May 2013, 20:47   #12
Aminifu
Forum King
 
Aminifu's Avatar
 
Join Date: Aug 2011
Location: Chicago, IL
Posts: 4,638
Hi Crashguard303,

Those are interesting ideas in your posts. Once the devs are done with the pending version 5.7 release, one or more may tell us how the current randomizing is done or how difficult it would be to implement one or more of your suggestions.

Winamp Pro v5.666.3516 fully-patched - Komodo X Touchscreen v1.0 by Victhor skin
Windows 10 Home 64-bit v1809 desktop - Logitech Z906 5.1 speaker system
Aminifu is offline   Reply With Quote
Old 24th May 2013, 06:36   #13
MrSinatra
Forum King
 
MrSinatra's Avatar
 
Join Date: Dec 2004
Location: WKPS, State College
Posts: 5,535
Send a message via AIM to MrSinatra
guys,

I am completely impressed with your inventiveness and level of conversation, your practical mathematical understanding is well beyond mine.

I will have questions eventually, but I just wanted to pass this on:

Quote:
Originally Posted by Crashguard303 View Post
A "refresh" button would be nice.
What is working for me to update the library query result:
clicking into the search field, pressing space, then backspace again.
But this is a little bit goofy.
what I've been doing for years, is just clicking the "Clear Search" button to the right of the search text entry box. this refreshes the view for me.

PENN STATE Radio or http://www.LION-Radio.org/
--
BUG #1 = Winamp skips short tracks
Wish #1 = Multiple Column Sorting
Wish #2 = Add TCMP/Compilation editing
MrSinatra is offline   Reply With Quote
Old 24th May 2013, 11:15   #14
Crashguard303
Member
 
Crashguard303's Avatar
 
Join Date: Oct 2008
Location: Dortmund, NRW
Posts: 60
refresh

@all:
Thanks , but this just comes with my former job (electronic technician) and my current job training
(I'm not at an university):
I am learning software development & (IT-)business/trading.
Our business education also includes some statistic calculating,
fitting for all types of lists.


@Aminifu:
Quote:
Once the devs are done with the pending version 5.7 release, one or more may tell us how the current randomizing is done or how difficult it would be to implement one or more of your suggestions.
That's right.
I'm still guessing how it is done at the moment,
so I gave 2 main ideas.
The second one (chance 1:1, 1:2 ... 1:5) should be no problem anyway,
although it could slow down the random jumping a bit.


@MrSinatra:
Quote:
what I've been doing for years, is just clicking the "Clear Search" button to the right of the search text entry box. this refreshes the view for me.
Good that you reminded me of this!
But this works only if you have a stored smart view,
and will delete the text in search query.
I was looking for a way to refresh the result and prevent the search text.

The sum of all energies is zero.

Last edited by Crashguard303; 24th May 2013 at 11:49. Reason: More info
Crashguard303 is offline   Reply With Quote
Old 27th May 2013, 14:58   #15
Crashguard303
Member
 
Crashguard303's Avatar
 
Join Date: Oct 2008
Location: Dortmund, NRW
Posts: 60
Another idea - edit

Oh, If forgot a detail in my 2-step-pseudo-code.
To make it more clear:
  1. Choose a random track(= entry number) in playlist
    * which hasn't been played in this turn (prospective jump position).
  2. Before playing this chosen track:
    Generate a random integer number between 1 and 5.
    IF this random number is <= rating of the chosen track:
    -> PLAY this track
    ELSE
    -> instead of playing, GO TO Step 1. again

* 1 turn:
- play all tracks of list one time only
- start over if "repat" is on.


P.S.:
If you don't like statistic calculations,
you can also see this method in pen-and-paper role-playing games:
A character has attributes/skills (e.g. strength),
skills have values (depending on system, let's take min:0/1 to max:19/20 for example). The higher, the better.
In Winamp, the "attribute" of a track is it's rating (or number of hours/days when it was played last).

Dices are used.
Mostly, the dice's highest value is about maximum skill value a character can have.
(e.g. a dice with numbers 1 to 20, fitting to the example given above).
If you throw a dice, you can see if a character succeeds with his skill or not.

As the dice can always give any integer number between 1 and 20,
the skill value works as success-threshold:
You have to throw a dice value below the skill value to success (some systems also allow equal)
The lower the skill is, the more rare this will happen.
Here, with a skill of <=1, you'll never success,
because with diced values 1...20 you can't get below skill value 1 (only equal is possible)
Now... transfer:
dice 1...20 < skill 0/1...19/20 in P&P to:
random 1...5 <= rating 1...5 in WinAmp

The sum of all energies is zero.

Last edited by Crashguard303; 27th May 2013 at 15:15. Reason: More info
Crashguard303 is offline   Reply With Quote
Old 5th June 2013, 23:01   #16
Crashguard303
Member
 
Crashguard303's Avatar
 
Join Date: Oct 2008
Location: Dortmund, NRW
Posts: 60
But...

...if the 2nd idea is implemented,
there should be an option to activate / deactivate this feature.
And you should be able to set a "pseudo-rating" for tracks with no values,
as there might be files without rating (not rated so far or write-protected).

@MrSinatra:
Even a "rate-mapping" is thinkable, meaning a way to associate star- with preference-values.
Then you could use your values:
Quote:
0 stars = 0%
1 star = 0%
2 = 0%
3 = 25%
4 = 33%
5 = 42%

The sum of all energies is zero.
Crashguard303 is offline   Reply With Quote
Old 8th July 2013, 18:14   #17
Crashguard303
Member
 
Crashguard303's Avatar
 
Join Date: Oct 2008
Location: Dortmund, NRW
Posts: 60
More...

A problem I see if bad rated tracks can be mapped to 0% playing chance:
If it (however) happens, that you have a list with bad rated tracks (remaining?) only,
winamp will perform the track-jumping-routine infinetely:

It won't find a suitable file allowed to be played, jumping constantly to the next one
(this is why I re-dice the rating goal before each jump, too)

In genetic algorithms, this is a reason why you also allow "bad" elements to be chosen
(at least in a low rate).
Nature also breeds some... well... non-healthy individuums from time to time (I'm one of them).
But this needed to prevent over-breeding.
That's what killed the dinosaurs: too much specialization (see red queen problem).

The sum of all energies is zero.
Crashguard303 is offline   Reply With Quote
Old 14th April 2015, 21:12   #18
MrSinatra
Forum King
 
MrSinatra's Avatar
 
Join Date: Dec 2004
Location: WKPS, State College
Posts: 5,535
Send a message via AIM to MrSinatra
I just wanted to link this thread to this other one:

http://forums.winamp.com/showthread.php?p=3022323

it seems we have some serious math brains on the forums. I'm not sure though, having read all the posts, that I am smart enough to understand whats being said, or how to implement things, and how close it actually gets me to what I described in my first post.

more importantly, I am curious if you guys are asking for any features to be implemented natively in winamp to help enable this stuff, or if a plugin could be made to handle this kind of scheduling?

anyway, it is really impressive to see threads like these for a music player.

PENN STATE Radio or http://www.LION-Radio.org/
--
BUG #1 = Winamp skips short tracks
Wish #1 = Multiple Column Sorting
Wish #2 = Add TCMP/Compilation editing
MrSinatra is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Winamp > Winamp Wishlist

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump