Music scheduling in mAirList 5

It was a bug, transitions were only handled for “Music block”, not for “Fill with music”. Please give the new build 2543 a try.

Hm, just briefly tried build 2543 but I still don’t get any jingles :-
I’m starting to think I’m missing something myself but I can’t figure it out.

Are the songs correctly tagged as “Music” in the item properties?

Yes they are all tagged as “Music”.

Could it have something to do with my hourtemplate?
I’m not using the starting marker and end of hour marker.


mAtest.png

Found another bug. Try b2544.

Really strange things are happening now with b2444 as you can see on the screenshot. The jingles are scheduled now but everything else is a little bit strange.


mA11.png

What kind of music block is the broken block? “Fill with music”, or “Music block”? And does it work when you remove all transition rules?

I have used the hourtemplate from post #44; both blocks are “Fill with music”. And after removing the transition rules it’s still not working.
When I use the template for the chart, songs from block 2 (20-11) end up in between songs from block 3 (10-1). Here also no difference with or without transition rules.

Sorry, very, very stuped programming mistake I made (mixed up two for loop parameters).

Build 2545 should be working, finally.

Almost there! :smiley:
Scheduling works fine, transition jingles work fine too.
I just get this error message when I want to save the just created playlist.


mA0001.png

I see. Seems to be related to a fixed I pulled in from v4.4 this morning regarding Unicode support on PostgreSQL.

Try b2546.

PS: You can copy the text of these dialogs with Ctrl+C. Again, no screenshot required :slight_smile:

Everything is fine now! Thanks Torben.
(I’ll try to remember Ctrl-C)

Hi
A question about the “fill with music” item. For simplicity, say I have a jingle to start the hour and a jingle to finish. I want the rest of the hour filling with music. Again say this is now 58m. Will the scheduler pick the songs to exactly meet 58m, or will it just provide enough songs. What I am trying to avoid is a song starting at say 57:33 but it actually lasts for 5:00 so a fair chunk of it will be faded out.
Thanks
Al

For the time being, it’s “just enough songs”.

Trying to find an exact match, or the optimal selection, is a very complex problem: https://en.wikipedia.org/wiki/Knapsack_problem#Computational_complexity (In a nutshell, you cannot find the optimal selection without trying all possible selections, which means exponential time.)

But I do see the chance to make the algorithm a bit more clever, without making it too complex. For example, for the last song in the block, it could try to pick the shortest one available (of the pool of songs that satisfy all selection and restriction rules), so not the 5:00 one if there is a shorter one available.

The guys from the professional scheduling packages (Music Master, Powergold, Selector, …) have some very clever approximation algorithms for this. But I don’t. That’s why it’s the “Mini Scheduler”.

Hi Torben

Thanks for the reply and this “But I do see the chance to make the algorithm a bit more clever, without making it too complex.”

I will investigate it. But let me elaborate on the last point, and the kind of optimatization that would be possible, and the kind that would not:

Imagine you have 4 minutes that need to be filled. If there is a single candidate song that is just a bit longer than 4 minutes - perfect, just pick that one, and everything is fine. (Generally, if there is more than one song that is longer than the required 4 minutes, the scheduler should pick the shortest one from that pool, assuming that all candidates have the same penalty score wrt. artist/title separation.)

But the real problem starts when there is no song that is 4:00 or longer. In other words, when the scheduler has to pick at least two songs. The knapsack problem, translated to music scheduling, states that you cannot find the “best” subset of songs (lowest overflow) without trying all possible combinations of songs. For 4 minutes, and perhaps a folder with 20 items or so, this is not much of a problem. But imagine a period of 30 minutes to be filled, and a pool of 15,000 songs…

As mentioned above, the pro scheduler packages have approximation algorithms based on years of research - definitely beyong the scope of the Mini Scheduler.

What should be possible:

  1. For the “last song” case, check if there is a single song that fills the remaining gap, in other words, avoid picking the 3:50 song if there is a 4:01 one.

  2. As we cannot avoid any overflow for the last song in general, offer an option to distribute the overflow over all songs in the block, in other words, rather cut 30 songs from each of the four songs in the blocks, than 2 minutes from only the last one.

Thanks again.
I have kind of found a way to minimise the song being cut off by using the attached template. I must stress that I have only used it for 1960s music, which has a lot of instrumentals. The “rules” being: try not to fade an actual song too much, however, it is fully acceptable to fade an instrumental track at any duration.
The template (so far) is:-
Fixed Start of hour.
Specific item (jingle) with a hard fixed time 0f 00:00:00
Fill with Random items from folder = 60s. With Normal timing.
Random item from instrumental folder with a Soft fixed time of 00:58:00
Specific item (a jingle) which is Backtimed
End of hour marker.

Although this indicates an under-run, it actually works in practice.

The results - either the last song fades reasonably and then the fixed jingle, or the last song completes in it’s entirety and the instrumental fills the gap up to the fixed jingle.


60s template.JPG

Yes, that’s a possible solution. Edit item #4 (the filler) and enter 00:02:00 as the estimated duraion, it will make the Underrun go away.

(At the time you set up the template, mAirList does not know the duration of the song that will be picked later - so you have the option to enter an “estimated duration” to make a rough calculation on template-level possible.)

I have investigated the “last song” optimization in the meantime. The updated algorithm works quite well. There are some interesting side effects though. I have some rather long songs in my pool, 6 minutes or longer. With the new “try to find a single song that fills the gap” policy, the scheduler tends to pick one of those very long songs, rather than two 3:30 songs. That’s the downside of this “greedy” approach. Perhaps we should make the whole thing optional. I’ll keep thinking about it.