I'm finally ready for beta testers for my MC plug-in, Smarffle. Below is a description of it, but first, a warning:
It is written in .NET and requires the .NET Framework version 2.0. This has just been released by Microsoft and is not yet publicly available for download. It should be soon, but until it is you probably need to be a Microsoft developer in order to have it.Now, the description.
HistoryI wanted a way to play all of my music continuously without messign with playlists. Basically, I wanted a shuffle mode that I could tune to play songs I like more often than songs I like less. In addition I wanted a way to play songs I haven't heard in a long time sooner than ones I've heard recently. I couldn't find a good way to do this with MC's native functions.
So, I created Smarffle (
Smart Shu
ffle) - yes, I think it is a silly name too
SummarySimply put, Smarffle allows you to create a mathematical formula that is used to order your tracks and stores the value in a custom field called Weight. The formula can use any of the numerical fields of a track like Last Playen, Number of Plays, Rating, etc. Additionally, Smarffle can reapply the formula to the now playing track when it finishes playing and reorder it according to the newly calculated value.
Screen ShotWalkthrough- Ignore the "Unload Control" button, that's for faster testing during development
- Formula - this is the key, this is where you enter the mathematical formula you want to use, the one I have is described below
- Fields - this is just a helpful list of all of the numerical fields available and their value for the selected track in the Tracks area
- Functions - these are mathematical functions you can use in your formula, they're basically self explanatory, but some day I'll create a help file that describes them
- Actions - these are the things you can do: Apply Sorting uses the current formula and recalculates the value for all tracks, Apply To Playing Now says that when the currently playing track is done its formula is recalculated and it is reordered in the Playing Now playlist, Refresh All reloads all of the tracks in the playlist selected on the left, this can take a while
- Playlists - this is a mirror image of the playlists you have defined, selecting one allows you to apply the formula to the tracks in a particular play list; since the formula's value is stored in a custom field, "Weight", if you apply different formulas to different playlists but the same track is in both lists, then the last applied value will be stored in Weight
- Tracks - this is all of the tracks in the currently selected playlig
- That box above the Playlists - for those of you with sharp eyes, this says, "Start From the Dark moved from 0 to 4862"; this is just an information message that says that when the track "Start From the Dark" was done playing as the playing now track, its newly calculated value sorted it down to track number 4862
My FormulaSince it is a bit hard to read, here's my formula:
( EQUALTO( Last_Played; 0; DATE( ) - 60 * 60 * 24 * 110 ) / 60 / 60 / 24 / 60 - EQUALTO( Rating; 0; 3 ) / 2 + Number_Plays / 20 + RANDOM( 1; Last_Played + File_Size ) / 60 - 110 ) * 1000and here is what it means
- 1. First, the Last Played value is the number of seconds since January 1, 1970 since the track was played, i.e., a big honking number. If the Last Played date is 0 (never played), then use the value of today's date (in seconds) minus 110 days (in seconds), if it isn't 0 then use the Last Played date. Why'd I use 110 days? Because when I played around with the formula is seemed to work. I tried 90 days, but it was too short.
- 2. Divide the Last Played value by 60 days. Why 60 days? Again, trial and error. But this converts the number into the number of 2-month periods since January 1, 1970 instead of the number of seconds since then. I do this to make the numbers smaller and easier to visually compare. It is not 100% necessary.
- 3. From this value, subtract the Rating (or 3 if it is 0) divided by 2. The number 2 basically weights how important the Rating is. If you want a 5 rated track to be much more highly weighted than a 4 rated track, the you would decrease this number. If you want the difference between them to be less then you can increase this number.
- 4. From this value, add the Number of Plays divided by 20. This part of the formula says that I want to, slightly, play less played songs more than often played songs. This helps play newly added tracks more often. Changing the 20 value will weight how important this is.
- 5. From this value, add a random fraction of 2-month periods (remember, that's the unit we're now working in) divided by 60, i.e., 2 months / 60 = 1 day. So, this adds a random number of days (between 0 and 60) to the value. Note the "seed" value, this means that the random number will always be the same for the same track until it is playe (and its Last Played value changes).
- 6. From this value, subtract 110. This is another magic number that I used to reduce the number to something easier for me to compare with others. This is not needed.
- 7. Finally, multiply the total so far by 1000. Another magic number that just moves the decimal point in the final result.
So, what does it all mean?
- EQUALTO( Last_Played; 0; DATE( ) - 60 * 60 * 24 * 110 ) / 60 / 60 / 24 / 60 - how long ago was it played, the lower the number (the longer ago) the lower the Weight, hence I will play it sooner
- - EQUALTO( Rating; 0; 3 ) / 2 - subtract a number, the higher the rating the more I subtract, hence the sooner I play it
- + Number_Plays / 20 - add a number, the more I've played it the more I add, hence the later I play it
- + RANDOM(1; Last_Played + File_Size ) / 60 - add a random number, this has 1 purpose, mix up things so that I don't always listen to tracks in the same order
SummaryThe key is that you can create your own formulas according to what's important to you. I realize the math is a bit hard to follow, but if you play around with it a bit begins to make sence. Anyway, if you're interested in testing, and you ready to give me lots of feedback,
and you have access to the .NET Framework version 2.0. Let me know.