Apollo Advanced Playlist

Apollo Advanced Playlist (AAP) version 1.00
A new playlist format — but why?

A regular playlist consists of explicit track entries. You can make a playlist which contains for example all tracks of a certain album or all tracks with the same content type. You can turn on the shuffle mode in your player if you don't want to listen the tracks always in the same order. This is adequate in most cases. But consider a situation where you have, say, 2000 different MP3s on your hard disk and you get new tracks pretty often. Now if you have made your playlists by categorizing the tracks for example by content type, you would have to update your playlists every time you get a new MP3. Pretty inconvenient.

Let's take a bit more complicated example. Let's say you are in the mood for long rock ballads. How do you handle this situation? You first create a playlist with all rock ballads in it, then delete all entries with duration less than five minutes. Awkward, isn't it.

This is where the Apollo Advanced Playlist comes handy. Apart from having regular explicit file entries in the playlist, you can now create random entries. This means that you don't need to define the entry explicitly, but instead you set conditions for the track and the player picks the respective track randomly according to the conditions. Now with these new random entries, you can easily handle the situations discussed earlier by defining appropriate random entries.


Random entries

A random entry is defined by a string which sets certain conditions for the track. This string is called the condition expression or the condition string. When the player comes encounters a random entry in the playlist, it randomly picks a track which meets the set conditions from a given set of tracks. This set of tracks is called the sample space. The sample space may be defined from the playlist tab of the options dialog in Apollo.

The condition expression is a combination of string and integer comparisons. The operators available for combining comparisons and expressions are & (and) and | (or). All comparisons must be in parentheses. Parentheses may also be used to group expressions. Empty condition expression means that the track is randomly selected from the whole sample space.

There are six different operators available for comparing integer values. These are = (is equal to), > (is greater than), >= (is greater than or equal to), < (is less than), <= (is less than or equal to) and != (is not equal to). The first operand must be one of the integer valued variables and the second must be a numeric constant, i.e. all integer comparisons are of the format

(<variable> <operator> <numeric constant>)

There are four different operators available for comparing string values. These are = (is), ~ (contains), != (is not) and !~ (does not contain). The first operand must be one of the string valued variables and the second must be a string constant in quotes, i.e. all integer comparisons are of the format

(<variable> <operator> "<string constant>")

Integer valued variables
General
FILESIZE File size (in bytes)
DURATION Track duration (in seconds)
ID3 frames
YEAR Year
TRACKNUM Track number/Position in set
PLAYCOUNTER Play counter
POPULARIMETER Popularimeter
 
String valued variables
General
FILEBODY File body
FILEPATH File path
ID3 frames
ORIGALBUM Original album/movie/show title
PUBLISHER Publisher
ENCODEDBY Encoded by
ENCODERSETTINGS Software/Hardware and settings used for encoding
ORIGFILENAME Original filename
LANGUAGE Language(s)
PARTINSET Part of a set
DATE Date
TIME Time
RECORDINGDATES Recording dates
MEDIATYPE Media type
FILETYPE File type
NETRADIOSTATION Internet radio station name
NETRADIOOWNER Internet radio station owner
LYRICIST Lyricist/Text writer
ORIGARTIST Original artist(s)/performer(s)
ORIGLYRICIST Original lyricist(s)/text writer(s)
SUBTITLE Subtitle/Description refinement
MIXARTIST Interpreted, remixed, or otherwise modified by
USERTEXT User defined text information frame
CONTENTGROUP Content group description
TITLE Title/songname/content description
LEADARTIST Lead performer(s)/Soloist(s)
BAND Band/orchestra/accompaniment
ALBUM Album/Movie/Show title
CONDUCTOR Conductor/performer refinement
COMPOSER Composer
COPYRIGHT Copyright message
CONTENTTYPE Content type
COMMENT Comments
WWWAUDIOFILE Official audio file webpage
WWWARTIST Official artist/performer webpage
WWWAUDIOSOURCE Official audio source webpage
WWWCOMMERCIALINFO Commercial information
WWWCOPYRIGHT Copyright/Legal information
WWWPUBLISHER Publishers official webpage
WWWPAYMENT Payment
WWWRADIOPAGE Official internet radio station homepage
WWWUSER User defined URL link frame
INVOLVEDPEOPLE Involved people list
UNSYNCEDLYRICS Unsychronized lyric/text transcription
PICTURE Attached picture
GENERALOBJECT General encapsulated object
UNIQUEFILEID Unique file identifier
GROUPINGREG Group identification registration
CRYPTOREG Encryption method registration

