Creative Technology Consultants
Random header image... Refresh for more!

Queuing Theory and radio playlists

Here’s an inter­est­ing ques­tion. Well, it’s inter­est­ing to me, and maybe some­one who knows about Queu­ing The­o­ry can help me solve it.

Imag­ine you cre­ate a radio sta­tion playlist by select­ing a num­ber of albums (that meet a par­tic­u­lar theme, say) and give you the total run­ning time you want, and then you ran­dom­ize the order of all the tracks on all the albums. A Rule set­ting in your play­out sys­tem does­n’t let it play the same artist more fre­quent­ly than once an hour (ie the “Min­i­mum Artist Sep­a­ra­tion” is 60 min­utes). If the sys­tem’s about to play a track that would break that rule, it moves it down the playlist until it does­n’t break the rule, recog­nis­ing future appear­ances of the same artist (or it removes it an puts it back in the pool). If it can’t move the artist far enough away, it gives up and tell you that it can’t do it.

Is there a for­mu­la that will let you know for a giv­en total run­ning time of playlist (giv­en an aver­age num­ber of tracks on an album, of aver­age run­ning time, and assum­ing each album is by one artist to keep it sim­ple) how many dif­fer­ent artists you will need to give you a high prob­a­bil­i­ty of the Rule nev­er failing?

That’s the ques­tion: here’s the background.

If you decide to run a suit­ably licensed Inter­net Radio sta­tion, some­thing you run into fair­ly quick­ly is a set of claus­es in the Dig­i­tal Mil­len­ni­um Copy­right Act (DMCA), which define how often you can play pieces of music by the same artist and from the same album. In addi­tion to appear­ing in the DMCA, and thus in the terms of the licens­ing arrange­ment with Sound Exchange in the USA, you’ll find sim­i­lar claus­es in the Phono­graph­ic Per­for­mance Lim­it­ed (PPL) Web­cast­ing licence in the UK.

Here’s how Live365 puts the require­ment in their rules for broad­cast­ers:

In any three-hour period:

  • you should not inten­tion­al­ly pro­gram more than three songs (and not more than two songs in a row) from the same recording; 
  • you should not inten­tion­al­ly pro­gram more than four songs (and not more than three songs in a row) from the same record­ing artist or anthology/box set.

As far as I know, there are no play­out sys­tems out there that actu­al­ly allow you to put these rules in and then makes sure you don’t break them. What we need is a set of check boxes:

Album sep­a­ra­tion: Max­i­mum X songs from same album per Y hours. Max in a row: Z
Artist sep­a­ra­tion: Max­i­mum A songs from same artist per B hours. Max in a row: C

Nobody cur­rent­ly does this. Why not? Any licensed inter­net sta­tion needs to fol­low rules of this type. Cur­rent­ly SAM Broad­cast­er comes clos­est, with the Playlist Rules dia­log shown at the top of the page.

It’s more com­mon to have some­thing more sim­ple. MegaSeg is a very nice Mac­in­tosh-based play­out sys­tem – the one I use – and get­ting bet­ter all the time, but apart from its lack of offi­cial FLAC sup­port (in com­mon with SAM – but luck­i­ly with Megaseg there’s a workaround in the form of the Xiph Quick­time plu­g­ins), one of its few cur­rent fail­ings (due to be addressed in the next release) is that the only set­ting that you can use to help meet the DMCA require­ments is “Artist Sep­a­ra­tion”. So you can define the min­i­mum length of time between plays of the same artist, and that’s it. Set­ting this val­ue to 60 min­utes will stop you break­ing the sec­ond DMCA require­ment, at least, although it’s a lit­tle crude: you have to rely on the fact that most albums are by one artist and man­u­al­ly select mate­r­i­al accord­ing­ly to meet the album rep­e­ti­tion rule.

Once you start try­ing to build playlists that don’t play an artist more than once an hour, you quick­ly dis­cov­er that you need more artists than you thought. Hope­ful­ly it’s pos­si­ble to build a for­mu­la to help you know how many artists you need, and about how many tracks by each.

Any ideas?

1 comment

1 Richard Elen { 06.22.10 at 13:05 }

And we have an answer. In fact a more com­plete one than I expected.

This approach is based on infor­ma­tion kind­ly pro­vid­ed by a respon­dent to my query on this top­ic in the Spa­cial Audio forums (“Cygnus X‑1” in fact, a forum admin). The ter­mi­nol­o­gy assumes you’re using SAM Broad­cast­er (Spa­cial’s Win­dows-based radio automation/DJ sys­tem that I own but don’t use as it does­n’t sup­port FLAC files), but the the­o­ry is gen­er­al and can be applied to any play­out system.

Bear in mind that if you imple­ment the DMCA require­ments in the sim­plest way, you have to make sure that nei­ther a track from the same artist nor album is played more fre­quent­ly than once an hour. In terms of SAM’s Playlist Rota­tion Rules, this means an “artist rep­e­ti­tion” and an “album rep­e­ti­tion” of 60 min­utes (ie at least 60 min­utes must pass before anoth­er track from the same album, or by the same artist, can be played).

If you build playlists by choos­ing a theme and then adding entire albums that embody that theme, then play out all the tracks from those albums at ran­dom (which is I think what most of us do most of the time), then in gen­er­al, a rough esti­mate for a good mix is:

(artist rep­e­ti­tion rule in min­utes) / (aver­age track length in min­utes) = num­ber of artists

floor( ln( (album rep­e­ti­tion rule in min­utes) / (aver­age tracks on an album) ) * num­ber of artists ) = num­ber of albums

Notice that the length of the pro­gramme does not appear in this for­mu­la. How­ev­er, this does give you the min­i­mum size of the album “pool” you need to cre­ate a playlist that will meet DMCA rules.

For those with a math­e­mat­i­cal bent: the floor func­tion is a spe­cial kind of “round­ing” func­tion: floor(x) rep­re­sents the great­est inte­ger less than or equal to x. So if x = 4.9, then floor(x) = 4, for exam­ple. You always round down. And here you can find a cal­cu­la­tor to eval­u­ate nat­ur­al log­a­rithms, ie ln(x).

Exam­ple

Assume that the aver­age num­ber of tracks on an album is 12, and the aver­age track length is 4 minutes:

Giv­en that the artist rep­e­ti­tion rule is 60 min­utes and album rep­e­ti­tion rule is 60 minutes:

60 / 4 = 15 artists

floor( ln ( 60 / 12 ) * 15 ) = floor( ln ( 5 ) * 15 ) = 24 albums

(ln (5) = 1.6094379124341; ln(5) * 15 = 24.141568…; so the floor val­ue is 24.)

This is there­fore the min­i­mum num­ber of albums and artists you can have in a DMCA-com­pli­ant playlist, giv­en the aver­age num­ber of tracks on an album and the aver­age track length spec­i­fied above. You can have a longer playlist, of course (but not a short­er one), and as long as the artist:album ratio (with these aver­age val­ues) remains 15:24 (or about 1.6 albums per artist), you won’t run out of music.

But don’t for­get that if your aver­age num­ber of tracks per album and/or their length is dif­fer­ent, the ratio will dif­fer too, so work out the ratio for the kind of music you’re playing.

Leave a Comment