MakePlaylist is a computer program I started writing in 2022 to generate playlists for background music, which I like to play nearly all the time since then. Every day, at the click of a mouse, I create a playlist chosen randomly from all the folders of music I consider good for background music. I generally use Roon to do the actual playback, but many if not most music playing programs will read the standard .m3u playlist files MakePlaylist generates.
I never thought any random playing system before mine worked correctly, and now I see why.
Unlike most random play functions, MakePlaylist by default uses Random-Without-Replacement (RWOR) meaning I will hear everything once before anything is played twice, and this is true not for just one playlist but every playlist you make until you have actually heard everything in your collection (or selected folders). The effect of this is profound. More typical Random-With-Replacement (RWR) (or RWOR in just one session) can take 7 times longer to actually play everything at least once, and some things will by random chance be played dozens of times more than that.* Those things being played a lot may well be the things you like least. And if the random drawing system is biased, it could be worse.
Managing RWOR across multiple sessions requiring keeping a history, and that is one thing MakePlaylist does.
MakePlaylist has many other features, including 4 different random modes in all, folders can be weighted relative to one another, and you can select subsets of files based on creation date and/or file type. You can make playlists with either Albums or individual Songs.
Although MakePlaylist is built around the idea of random selection, you can easily prepend chosen titles, or shuffle in favorites and fairly new items. MakePlaylist comes with another program ShufflePlaylist to shuffle multiple playlists together. And TrimPlaylist lets you trim the early part of a playlist that you have actually played, or remove the following items you didn't play from the played history--which is crucial in keeping the RWOR system working as well as it can, but only if you only listen to a handful of titles in very long playlists with huge libraries will RWOR give slower coverage than typical RWR. I've determined there is a set of parameters where that happens using another included program TestPlaylist which runs coverage tests using as many runs of MakePlaylist as necessary to get to full coverage of a set of folders.
I routinely build my playlists like this: a header section containing the newest files less than 3 days old, and a middle section which combines randomly selected items from my entire library shuffled with favorite items and further shuffled with items less than 60 days old. An alternative to mixing in favorite items would be to use folder weighting, which I do in some cases.
Using such a method (illustrated in one of the scripts) one doesn't need to manually create header playlists for new items, a header is automatically prepended with the newest files.
In addition to making standard .m3u playlists, MakePlaylist can make folders of "links" pointing to the original files. These folders take very little space and can be deleted later. Some playing programs can't read playlists, but they can either load a folder of files, or you can cut and paste files from that folder into the playing program.
So then there is another program to shuffle links-folders ShuffleLinks, and one to pre-pend one links folder to another PreLinks. (With ordinary playlists, you can append and prepend them with the terminal cat command, but a special program was needed to "prepend" ordered links folders that MakePlaylist creates.)
MakePlaylist requires Tcl, which is generally available on MacOS and linux systems. On MacOS you can simply download the MakePlaylist distribution and run the programs right away.
On Microsoft Windows you must load something like Windows Subsystem for linux, and then install Tcl from Hombrew or other online source.
You can download MakePlaylist at SourceForge here. MakePlaylist is Free Software.
Since the Tcl source code is the program, it's entirely transparent, even with a very basic understanding of programming you can see what it is doing, and the code is very well documented.
You will download a .zip file, and if it was not unzipped automatically during download, you can just click on it and it will unzip into a folder now named:
MakePlaylist_all_10131
(or whatever the latest version is)
Open that folder in Finder, and it looks like this:
If you want to read the installation instructions, open 1st.README.txt.
At this point, you can simply open the bin folder and click on (or use Open With Terminal) to run any of the included programs. The first time, MacOS will refuse to run them, but then you go to the Privacy and Security panel of your System Settings, and it will say MakePlaylist was blocked, and you can give it permission to run.
Formal installation is described step by step in the file 1st.README.txt, which you can click on to read. It is just moving the files in the bin folder to your HOME bin folder, if you have one, or use the included bin folder as the beginning of a new one. And then adding that bin folder to your shell startup, which is now .zshrc on macs, if it isn't already there. And then you can customize as needed and move the User Scripts ... files to your Desktop or other location. And then to run those scripts from the Desktop, you can just click on them, to construct basic playlists you might want daily (these are non-interactive). That is how I use MakePlaylist, through scripts that often combine playlists in different ways.
MakePlaylist programs run in 3 different ways. You can just click on programs to run them. You can open a Terminal and give MakePlaylist commands. Or you can write scripts that use MakePlaylist and other programs. Once created, those scripts can be just clicked on to run.
Although I myself have generally been using MakePlaylist based scripts, I realized recently I could make the program accessible to more people by making all the programs interactive so beginners can get used to them before writing scripts.
One cool thing that MakePlaylist can do is list either the files which have been played, or the files that have not yet been played. Or it can show how many files have been played each number of times, either from the beginning of MakePlaylist history or in the current epoch (since that last time that all files were played and a history reset was done). In my background music folder (~/itunes) this looks like this:
itunes% MakePlaylist -epoch -statc *
Played Titles
------ ------
1 126
0 610
This shows that I am using the default RWOR mode, since all files have been played either once or twice since the last reset.
With TestPlaylist, one can run tests on MakePlaylist to see when and if it will actually play all the files. With the default RWOR mode, this is pretty boring. The "1" plays number gets larger until the "0" number goes away, and you get a result that looks like this:
Iteration 25
Played Titles
------ ------
2 18
1 714
Options are -albums
Length is 30
Thus, it took 25 playlists of 30 albums each to cover the entire collection of albums at least once, and only the last 30 album playlist started playing some playlists a second time.
Using RWR (MakePlaylist option -wrd) the result is very different:
Iteration 164
Played Titles
------ ------
14 4
13 7
12 11
11 33
10 43
9 65
8 104
7 119
6 115
5 92
4 66
3 32
2 32
1 8
Options are -wrd -albums
Length is 30
With RWR, it took 164 playlists until full coverage was achieved. When it was finally achieved with the 164th playlist, some albums had been played as many as 14 times.