Examples

Suppose you are a fan of female artists, especially Joan Osborne, but you hate long songs. Your playlist could be something like this:

  1. (DURATION < 300) & (LEADARTIST ~ "Joan Osborne")
  2. (DURATION < 300) & ((LEADARTIST ~ "Alanis Morissette") | (LEADARTIST ~ "Des'ree") | (LEADARTIST ~ "Patricia Kaas"))

Suppose you are a great fan of Vangelis, but you never want to hear two songs from the same album played in a row. You migh solve this problem with this playlist:

  1. (LEADARTIST = "Vangelis") & (ALBUM = "1492 - Conquest Of Paradise")
  2. (LEADARTIST = "Vangelis") & (ALBUM = "Antarctica")
  3. (LEADARTIST = "Vangelis") & (ALBUM = "Blade Runner")
  4. (LEADARTIST = "Vangelis") & (ALBUM = "L'Apocalypse des Animaux")
  5. (LEADARTIST = "Vangelis") & (ALBUM = "Oceanic")
  6. (LEADARTIST = "Vangelis") & (ALBUM = "Portraits")
  7. (LEADARTIST = "Vangelis") & (ALBUM = "Voices")

Suppose you host a pop radio station. Your playlist might be something like this:

  1. (YEAR >= 1995) & (POPULARIMETER > 240)
  2. (YEAR >= 1995) & (POPULARIMETER > 200)
  3. (YEAR >= 1995) & (POPULARIMETER > 200)
  4. (YEAR >= 1990) & (YEAR < 1995) & (POPULARIMETER > 200)
  5. (YEAR >= 1980) & (YEAR < 1990)
  6. (SUBTITLE = "Jingle")
  7. (SUBTITLE = "Advertisement")
  8. (SUBTITLE = "Advertisement")
  9. (SUBTITLE = "Advertisement")
  10. (SUBTITLE = "Jingle")
  11. (DURATION >= 360) & (YEAR >= 1990)

Suppose you just can't stand some artists.

  1. (LEADARTIST !~ "Hanson") & (LEADARTIST !~ "Spice Girls")

AAP file format (for developers only)

I will describe the AAP format with the following example file.

[Apollo Advanced Playlist]
Version=1.00
[Entries]
Entry1=D:\MP3\Beck - Loser.mp3
Entry2=Cranberries\Cranberries - To The Faithful Departed.m3u
Entry3=http://www.mp3site.com/sample.mp3
Entry4=;(DURATION > 300) & (ARTIST = "Ultra Bra")
Entry5=D:\MP3\Blues
NumberOfEntries=5

The AAP file always has a section [Apollo Advanced Playlist], which (currently) has only the version of the file format.

The playlist itself is stored in the [Entries] section. As you can see, it is much like PLS format. The above example lists all four possible entry types. The first entry is pretty obvious. The second entry example is stored with relative path. The path of the playlist file should be used as the basis for all relative paths that it may contain. Entries may very well be other playlist files. The third entry is a URL entry and requires no explanation. The fourth entry is a random entry. The semicolon at the beginning of the entry indicates that it is a random entry. The semicolon is immediately followed by the condition expression. Last of the entries is a directory. All supported files from that direcory (and, if the user chooses so, from its subdirectories) should be added to the main playlist.