Hi all,
is there a way to read out which songs were played last show? I’m thinking about reading out the visibility status out the setlist, but I cannot find the information in any data.
Has anybody any clue about this topic?
Best,
Max
Hi all,
is there a way to read out which songs were played last show? I’m thinking about reading out the visibility status out the setlist, but I cannot find the information in any data.
Has anybody any clue about this topic?
Best,
Max
Hey @Basstor,
you could use a shared variable that is updated every time a song is played. Here’s a project script that adds the current song when it’s played for more than 3 seconds:
const KEY = "playedSongs";
const MIN_PLAY_MS = 3000; // song must keep playing this long before it counts
let timer = null;
/** @type {string | null} */
let lastAdded =
String(osc("/shared/" + KEY) ?? "")
.split("\n")
.filter(Boolean)
.pop() ?? null;
function addSong(song) {
const current = String(osc("/shared/" + KEY) ?? "");
sendOsc(`/shared/${KEY}`, current ? current + "\n" + song : song);
lastAdded = song;
}
function evaluate() {
if (timer !== null) {
clearTimeout(timer);
timer = null;
}
if (!osc("/global/isPlaying")) return;
/** @type {string | null} */
const song = osc("/setlist/activeSongName");
if (!song || song === lastAdded) return;
timer = setTimeout(() => {
timer = null;
if (osc("/global/isPlaying") && osc("/setlist/activeSongName") === song) {
addSong(song);
}
}, MIN_PLAY_MS);
}
onOscChange("/global/isPlaying", evaluate);
onOscChange("/setlist/activeSongName", evaluate);
evaluate();
You can then display this list in a Canvas either using a Label or a multi-line Input element.
Would that work for you? ![]()
Hi @leolabs,
thank you for that suggestion! Tbh I would look for an easier and more convenient way. Isn’t there a way to read out, wich songs are still shown in the setlist and which not?
In our case, we are only using one main setlist and the songs, which have been played, simply disappear after they have been played.
This information has to be stored somewhere, right? I just need to find that location ![]()
Best,
Max
If you’re comfortable using an undocumented HTTP endpoint, you can make a GET request to http://localhost/api/setlist. That will give you a list of songs along with their metadata.
In AbleSet 3.1 and older, each song contains a skipped property which is true if the song isn’t in the setlist. In AbleSet 3.2, this changes and you’ll have a separate setlist array containing a list of all songs that you can compare to the songs array to find out which songs aren’t in the setlist anymore.
Would that work for you? I’m looking forward to your reply!
That could work out for me! I will soon upgrade to 3.2 (the mentioned behavior should be available in the latest beta, right?).
Besides that, the workflow with the “skipped” property will not work, as we are having every song in the setlist, the played simply are invisible. Can I somehow read out the invisibility state?
That’s what the skipped property does ![]()
A skipped song in AbleSet 3.1 and lower is just a song that’s not part of the setlist. All other songs are displayed in the order set by the order property.
The skipped property exactly means: “Is the song part of the setlist or not?” - right?
If the song was played and is now invisible, it is still part of the setlist but invisible - but I already saw in Beta 3.2.0 (with the new setlist feature), then it is actually not part of the setlist anymore.
I guess, it is obsolete with the new setlist feature ![]()