Playlists
A playlist is a named, ordered list of rows, and each row is a cart on the cart wall. It is not a list of library tracks: a sound goes on the wall first, then into a list. The design and the operator’s answers are ADR-0304; this page describes the control plane as built.
In the studio app the lists are the Carts tab’s Playlist… and the column beside the wall (carts.playlist), with two lines on the Desk (desk.playlist); Play a playlist is the walk-through.
Whose lists
Section titled “Whose lists”| Owner | Holds | Who changes it |
|---|---|---|
| The station | the station’s carts only | any member of staff, the station key, or an API token with carts:write |
| A show | its own carts and the station’s | its presenter, a producer or an admin, from a preparing window too; never an API token |
Each owner has at most 20 lists, each of at most 200 rows, and uses a name once (whatever its capitals). A show’s lists go when the show is deleted. The same cart may be in a list more than once.
A row and its cart
Section titled “A row and its cart”A row keeps its own id for its whole life: a save names the rows it keeps by id, so moving rows never loses them.
| The cart | The row |
|---|---|
| is renamed or moved to another slot | follows it: the same cart |
| has its sound replaced (a new file put in its slot) | follows it: a replaced sound is a new cart with a new id, and the row is moved to it in the same transaction, with its new name |
| loses its file from the disk | says FILE MISSING (missing), as the wall does |
| is taken off the wall, or its bank removed | stays, marked REMOVED (removed, cart null), with the name it had; the DJ takes it out |
Rows that are FILE MISSING or REMOVED are passed over when the list plays.
The cart catalogue (GET /api/v1/carts) counts the lists that hold each cart (playlists), so the studio can say how many lists a removal touches first.
The routes
Section titled “The routes”| Route | Does |
|---|---|
GET /api/v1/playlists |
the station’s lists; with ?show=<slug>, that show’s beside them, each with its rows in order |
POST /api/v1/playlists |
{"name", "show", "play_through"}: an empty list for the station (show left out) or a show. 201, with its id and the lists |
PUT /api/v1/playlists/{id} |
{"version", "name", "play_through", "rows": [{"id"} or {"cart"}]}: the whole list, in its new order. Rows left out go |
DELETE /api/v1/playlists/{id}?version= |
deletes it; its carts stay on the wall |
A list carries a version, moved by every save. A save or a delete sends the version its window read; if anyone saved the list since, it is refused (409) with who did, Finlay Grant changed this playlist since this window read it, and the window reads the lists again.
A row of another list, a row named twice, a cart that is not on the wall, a show’s cart in a station list or another show’s cart in a show’s list are 422.
A 21st list and a name in use are 409.
Each list says play_through: off when a list is made, so each row waits for Next.
The studio’s view (GET /api/v1/studio and its event stream) carries playlist.version, which moves whenever a list changes or the wall’s carts do: a window then reads the lists again.
On the desk
Section titled “On the desk”Each owner, the station and each show, has at most one list on the desk, with a mark, NEXT: the row Next plays. Next plays the show’s own list while that show is the one the station’s step comes from (the show on air, or between shows the show last on air, the same rule as a show’s own carts), and the station’s list otherwise. So at a handover the desk moves to the next show’s list at the post, with its mark where its DJ left it while preparing; a row of the old list that is sounding plays out, and nothing follows it.
| Route | Does |
|---|---|
PUT /api/v1/playlists/run |
{"show", "playlist", "next", "restart"}: puts one of the owner’s lists on its desk. next is a row for the mark (Next from here); restart puts the mark on the first row and forgets which rows have played; with neither, the mark stays where it was if the list was already on the desk, and is the first row if not. playlist left out takes the owner’s list off the desk. Nothing starts |
Who may: as for changing the owner’s lists. The station’s desk and the desk of the show the step comes from are live: only a live window changes them, or the list on them (a preparing window is 409). So the next DJ chooses their own list and its mark while preparing.
The listing (GET /api/v1/playlists) carries each shown owner’s runs: {"show", "playlist", "next"}.
Next, Stop and Cue
Section titled “Next, Stop and Cue”They are words of POST /api/v1/carts/commands, as the carts’ keys are, and need what firing a cart needs: a live window, the station key, or an API token with carts:fire.
| Word | Key | Does |
|---|---|---|
{"op": "playlist_next", "expect": "<row>"} |
F8 |
plays the NEXT row and moves the mark down one; a row of the same list that sounds fades over 300 ms as the new one starts |
{"op": "playlist_stop"} |
F9 |
fades the row the list started; the mark stays and nothing else starts |
{"op": "playlist_cue"} |
⇧F8 |
cues the NEXT row into the presenters’ ears, or takes it out of the cue; the mark does not move |
- Rows passed over. Next and Cue pass over rows that are REMOVED or FILE MISSING and play the first row that can, and the view names the rows passed over (
skipped). If no row from the mark on can play, nothing starts and the answer says which rows and why (409). - The end is the end. After the last row the mark is past the end (
nextnull, ENDED) and Next answers The list has ended. Nothing wraps round. Rows put at the end of a list that has ended become NEXT. - Two presses.
expectis the row the window shows as NEXT. Presses are taken one at a time, so a second press finds the mark moved and starts nothing: Shona Campbell already pressed Next: Salt Road is playing. (409). A press withoutexpectwithin a second of any start, and any press within a second of a start by play-through, is taken as the same press (409). - The same cart twice running. The desk will not start a cart that is already on air, so a row whose cart is sounding (the row before, or the cart fired by its own key) is stopped first and starts again from the top.
- A row that will not start (all eight one-shot players busy, its file not found by the desk, the desk away) stays NEXT, nothing else is tried, the list is HELD with the reason, and a notice says why. The row before it, if any, keeps playing.
- The desk restarts. Its carts stop with it: the list is HELD (HELD: the desk restarted. Salt Road was cut off.), with a serious notice. NEXT stays where it was, and nothing starts when the desk returns.
- The desk misses a status request. It may well be playing the row still, so the row stays the list’s (Stop and the next Next still fade it), and only play-through holds (HELD: the desk is not answering, so play-through waits for Next.). A row the desk no longer reports, whose end was never read, is dropped and the list held.
- A row fails part-way (it could not be decoded to its end): the list is HELD, with a serious notice.
- Stop, Fade all, End show and the cart’s own key end the row as stopped: the mark stays and nothing follows it.
- A cart fired by its own key is not the list’s: the mark does not move.
HELD clears at the next Next that starts a row, or when another list is put on the owner’s desk. Which row is sounding is kept in memory only: after a restart of the control plane nothing is known to sound, and nothing follows anything until the next Next. The list on each desk and its mark are kept in the database.
The studio’s view carries playlist.on_desk, the list Next plays now: its playlist, show, name, play_through, state (waits_for_next, plays_through, held or ended), next, playing (its row, cart, play, started_ms, ends_ms, and stopping while it fades), held (why), played (each row that has played with when it last started), last (who pressed Next, or play-through, and when) and skipped.
In the rehearsal studio (from 1.4) Next, Stop and Cue are playlist_next (with the row it expects), playlist_stop and playlist_cue on POST /api/v1/rehearsal/commands.
They play the list the live desk would play for the rehearsed show (its own on its desk, else the station’s) at the rehearsal desk, on a mark of the rehearsal’s own: it starts where the live mark stands when the session first reads the list, or when another list is put on the desk, and it ends with the session.
The live mark never moves, nothing reaches the per-play log, and nothing follows a row by itself: play-through does not run in rehearsal, whatever the list’s setting, and the list says In rehearsal the list waits for Next.
A move to the live studio carries no mark: the live studio’s list is where its own mark left it.
The rehearsal view carries the list as playlist (the same shape as playlist.on_desk; its state is waits_for_next or ended) and the sentence as playlist_words.
The refusals are the live ones (409 with no list on the desk, at the end, when nothing from NEXT on can play, when the mark moved since expect was read, or when nothing the list started is sounding).
Play-through
Section titled “Play-through”A list’s play_through setting (off when a list is made) lets it go on by itself: when a row the list started runs out, the next row starts.
It is the only part of the playlists that starts sound with nobody pressing a key, so it starts the next row only when all of these hold:
- the desk said the row ran out: not stopped (Stop, Fade all, End show, the cart’s own key, even a moment before it ran out) and not failed;
- it is the very play the list started, on the same desk, and not a cue;
- the list is still the one on the desk, play-through is still on, and the list is not HELD;
- the show’s slot: the schedule has the same show on air as when the row started, and for a show’s own list, that show.
The last is a safety rule. While the desk makes sound it outranks automation, so a list left playing would hold the air into the next show’s time, or into public time after a keyed show. So between shows, once the show’s slot has ended, or once another show has the air, play-through starts nothing: the list says HELD (HELD: the show’s time has ended, so the list waits for Next.) and Next by key carries on. This narrows play-through: a DJ on air with no show in the schedule never gets it, and a show that runs over loses it at its scheduled end. A show made with Start now has a slot, so it gets play-through.
- Automation has the air: handing the air to automation (the station’s mode
auto, byPOST /api/v1/playout/mode, End show, or the schedule) stops a list that plays through. Its sounding row fades as Stop fades it, and the list says HELD (HELD: the air was handed to automation, so the list waits for Next.). While automation has the air, a row’s end starts nothing. A list that waits for Next is left as it is: its row plays out unheard, or a bed loops unheard until Next or Stop. Next by key still plays a row, unheard; after the air is taken back, Next plays and play-through follows again.
A bed is a row like any other and loops until Next or Stop, so a list that plays through waits at a bed. At the end of the list it stops: ENDED, not HELD. Each row’s end is followed once. An end read more than 5 seconds ago starts nothing, and the list holds; so does a row the desk stopped reporting whose end was never read, and any play events the control plane missed.
The control plane starts the next row when the desk reports the end, which it reads with its status poll (desk.poll_ms, 250 ms) and the desk then takes up to half a second to start a file, so there is a short silence between rows: probably a quarter to half a second (not yet measured; ADR-0304 accepts it for 1.4 and asks for it to be measured before the release).
Music reporting
Section titled “Music reporting”A row is a cart, and a cart that goes out is in the per-play log and its CSV with the cart’s name and its second line as the artist. The SoundExchange report leaves carts out, as it always has, and a cart has no album or ISRC (ADR-0304, answer 7): a station that must report music played from a playlist uses the per-play log’s CSV.
Text and images CC BY-SA 4.0; code samples AGPL-3.0-only, as the code is. Licences.