liquidsoap icon indicating copy to clipboard operation
liquidsoap copied to clipboard

Try to build a professional fading between the songs

Open PB-SF opened this issue 4 years ago • 9 comments

Hi there.

We have been running a web radio station for many years. We run our live broadcasts via radio software under windows. Liquidsoap is used as a backup and for unmoderated times in the program.

In order to set the unmoderated program at the same thing as the live broadcasts, i have been trying for days to build a professional transition between the songs in liquidsoap.

The principles that we also use in the live software are:

  • Songs must never be faded in! Important!
  • Standard fade length: 3500ms
  • Fade out starts at: -15dB
  • Max. Time: 4000ms
  • The indication of -15dB refers to the loudness of the songs, which are all played according to the radio standard R128 EBU.

I tried a lot by editing the crossfade parameter of Liquidsoap (with and without smart attribute). I also tried using the parameters according to the loudness (high medium low)

Unfortunately, that hasn't brought me a good result so far.

The last approach was: radio = crossfade (smart = true, duration = 4.00, fade_out = 3.50, fade_in = 0.00, radio)

Unfortunately this variant either creates transitions that are far too long or there is silence between the songs

Maybe there is someone who can help me a little.

Many Thanks.

PB-SF avatar Dec 19 '20 06:12 PB-SF

This is hard, and a very interesting issue…

gilou avatar Jan 08 '21 11:01 gilou

Hi @gilou

Yes that's true. i got a good result with radio = crossfade (smart = false, duration = 4.50, fade_out = 3.00, fade_in = 0.00, radio)

This means that the songs are not faded in and the transition is limited to the maximum length. That's good.

If a song has a long and quiet outro, the transition should start before the maximum time (4000ms before EOF) is reached. Even when the volume drops below -15dB.

I haven't done that yet. Especially since I don't know how to tell Liquidsoap that the -15db relates to the loudness of the playback (EBU R128).

Maybe there is a solution out there?

PB-SF avatar Jan 08 '21 21:01 PB-SF

I used this: https://github.com/Warblefly/TrackBoundaries

It's very simple to use (at least for my use case), just run cue_playlist.py and give it your playlist file, and it creates a new one with the annotations needed for the cue_cut operator to work. Then on your liquidsoap script you just do

s = cue_cut(playlist("~/yourplaylist-processed.m3u8"))
s = crossfade(fade_out=0.01, fade_in=0.01, conservative=true, s)

And that's it. Obviously you can customize the loudness you want the track to drop below in order to play the next track and some other stuff. I used the defaults and it works pretty well.

Allavaz avatar Nov 19 '21 16:11 Allavaz

Hey, that looks cool, I'm going to check it out! but beware, I assume you let a password slip in john.txt...

gilou avatar Nov 19 '21 21:11 gilou

It's not my repo, I found it somewhere, but yeah, that's kinda worrying...

Allavaz avatar Nov 19 '21 23:11 Allavaz

I think it was one of the liquidshop presenter hehe, I'll talk to him..

gilou avatar Nov 20 '21 01:11 gilou

On Sat, 20 Nov 2021, 01:36 Gilles Pietri, @.***> wrote:

I think it was one of the liquidshop presenter hehe, I'll talk to him..

Ha! That's made me smile. I do try not to leak passwords. It's for one end of my IPv6 tunnel, used only for one host (the stream) but it would be very funny if someone tried to hijack it.

Thanks, seriously, for the warning. And I'm complimented that my code, probably deeply unprofessionally written, might be useful in some way.

With best wishes, John

Warblefly avatar Nov 20 '21 08:11 Warblefly

You guys are Linuxian techno geeks; you therefore try to apply solutions via coding which may or may not work out for you. But, fact is that the bulk of radio operators aren't coding savvy and are utterly helpless with the LS version of crossfading. We need a module that is user-friendly, predictable and reliable.
I concur with what the basic starting parameters of such a crossfade process should entail as stated by PD - SF at the outset. The following image, IMHO depicts what such a module should look liker; 146373574-3b8c30bc-8007-4092-95f0-29b37d4c5ffb I'm sure you'll recognize the provenance of that screenshot

No need to reverse-engineer the app that came from, but that is the standard that LS should strive to achieve...

SpeedyCharly avatar Jan 14 '22 22:01 SpeedyCharly

https://github.com/AzuraCast/AzuraCast/discussions/6252#discussioncomment-6938514

pozhiloy-enotik avatar Sep 07 '23 15:09 pozhiloy-enotik